Event Based Gateways
Hi,
Thanks for providing this library, it looks pretty good and interesting, one I am keen to explore more.
A quick question though, does it support event based gateways?
I added a simple bpmn that used a gateway with a timer but couldn't find any where that I could provide a delegate or see the timer executing.
Thanks
So it doesn't really support Event based gateways currently. You could add a delegate for checking if a flow is valid. This is something I will likely be looking into in version 4 which is a bit of an overhaul of some items and I am hoping to add support for DMN as well. However, if there is time delays required, you could use the TimerEvent which would either be a catch or throw intermediate event containing a timerEventDefinition tag within.
Within that tag you can then use either the DateString item (which is similar to the PHP strtotime and supports variables being injected) or you could add one of the 3 scripts that are supported (cSharpScript, Javascript, VBScript) and return a DateTime value. These methods all would recieved the variables of the process at the time.
https://github.com/roger-castaldo/BPMNEngine/blob/master/BPMNEngine/Elements/Processes/Events/Definitions/TimerDefinition/XDateString.cs https://github.com/roger-castaldo/BPMNEngine/blob/master/BPMNEngine/Elements/Processes/Scripts/
If this method is used, then within the process instance you could access the current state and access the Steps property. Any steps with a StepStatus of WaitingStart have been delayed by the timerEventDefinition.
Currently there is no delegate nor is there a way to "see" the timer executing. Technically speaking if you were to export the state to XML or JSON, within that data there would be information indicating that a given Step has been delayed to start at X time. There is a full Timer Scheduler built into the system to handle long delayed steps as well.