Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine): Distinguish new process instance from executions going from other executions from start node #4881

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dbenesj
Copy link

@dbenesj dbenesj commented Jan 6, 2025

Whet someone wants to implement it's own DefaultAuthorizationProvider.newProcessInstance() when new process instance is created, this method is called multiple times. Once for the process instance itself, but also for all executions (links) from the start event element defined in the process definition.
Reason is that when execution is being created (process instance is also an execution) it is first sent to be stored into the storage and only later process instance specific fields are being assigned to the java object. One of the reason is that ID of the execution is generating during the storing of the execution.
So to be able to distinguish the process instance itself from other executions while creating the process instance following steps has been performed:

  1. Defined the placeholder to be used as a temporary process instance ID until actual identifier will be generated
  2. Create new method that sets this placeholder to the Java object
  3. Call the new method when creating new process instance instead of creating generic execution
    This way it ensures it is used only for the

Potentionally it is a question whether this new placeholder should be used also in ExecutionManager.createDefaultAuthorizations() to filter out other executions so that DefaultAuthorizationProvider.newProcessInstance() will be called really only for the process instance itself and not other executions...

…rom the start node

Otherwise when overriding DefaultAuthorizationProvider.newProcessInstance() you would not be able to distinguish process instance itself from other executions.
That is because when creating Execution, processInstanceId is being assigned later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants