Engineering

Engineering

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

Rhapsody API: addCallBehavior() / addReferenceActivity() does not work as expected

  • 1.  Rhapsody API: addCallBehavior() / addReferenceActivity() does not work as expected

    Posted Wed October 14, 2020 08:04 AM

    Hello all, my task is to clone a activity diagram originalAD, delete some, but not all, of the edges and nodes from the cloned diagram clonedAD. Afterwards a callbehavior from originalAD to clonedAD shall be added with originalAD.addCallBehavior(clonedAD).

    The result is: the callbehavior is to be seen in the Model View, but not in the diagram view. Even the Feature-window says it is a CallBehavior.

    What do I miss?

    Rhapsody version 8.4

    Here my code:

    IRPPackage newPack = (IRPPackage) project.findElementByGUID(packageGuid);

    IRPFlowchart clonedAD = (IRPFlowchart) originalAD.clone("newDiagramName", newPack);

    // deleteUnwantedNodes(project, app, clonedGraphicNodesList, selectedGraphicNodesList);

    // deleteUnwantedEdges(project, clonedGraphicEdgesList, selectedGraphicEdgesList);

    IRPState newElement = originalAD.addCallBehavior(clonedAD);

    originalAD.createGraphics();

    clonedAD.createGraphics();

    saveProject();






    #SupportMigration
    #Sustainability
    #Support
    #Engineering


  • 2.  RE: Rhapsody API: addCallBehavior() / addReferenceActivity() does not work as expected

    Posted Thu October 15, 2020 06:14 AM

    call createGraphics();after adding the callbehavior






    #Sustainability
    #SupportMigration
    #Support
    #Engineering


  • 3.  RE: Rhapsody API: addCallBehavior() / addReferenceActivity() does not work as expected

    Posted Mon October 19, 2020 08:13 AM

    You will need to add the graphical symbol for the call behavior to the diagram using the api - Rhapsody does not do that automatically.

    Look at the IRPActivityDiagram api which has calls like addNewNodeForElement






    #Engineering
    #SupportMigration
    #Sustainability
    #Support


  • 4.  RE: Rhapsody API: addCallBehavior() / addReferenceActivity() does not work as expected

    Posted Tue October 20, 2020 11:40 AM