Cameo GUI freezes during Macro execution

General discussions about code engineering

Moderator: Moderators

Cameo GUI freezes during Macro execution

Postby » Thu Sep 26, 2019 4:51 am


when I execute my macro to get all objectflows and create ports and interfaceBlocks out of it, the GUI freezes.
Is there a way to avoid that behavior?

Furthermore, why can't I get all objectflows via StereotypesHelper. It return null with the StereotypesHelper.getStereotype():

Code: Select all
var project = Application.getInstance().getProject();
var profile_UML =       StereotypesHelper.getProfile(project, "UML Standard Profile");
var path_ObjectFlow_Stereotype =   model._getChild('UML Standard Profile')._getChild('UML2 Metamodel')._getChild('ObjectFlow');
var ArrayList = Java.type('java.util.ArrayList');

function get_All_Objectflows()
      var found_Objectflow_List = new ArrayList();
      var current_Stereotype;
      var current_ObjectFlow_List;

      if((StereotypesHelper.getStereotype(project,, profile_UML))!= undefined)
         Application.getInstance().getGUILog().log("current_ObjectFlow_List: " + current_ObjectFlow_List);
         current_Stereotype = StereotypesHelper.getStereotype(project,, profile_UML);
         current_ObjectFlow_List = StereotypesHelper.getExtendedElements(current_Stereotype);
         for(var y=0; y<current_ObjectFlow_List.length; y++)
            Application.getInstance().getGUILog().log("current_ObjectFlow_List: " + current_ObjectFlow_List[y].name);
      return found_Objectflow_List;

Further information:
Cameo Systems Model 19.0 SP2
Language used for Macro scripting: Javascript

Best regards,
Forum Newbie
Forum Newbie
Posts: 1
Posts Rating:0
Joined: Thu Sep 26, 2019 4:36 am

Return to Code engineering

Who is online

Users browsing this forum: No registered users and 9 guests