0 Replies Latest reply on Jul 12, 2013 6:58 AM by zeca9

    JBPM 5.4 - send signal event to reusable subprocess

    zeca9

      Hi,

       

       

      I've a main process with a reusable subprocess:

      Teste.png

      The reusable subprocess calls a process that has a catch signal event.

      TesteSub.png

      When I launch the Main, I save the process instance id (idMain) in my own DB. But I don´t know anything about the id of the subprocess. That's the problem.

       

       

      Because I'm using the same session to start all the main process, when I want to signal the event whitin the subprocess for one single instance, i can't just do:

      ksession.signalEvent(event, params);

      because that will trigger all the instances and not just one.

       

      I tried to pass the id of the main (parent process) using the command:

      ksession.signalEvent(event, params, idMain);

      but nothings happens.

       

      I also found that this works

      ksession.signalEvent(event, params, idSubprocess);

      but like I said, I don't have the idSubprocess.

       

       

      Another way i tried was trying to transform the signalRef attribute unique using a variable (id_main) in the invocation of the subprocess, that will be used in the parameter signalRef=event.#{id_main}. Didn't work beacuse the value wasn't replaced.

       

       

      Can anyone point me to the right direction?

       

       

      Is any way to get the idSubProcess knowing only the IdMain?

       

       

      Or is a way to use a script task before the signal event just to update the signalEvent parameter?

       

       

      Thanks