3 Replies Latest reply on May 8, 2015 8:34 AM by jayzay212

    jBPM 6.2 - dynamic task providing for whole groups

    jayzay212

      Hey everyone,

       

      i'm here to ask for some help, because i have a problem with my process definition and implementation i am currently working on.

      The scenario is as follows:

      -the process starts with a view process variables containing some information and a "project"-object (the project definition shall represent a project approval from the creation of the project to it's confirmation from several instances)

      -the second task is available for a specific group, which's size changes from processinstance to processinstance (important!)

      -this task has to be approven by everyone in this group (not only by one)

       

      Environment:

      -jBPM 6.2 final

      -OSGi

      -hibernate and bitronixTM

       

      I read the docu, searched in this forum and in web, but i didnt find any solution, which would help me to provide a task/many tasks of the same type parallel to everyone in this group and wait for everyone to approve this. This is the only article i found regarding to this topic Adding task nodes dynamically at runtime | Planet JBoss Developer . Is this the only possible way or are there nicer ways to this?

       

      Thanks for your help.

       

      Regards,

      Sebastian

        • 1. Re: jBPM 6.2 - dynamic task providing for whole groups
          jayzay212

          After some trying and "experimenting" i use multi instances in my process definition now, but everytime i try to run the application it throws exceptions during the resolving of the process definition by jbpm.

           

          Exception:

          java.lang.reflect.InvocationTargetException

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:235)

              at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)

              at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)

              at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)

              at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)

              at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)

              at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)

              at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)

              at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)

              at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)

              at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)

          Caused by: java.lang.IllegalArgumentException: Cannot add asset: Process 'Sample Process' [cjt.vacationprocessadvanced]: ForEach node 'MultiTaskApproval' [10] has no collection expression,

              at org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment.addAsset(SimpleRuntimeEnvironment.java:116)

              at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:341)

              at de.cjt.estuss.core.jbpm.impl.ProcessManager.initiateNewRuntimeManagerWithNewProcess(ProcessManager.java:167)

              at de.cjt.estuss.core.jbpm.impl.ProcessManager.activate(ProcessManager.java:157)

              ... 15 more

          Root exception:

          java.lang.IllegalArgumentException: Cannot add asset: Process 'Sample Process' [cjt.vacationprocessadvanced]: ForEach node 'MultiTaskApproval' [10] has no collection expression,

              at org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment.addAsset(SimpleRuntimeEnvironment.java:116)

              at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:341)

              at de.cjt.estuss.core.jbpm.impl.ProcessManager.initiateNewRuntimeManagerWithNewProcess(ProcessManager.java:167)

              at de.cjt.estuss.core.jbpm.impl.ProcessManager.activate(ProcessManager.java:157)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:235)

              at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)

              at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)

              at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)

              at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)

              at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)

              at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)

              at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)

              at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)

              at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)

              at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)

           

          !ENTRY org.eclipse.equinox.ds 4 0 2015-05-06 11:24:03.481

          !MESSAGE [SCR] Exception while activating instance de.cjt.estuss.core.jbpm.impl.ProcessManager@767898c7 of component de.cjt.estuss.core.jbpm.impl 

          !STACK 0

          java.lang.reflect.InvocationTargetException

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:235)

              at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)

              at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)

              at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)

              at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)

              at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)

              at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)

              at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)

              at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)

              at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)

              at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)

          Caused by: java.lang.IllegalArgumentException: Cannot add asset: Process 'Sample Process' [cjt.vacationprocessadvanced]: ForEach node 'MultiTaskApproval' [10] has no collection expression,

              at org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment.addAsset(SimpleRuntimeEnvironment.java:116)

              at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:341)

              at de.cjt.estuss.core.jbpm.impl.ProcessManager.initiateNewRuntimeManagerWithNewProcess(ProcessManager.java:167)

              at de.cjt.estuss.core.jbpm.impl.ProcessManager.activate(ProcessManager.java:157)

              ... 15 more

          Root exception:

          java.lang.IllegalArgumentException: Cannot add asset: Process 'Sample Process' [cjt.vacationprocessadvanced]: ForEach node 'MultiTaskApproval' [10] has no collection expression,

              at org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment.addAsset(SimpleRuntimeEnvironment.java:116)

              at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:341)

              at de.cjt.estuss.core.jbpm.impl.ProcessManager.initiateNewRuntimeManagerWithNewProcess(ProcessManager.java:167)

              at de.cjt.estuss.core.jbpm.impl.ProcessManager.activate(ProcessManager.java:157)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:235)

              at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)

              at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)

              at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)

              at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)

              at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)

              at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)

              at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)

              at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)

              at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)

              at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)

           

          My idea was to provide a collection of actor ids for the multi instance. This multi instance should use the collection as input data collection and the input instance parameter is named actor. Then the human task in this multi instance sub process should use the value of actor as the ActorId for the task. Actually i don't now how to set the "collection expression", which is required.

           

           

          Regards,

          Sebastian

          • 2. Re: jBPM 6.2 - dynamic task providing for whole groups
            jayzay212

            Well, i fixed the problem, which caused the exception of "missing collection expression". I used a newer version of the BPMN 2.0 modeler than 1.0.0 and there were some input fields missing like "loop characteristics" and a few more. After downgrading to 1.0.0 i was able to set these field, but i dont how to set the "Input Instance Parameter" as ActorId, which will be used to distribute available tasks.

            editusertask.png

            Naming this parameter "ActorId" didnt solve the problem and even setting this in I/O Parameters as ActorId didnt work either, because of the missing parameter in "Data Item" selection.

             

            inputoutputparameters.png

             

            Thanks for helping.

             

            Regards,

            Sebastian

            • 3. Re: jBPM 6.2 - dynamic task providing for whole groups
              jayzay212

              Actually i found out that the missing availability of setting the "Input Instance Parameter" as Data Item is just a bug of the BPMN 2.0 Modeler. After manually editing the bpmn-file with a texteditor and setting the "actor (string)" as inputreference for "ActorId", the process runs as expected.

               

              Question is now marked as answered.

               

              Regards,

              Sebastian