Event sending
halidm opened this issue · comments
halidm commented
We are trying to implement this package with event sending for BPMN2.0 and xml loading.
What we do is that we add events to tasks
in bpe_xml as follows:
reduce([{'intermediateCatchEvent',_Body,Attrs}|T],#process{events=Events,tasks=Tasks} = Process) ->
Id = proplists:get_value(id,Attrs),
Name = unicode:characters_to_binary(proplists:get_value(name,Attrs,[])),
reduce(T,Process#process{tasks=[#task{id=Id,name=Name}|Tasks], `events=[#messageEvent{id=Id,name=Name}|Events]});`
- we do that because otherwise edges and flows from and to the event are not found
and then with correct event handler in our module we are able to process the event but the following problems arise:
- Events can be sent at any step and then they return complete for the next step after the event (although we didnt reach there yet)
- That causes the process to repeat some steps after certain gateways twice
- We still have no clue on how to link Timer events to tasks for simple timeout
Appreciating any help as we believe this package has really good potential for pools of concurrent processes running some internal workflow.
Максим Сохацький commented
You have chosen the right strategy:
- First you need to add the parsing to
messageEvent
. - Currently
event
processing lacks one feature, and we even have draft pull request for it: 21d8d6c, this PR illustrates the nessesity ofbpe:add_sched
to keep process trace and process scheduler consistent. - As for timers the syntax is simple. You need to specify
boundaryEvent
and put inid
the step name or asterisk*
for all steps.
#boundaryEvent{id='*', timeout=#timeout{spec={0, {10, 0, 10}}}}
this will emits process stop on timeout after 10 hrs 10 sec of no action.
Максим Сохацький commented
We updated event BPMN 2.0 processing in master.