Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-13829

I can define an asynchronous continuation directly after a called process completes

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Unresolved
    • L3 - Default
    • None
    • None
    • engine
    • None

    Description

      User Story (Required on creation):

      Setup:

      • Multiple applications, each embedding a process engine
      • Different processes and Java delegates per applications
      • Shared database

      I want to use call activities that call BPMN processes from one application domain to another. Currently, I cannot define an asynchronous continuation boundary exactly between the execution boundary of the two processes when the called process finishes (see Hints section for details).

      Functional Requirements (Required before implementation):

      • It is possible to define an asynchronous continuation so that on call activity completion, no delegation code of the calling process is executed by the called process engine (see hints)

      Technical Requirements (Required before implementation):

      Limitations of Scope (Optional):

      Hints (Optional):

      When a called process finishes and returns to the calling process, the following steps happen:

      1. Execution of end listeners of the called process
      2. Completion of the called process instance (e.g. history)
      3. Control flow returns into the calling process instance
      4. Execution of the delegate variable mapping
      5. Execution of end execution listeners of the call activity
      6. Remaining execution of the called process until transaction boundaries are reached

      asyncAfter on the call activity creates an asynchronous continuation after step 5.

      It should be possible to define an asynchronous continuation between either step 2 and 3, or 3 and 4.

      Original description

      Acceptance Criteria (Required on creation):

      In this project there are three process engine working in a deployment-aware mode:

      1. core-workflow
      2. core-processes
      3. domain-hello-world

      There is starter_wrapper_process.bpmn in core-worklow engine. This process starts WrapperProcess.bpmn defined in core-processes. Finally, WrapperProcess.bpmn starts DomainProcess.bpmn from domain-hello-world engine.

      In WrapperProcess.bpmn, the call activity "Start domain process" has an end listener org.example.DomainProcessStartFinishTaskListener. Both WrapperProcess.bpmn and DomainProcessStartFinishTaskListener are located inside core-processes engine.

      Because DomainProcessStartFinishTaskListener is defined in core-processes engine and referenced only in WrapperProcess.bpmn, I want this listener to be executed inside core-processes engine.

      Instead, it is being executed inside the domain-hello-world engine.

      Here are the steps to reproduce:

      1. Start the process "Starter Process" via the tasklist. You should see the output "DomainProcessStartFinishTaskListener.notify" in the console of core-processes – that's the start listener working.
      2. Go to the tasklist and complete the human task.

      Expected behavior: Another "DomainProcessStartFinishTaskListener.notify" in the core-processes console.

      Actual behavior:

      Inside domain-hello-world engine, an incident is created:

      ENGINE-09008 Exception while instantiating class 'org.example.DomainProcessStartFinishTaskListener': ENGINE-09017 Cannot load class 'org.example.DomainProcessStartFinishTaskListener': org.example.DomainProcessStartFinishTaskListener

      {{}}

      Full stack trace is available here:

      https://gist.github.com/dptij/144bc619c3c1c2262a1f1d7605384666

      At the bottom of it you can see a ClassNotFoundException:
       
      {{Caused by: org.camunda.bpm.engine.ClassLoadingException: ENGINE-09017 Cannot load class 'org.example.DomainProcessStartFinishTaskListener': org.example.DomainProcessStartFinishTaskListener
      at org.camunda.bpm.engine.impl.util.EngineUtilLogger.classLoadingException(EngineUtilLogger.java:146)
      at org.camunda.bpm.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:111)
      at org.camunda.bpm.engine.impl.util.ClassDelegateUtil.instantiateDelegate(ClassDelegateUtil.java:46)
      ... 187 more
      Caused by: java.lang.ClassNotFoundException: org.example.DomainProcessStartFinishTaskListener}}

      {{}}

      The incorrect behavior is that Camunda tries to execute DomainProcessStartFinishTaskListener in domain-hello-world engine (and not core-processes engine).{{ }}

      Hints (Optional):

      1. Setting "async-before" and "async-after" to true in all activities did not help.

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              Unassigned Unassigned
              camunda_support_jit JIT Support Camunda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Salesforce