DRD Literal Expression - Engine Services API Access

Hi,

In a DRD, Id like to try to use a literal expression to start a process instance. Thus Id like to use code such as;

execution.getEngineServices().getRuntimeServices().startProcessInstanceByKey(…)

Hence is there an equivalent to ‘execution’ in a DRD expression? (I want to use an existing process as a function…)

regards

Rob

Hi Rob,

you can invoke a custom bean (e.g. spring/cdi bean) to start the process and extract the result. The context variable ‘execution’ is not available.

Your use case sounds a bit odd for me. What does the process do?

Best regards,
Philipp

Hi Philipp,

The process effectively realises a function, ie imagine a process with two tasks classify a set of items, then apply a decision to determine if the customer qualifies for a discount. Hence say this already exists.

Next the business say, we want a decision such that if the customer qualifies for discount and they are a VIP, then do y…

Hence I could realise this as a DRD with two literal expressions, one of which calls the existing process as a function.
Note the process cannot have async continuations and it must be started with return variables to behave like a function…’

A little unusual possibly, thus Im exploring if its feasible etc…

regards

Rob

Hi Rob,

in your use case, I recommend to model it as a decision flow.

Otherwise, you can use a bean in the decision literal expression which invokes the process.

Does this help you?

Best regards,
Philipp

Thanks phillipp,
I absolutely agree I could do it this way. However,given its a decision, I wanted to see if I could maintain the decision paradigm by using it as an expression in a DRD…

Regards
Rob