Activity Execution - cristal-ise/kernel GitHub Wiki
-
createTablescurrently disabled, has to be run separately
- For each item an
ItemImplementationinstance is created in the memory. - When a CORBA call is received, Cristal finds the
ItemImplementationobject for the item and callsdelegatedActionon it
ItemImplementation.delegatedAction() is invoked for all actions and predefined steps
The original idea behind delegated was that if an authorized agent goes on vacation, he delegates his duties to someone else.
- get the Workflow of the item
-
Workflow.requestAction()- find the Activity (vertex)
- call
Activity.request()using itself as alockerobject -
Activity.request()- find requested Transition
- check authorization
- check that outcome was given if needed
- get new state
-
Activity.runActivityLogic- run extra logic in predefined steps (overridden method in predefined steps)
- set new state and reservation
- unmarshal Outcome
-
History.addEvent()->RemoteMap.put()called for theevent-
TransactionManager.put()- caches the
put()call (as a "pending transaction"), but only in an internal cache, does not invoke theClusterStorage - calls are grouped by the
lockerobject (basically used as a transaction ID)
- caches the
-
-
Gateway.getStorage().put()called for theoutcome -
Gateway.getStorage().put()called for theattachment -
Gateway.getStorage().put()called for theviewpoint -
Gateway.getStorage().put()called for thelastviewpoint Activity.updateItemProperties()runNextpushJobsToAgents
- store the new workflow if state changed
- handle
Erase -
TransactionManager.commit()- called for the Workflowlockerobject: commits all the previousput()changes- for each "pending transaction"
-
ClusterStorageManager.put()- call
put()on all ClusterStorages -
JooqClusterStorage.put()- calls
JooqHandler.put()on theJooqHandlercorresponding to theClusterType - calls
DomainHandler.put()on all registered domain handlers to update domain specific tables - this sees ALL the changes done with the samelockerobject (i.e. in the same transaction) because of the get() implementation
- calls
- call
For example, if a DomainHandler executes a script (for example aggregate script) which reads a viewpoint (details schema):
Script.evaluate()
- get the ItemProxy
- set the
lockeras atransactionKeyon theItemProxy execute()- then in the script, for example:
ItemProxy.getViewpoint()-
locker == null ?transactionKey: locker -
ItemProxy.getObject()-
Gateway.getStorage().get()=
TransactionManager.get()- HISTORY and JOB
ClusterTypes are handled in a special way -
if this
lockerhas been modifying thisitemPath, read the object from the cache -
else read the object from the
ClusterStorageusingClusterStorageManager.get()
- HISTORY and JOB
-
-