• 1 reply
  • Latest Post - ‏2012-10-24T16:23:02Z by ZvikaV.
2 Posts

Pinned topic Adding a Controlled file (custom XML schema) using Java API

‏2012-09-25T17:09:22Z |

I'm attempting to add a ControlledFile (used by our Wizard) via the Java API but I am not having much luck. I have tried a few of the techniques I've read in the forums, but still little progress. Recently I have tried something like:

IRPModelElement me = myRhapProj.addNewAggr( "ControlledFile", "My XML File" );

This alone will create a ControlledFile element name "My XML File" in the Rhapsody project exactly as expected. However, if I attempt to cast to IRPControlledFile to change the file path

(IRPControlledFile)me.setFilename( "some/path" );

I get an "unspecified error" message - no exception, just this error msg.

Also, when I call myRhapProj.getControlledFiles(), I always get a container of 0 elements. I see the controlled file in the package in Rhapsody (albeit with an incorrect file path), but when I try to extract with getControlledFiles() I do not see any of the files I've added via Java API.

Any help would be greatly appreciated.

Updated on 2012-10-24T16:23:02Z at 2012-10-24T16:23:02Z by ZvikaV.
  • ZvikaV.
    18 Posts

    Re: Adding a Controlled file (custom XML schema) using Java API

    Please try to use the setTarget instead of the setFilename.