Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Filtering MODEL_SELECT_BOX list
Answer
4/1/16 6:21 AM
Hello,
1. Could I place an execute file on event 'appInitialized' using the code: EXECUTE file: (db:\\suggestOntologiesForAnnotations.asc)?
I want when the application opens to search for each BPMN model which is the most 'suitable' ontologies for annotations automatically.

2. On 'Model Select Box', how could I choose to appear only some of my BPMN models that meet certain criteria?
I use the restriction: modeltype: "Business process diagram (BPMN 2.0)" but i don't want all BPMN models. Is there a solution for this case?

Kind regards

RE: Filtering MODEL_SELECT_BOX list
Answer
4/1/16 6:52 AM as a reply to Anonymous.
1) Yes, you can execute files also with the AppInitialized event.
2) The parameters that you can define for the command MODEL_SELECT_BOX are as follows:

 1CC "CoreUI" MODEL_SELECT_BOX [ opened-models | loaded-models ]
 2                            [ multi-sel ]
 3                            [ show-all-versions ]
 4                            [ threads ]
 5                            [ presel-modelids:strValue ]
 6                            [ without-models ]
 7                            [ mgroup-sel ] [ presel-mgroupids:strValue ]
 8                            [ with-app-models ]
 9                            [ SingleMTFilter | MultiMTFilter ]
10                            [ title:strValue ]
11                            [ boxtext:strValue ]
12                            [ oktext:strValue ]
13                            [ w:intValue h:intValue ]
14                            [ min-w:intValue min-h:intValue ]
15                            [ setdblclick:intValue ]
16                            [ extra:{ Extra } ]

By definition there are no additional filters for models with certain properties. But here we can make a work-around as follows:

1) Query the models with the certain property with ADOxx Query Language (AQL)
AQL Documentation
2) Open the models from step 1.
3) Close all other models.
4) add the extension 'opened-models' to the MODEL_SELECT_BOX command
 

The following code snippet is an example to implement the above described step.

 1#Query the models with the "Model type"-attribute value equals "Current model"
 2CC "AQL" EVAL_AQL_EXPRESSION expr:"<\"Business process diagram (BPMN 2.0)\">[?\"Model type\"=\"Current model\" ]" modelscope
 3SET sCurrentModelsModelType: (objids)
 4#Close all other opend models
 5CC "Modeling" GET_OPENED_MODELS
 6SET sOpenedModels: (modelids)
 7SET sNotMathingModels: (tokdiff(sOpenedModels,sCurrentModelsModelType))
 8FOR i in: (sNotMathingModels) {
 9  CC "Modeling" CLOSE modelid: (VAL i)
10}
11#Open the models of the query result
12CC "Modeling" OPEN modelids: (sCurrentModelsModelType)
13#Add "opened-models" extension
14CC "CoreUI" MODEL_SELECT_BOX opened-models