synrc / bpe

💠 BPE: BPMN Process Engine ISO 19510

Home Page:https://bpe.n2o.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Event sending

halidm opened this issue · comments

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:

  1. 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)
  2. That causes the process to repeat some steps after certain gateways twice
  3. 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.

You have chosen the right strategy:

  1. First you need to add the parsing to messageEvent.
  2. Currently event processing lacks one feature, and we even have draft pull request for it: 21d8d6c, this PR illustrates the nessesity of bpe:add_sched to keep process trace and process scheduler consistent.
  3. As for timers the syntax is simple. You need to specify boundaryEvent and put in id 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.

We updated event BPMN 2.0 processing in master.