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

Distinguish new process instance from executions going from other executions from start node #4890

Open
1 task
venetrius opened this issue Jan 13, 2025 · 2 comments
Assignees
Labels
type:bug Issues that describe a user-facing bug in the project.

Comments

@venetrius
Copy link
Member

venetrius commented Jan 13, 2025

Environment (Required on creation)

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)

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.

Steps to reproduce (Required on creation)

Observed Behavior (Required on creation)

Expected behavior (Required on creation)

Root Cause (Required on prioritization)

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.

Solution Ideas

Hints

Links

Breakdown

Pull Requests

Preview Give feedback
  1. dbenesj

Dev2QA handover

  • Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment
@venetrius venetrius added the type:feature Issues that add a new user feature to the project. label Jan 13, 2025
@venetrius venetrius self-assigned this Jan 13, 2025
@venetrius venetrius added type:bug Issues that describe a user-facing bug in the project. and removed type:feature Issues that add a new user feature to the project. labels Jan 13, 2025
@dbenesj
Copy link

dbenesj commented Feb 7, 2025

Described behavior can be replicated by attached plugin: camunda-new-process-instance-poc.zip
Deploy example process included in previous zip file (as it can't be attached on it's own).
Copy resulting jar file to the lib folder, register the plugin in bpm-platform.xml with

    <plugins>
      <plugin>
        <class>org.example.camunda.plugin.CustomAuthorizationPlugin</class>
      </plugin>
    </plugins>

Restart Tomcat, create new process instance from provided process and watch the log for how many times called newProcessInstance for ID ... is being logger. It will be there 4 times. Once for actual new process instance + 3 more for each path from the

@venetrius
Copy link
Member Author

Hey @dbenesj ,
Thanks you for providing the plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Issues that describe a user-facing bug in the project.
Projects
None yet
Development

No branches or pull requests

2 participants