How to dynamically update event-based transition rules?

Say, I have an event-based XOR gateway that listens to an event and transitions to one branch or the other depending on whether the value from the event is between [0,0.5] or between [0.5,1].

I want to be able to dynamically update the value of the split (ie. vary 0.5) for the next instance that gets triggered.

What is best way to model that into Camunda?
Is Event-based XOR even the best way to capture and dynamically decide upon an event?


Perhaps we could break your scenario down into three distinct concepts;

  1. You have an event which conveys some business data - eg something happened and the new value is x.
  2. A business rule which determines whether a or b is performed depending on the value of x.
  3. Process flow logic which based on the outcome of the business rule above, causes the process to flow down either path A or path B

You could model this like this:

Its the Determine Route business rule task where I would put dynamic logic. The output of this task is the route decision, A or B, then your xor gate can switch as appropriate.

Your business rule task could be implemented as script, code or even DMN. If its DMN, you could deploy a new version to effect change. If its code, you could use any appropriate technique to change logic - eg lookup table in DB or other…



1 Like

Thanks @Webcyberrob. The reason I originally had XOR was because, there could be more than one type of triggering event, each with its own guard (in state machine terminology) logic. How would you modify your solution to fit in these cases?


Im not sure what you are wanting to achieve, perhaps you could elaborate a little more?

Here’s a link to a more complex event driven state machine I built a while back. This exmple implements the RAFT concensus algorithm. The model is classless and executable, so it may give you some inspiration of what’s possible…



Thanks @Webcyberrob, that event driven example was a useful hint!

As to what I want to achieve, I want to be able to model state machine transition with dynamic guard conditions.
Here’s an attempt at expressing in BPMN language:

Taking a hint from your diagram in the link you shared, is the following simpler version achievable with the ability to dynamically change the condition?:

Going further, can I represent what I want to achieve in this compact notation?: