3 Replies Latest reply on Dec 10, 2014 8:01 AM by swiderski.maciej

    Singal event in Multi-instance Subprocess

    zmor

      Hi,

      I have MultiInstance subprocess with boundary signal event on one task:

      TestProcess.png

      My question is - how to send signal event to particular subprocess?

      I would like to signal event that is attached to particular task. I need this event to cancel this task (checked cancel activity)

      Example:

      I have two subprocesses invoice_sub - these subprocesses are initialized by variable invoiceList (java.util.List) which has two elements (invoice_1, invoice_2).

      So there are two active tasks check.invoice.

      Now i need to send signal event just to one task, to close one subprocess, so there will be just one subprocess left.

      I am using eclipse modeler, properties for this signal event are as follows:

      singal_properties.png

      When I invoke kieSession.signalEvent("cancelinvoice", "invoice_1", processInstanceId) signal is sent, but it closes all tasks, from all created subprocesses.

      How can I send signal just to close one task from particular subprocess?

        • 1. Re: Singal event in Multi-instance Subprocess
          swiderski.maciej

          I am afraid it won't be possible with regular signals as they are constants - no way to specify different values for different signals for same definition but enclosed within multi instance activity/subprocess.

           

          I would attempt to do it via domain specific activity that register itself as event listener and then each instance of that activity would be listening on slightly different signal name. Then remodel the process to use parallel gateway to split the logic and when signal arrives that should move the subprocess flow to terminate end event in the subprocess to cancel user task when exiting from subprocess.

           

          HTH

          • 2. Re: Singal event in Multi-instance Subprocess
            zmor

            I wish this is impossible.

            Anyway, thanks for that information, I'll try diffrent solution.

             

            KM

            • 3. Re: Singal event in Multi-instance Subprocess
              swiderski.maciej

              actually I believe it is possible just requires some development but should be doable.

               

              HTH