I am working on an automated process for creating standardized models.  I have succeeded in writing a report which creates  customized template models.  However, within the report I was unable to place the name of the model on the model graphic.

I am attempting to write a macro which places the name of a model (as an attribute) automatically, when there is no existing placement on the model.  This would allow me to either select models from the ARIS explorer or standardize name placement upon the model initially being created.

The current code that I have written is here:

function formatModel(model)

     //opens a model that is modifiable, invisible, and is allowed to display error dialogs.
     Designer.openModel(model, false, false, false);
     var nameAttr = Designer.createAttrOcc(model, null, Constants.AT_NAME, Constants.ATTROCC_ALIGN_LEFT);

The difficulty lies in the 'createAttrOcc' function, which in this case is returning a null pointer exception.  The documentation that I have for this method is here:

The problem I am having is that I can't determine what to put in the 'occ' parameter.  When a model is first created, there are no occurrences placed on the model.

Does anyone know a way around this issue?


Tags: macro