apache / incubator-kie-kogito-runtimes

Kogito Runtimes - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
Apache License 2.0
540 stars 209 forks source link

Lack of support for Activity/Node Enter/Exit listeners on all Activities/Node types #1927

Open StephenOTT opened 2 years ago

StephenOTT commented 2 years ago

Description

As per the docs, the OnEntry and OnExit action/listeners are not supported in Kogito. Is there some background on this? Side-effect actions are very common in making a BPMN appear ~reasonably clean for the reader, and using the listeners as a way to hide minor implementation details.

Example: On an end event, a listener can often be applied to do some final data changes/evals. If the listener is not possible, then it would need to be added into a script task or something similar. This is not "horrible" or impossible, but it does make a BPMN become very messy with lower level implementation details and obfuscates the BUSINESS process that the BPMN was designed to articulate.

If Start/End / Entry/Exist listeners are not desired, what is the alternative?

Thanks!

Implementation ideas

No response

fjtirado commented 2 years ago

I think that although not documented, they are implemented. @hmanwani-rh lets open a JIRA to document them

StephenOTT commented 2 years ago

The docs say on each of the field descriptions in the field props that "kogito does not support this"

hmanwani-rh commented 2 years ago

I think that although not documented, they are implemented. @hmanwani-rh lets open a JIRA to document them

@fjtirado Entry and Exit action is already documented in our docs. Just need to ensure, if is it supported or not as @StephenOTT mentioned.

fjtirado commented 2 years ago

Ok, I should have checked the document first, sorry for the confussion, they are not supported then.
@StephenOTT You can still use onBefore and ofAfter ProcessEventListener method https://github.com/kiegroup/droolsjbpm-knowledge/blob/7.x/kie-api/src/main/java/org/kie/api/event/process/ProcessEventListener.java#L57 and https://github.com/kiegroup/droolsjbpm-knowledge/blob/7.x/kie-api/src/main/java/org/kie/api/event/process/ProcessEventListener.java#L64

StephenOTT commented 2 years ago

Okay. Is the goal to support them? Or is it not in the design arch of kogito?

jgrabowski commented 2 years ago

I'm totally with @StephenOTT. I've already done some real-life project on Kogito and lack of support for onEntry and onExit actions resulted in large number of Script Task activities. They're purely "tech driven" and not "business driven" and sometimes it makes the model too complicated to present to business people.