Page 1 of 1

Cameo GUI freezes during Macro execution

PostPosted: 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,