Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-4483

error on broadcasting signals

    Details

    • Steps to Reproduce:
      Hide

      -Using eclipse Bpmn2 diagram editor (inluded in jboss developer studio jbpm plugin) create a simple process that contains some messages and signals on it. In my case it was a start node followed by a parallel gateway with 3 outgoing events (one message and to signals, both signals with the same type) and each event was followed but different Human tasks so i can check if the events were triggered.
      -Create a RuntimeEnvironmentBuilder builder:
      RuntimeEnvironmentBuilder builder= RuntimeEnvironmentBuilder.Factory.get().newDefaultBuilder()
      .entityManagerFactory(emf);
      builder.persistence(true);
      builder.addEnvironmentEntry(EnvironmentName.TRANSACTION_MANAGER,
      tm);

      -Register the process:
      builder.addAsset(org.kie.internal.io.ResourceFactory
      .newClassPathResource(processDefName), ResourceType.BPMN2);

      -Create a signleton RuntimeManager:
      RuntimeEnvironment environment = builder.get();
      RuntimeManager manager = RuntimeManagerFactory.Factory.get()
      .newSingletonRuntimeManager(environment);

      -Get session:
      KieSession session=manager.getRuntimeEngine(EmptyContext.get())
      .getKieSession();
      -Start process:
      Long id=session.startProcess(processId, params);
      -Send a message then a signal
      session.signalEvent(messageName, message,id);
      session.signalEvent(signalName, signal);
      After this, if i check the created tasks there is only 1 created and should be 3.
      -In contrast, if i change the second line from session.signalEvent(signalName, signal);
      to
      session.signalEvent(signalName, signal,id);
      now there are 3 human task created.
      -Same thing happens if i rebuild the manager before the signal:
      manager.close();
      manager= RuntimeManagerFactory.Factory.get()
      .newSingletonRuntimeManager(environment);
      session=manager.getRuntimeEngine(EmptyContext.get())
      .getKieSession();
      session.signalEvent(signalName, signal);
      After this the 3 tasks are created correctly.

      Show
      -Using eclipse Bpmn2 diagram editor (inluded in jboss developer studio jbpm plugin) create a simple process that contains some messages and signals on it. In my case it was a start node followed by a parallel gateway with 3 outgoing events (one message and to signals, both signals with the same type) and each event was followed but different Human tasks so i can check if the events were triggered. -Create a RuntimeEnvironmentBuilder builder: RuntimeEnvironmentBuilder builder= RuntimeEnvironmentBuilder.Factory.get().newDefaultBuilder() .entityManagerFactory(emf); builder.persistence(true); builder.addEnvironmentEntry(EnvironmentName.TRANSACTION_MANAGER, tm); -Register the process: builder.addAsset(org.kie.internal.io.ResourceFactory .newClassPathResource(processDefName), ResourceType.BPMN2); -Create a signleton RuntimeManager: RuntimeEnvironment environment = builder.get(); RuntimeManager manager = RuntimeManagerFactory.Factory.get() .newSingletonRuntimeManager(environment); -Get session: KieSession session=manager.getRuntimeEngine(EmptyContext.get()) .getKieSession(); -Start process: Long id=session.startProcess(processId, params); -Send a message then a signal session.signalEvent(messageName, message,id); session.signalEvent(signalName, signal); After this, if i check the created tasks there is only 1 created and should be 3. -In contrast, if i change the second line from session.signalEvent(signalName, signal); to session.signalEvent(signalName, signal,id); now there are 3 human task created. -Same thing happens if i rebuild the manager before the signal: manager.close(); manager= RuntimeManagerFactory.Factory.get() .newSingletonRuntimeManager(environment); session=manager.getRuntimeEngine(EmptyContext.get()) .getKieSession(); session.signalEvent(signalName, signal); After this the 3 tasks are created correctly.
    • Workaround Description:
      Hide

      If you can get all the process ids, you could send the signal one by one.
      Also, i apparently fix the problem changing the class org.jbpm.bpmn2.xml.IntermediateCatchEventHandler. In contrast with the class org.jbpm.bpmn2.xml.BoundaryEventHandler, the methods handleMessageNode and handleSignalNode dont set the scope of the node to "esternal". I added the line eventNode.setScope("external") just like it was on org.jbpm.bpmn2.xml.BoundaryEventHandle in both metods and the test case described before star working.

      Show
      If you can get all the process ids, you could send the signal one by one. Also, i apparently fix the problem changing the class org.jbpm.bpmn2.xml.IntermediateCatchEventHandler. In contrast with the class org.jbpm.bpmn2.xml.BoundaryEventHandler, the methods handleMessageNode and handleSignalNode dont set the scope of the node to "esternal". I added the line eventNode.setScope("external") just like it was on org.jbpm.bpmn2.xml.BoundaryEventHandle in both metods and the test case described before star working.
    • Estimated Difficulty:
      Low

      Description

      When using a singleton runtime manager strategy for managing process interfaction, in some processes with complex signals interactions, at some point broadcasting a signal (sending it without a process instance id) or message event stop working (anything happens), but sending the same signals or messages directed to the same process instances (sending them with the inclusion of the process instance id) works just fine.
      If i try the same case but i rebuild (close and build another ) runtime manager before broadcasting the signal it works fine.
      This bug dont include the boundry events, wich works just find in this case.
      After debuging the RuntimeManager and related sources i found that the
      problem seam to be that the message and signal EventNode's arenĀ“t marked with the scope "external" as are the signal and message BoundryEventNode's. This apparently cause that the list of broadcasting event listener is not properly populated.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swiderski.maciej Maciej Swiderski
                Reporter:
                diaguirr Diego Aguirre
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: