ARIS Community - We Love BPM

How to set a margin to a model with scripting?

Ana CSequeira's picture
by Ana Sequeira in Reports & Macros posted on 2016-12-22

Hello, I know how to do this manually, I do it like you can see in the picture below: 

(open model (bpmn), click format and click layout)

 <- Write 300 in left margin


But I need to do this with a script, I tried: 


    var bpmn = Constants.MT_BPMN_COLLABORATION_DIAGRAM;
             var muda = oModel.doLayout();

SetSpacing is not working either and it's not possible to use a setMargin function.

Of couse if I change the layout options manually first, and run the "oModel.doLayout();" it will apply and work, but I need to settle those options (margin=300) in the script only.

Does Anyone know how to do this?

(Previously I tried to move all the objects in the model with the funcion setPosition, but it messes up the connections in the model : / and it doesn't work well in "fresh" generated bpmn with the default transformation "EPC2BPMN" )


Sorry there are no tags
There are no attachments
Daniel Dekkers posted on 2016-12-24

Thanks for this sharing. Good Code.