You have different options to realize this functionality. Please find below 2 different approaches that could be realized in your implementation:
Alternative A: AdoScript-based Solution:The validation of the process model can be realized by a triggering and validation script either by user interaction (click on menu) or triggered by listening to a platform event (e.g. "SaveModel" or "OpenModel" - please find the details for both events below). The pseudo code could - depending on your configuration, would parse the model and validate the outgoing connections of branching objects according to the rule set defined.
1
2ON_EVENT "OpenModel" {
3 #Get all instances of class "branching"
4 CC "Core" GET_ALL_OBJS_OF_CLASSNAME modelid: (VAL modelid) classname:"Branching"
5 SETL lBranchingObjIDs: (objids)
6 FOR sBranchingObjID in: (lBranchingObjIDs) {
7 CC "Core" GET_CONNECTORS objid: (VAL sBranchingObjID) out
8 SETL lOutGoingConnectors: (objids)
9 #Get attribute value and calculate whether the sum is 1
10 }
11}
1ON_EVENT "SaveModel" {
2 IF (origin = "save") {
3 #Get all instances of class "branching"
4 CC "Core" GET_ALL_OBJS_OF_CLASSNAME modelid: (VAL modelid) classname:"Branching"
5 SETL lBranchingObjIDs: (objids)
6 FOR sBranchingObjID in: (lBranchingObjIDs) {
7 CC "Core" GET_CONNECTORS objid: (VAL sBranchingObjID) out
8 SETL lOutGoingConnectors: (objids)
9 #Get attribute value and calculate whether the sum is 1
10 }
11 }
12}
Alternative B: Simulation Component ConfigurationADOxx 1.3 UL1 has basic simulation functionalities included. The simulation algorithm can be used to determin the consistency of the process graph according to your needs. In case the simulation algorithm can not determine consistency with requirement of the algorithm (actually a path analysis), an error message is displayed.
To enable this functionality, two steps of configuration have to be performed in your modelling language implementation
1. Enable the functionality (in the sample below as a menu item, can also be event driven as above): 1#-----------------------------------------------
2ITEM "Check validity" modeling:"Extras"
3#-----------------------------------------------
4
5CC "Modeling" GET_ACT_MODEL
6 # --> RESULT modelid: intValue
7SET idCrtModelID: (modelid)
8
9SETG errmsg: ("")
10
11CC "Simulation" RUN_PATH_ANALYSIS modelid: (idCrtModelID) runs:100 auto-read-only:1 no-error-messages:1 no-result-window
12 # --> RESULT ecode: intValue errmsg: strValue
13
14IF (ecode) {
15 CC "AdoScript" INFOBOX (errmsg)
16}
2. Configure the mapping of classes and attributes to the simulation modelFor details on the mapping, please have a look on the attached sample implementation. the classes are generic in this sample and you can see how they are derived from the underlying meta-model to enable the functionality
1M : __Activity__
2N : __Start__
3P : __D_end_
4Q : __Decision__
5Parallelism : __Parallelity__
6Merge : __Merging__
7Sample : __D-construct__