BONITA 7: Start a process instance from script

1
0
-1

Hello, In Bonita 7 I'm trying to create a new instance of a process from a script but I can not. My process (process1) has a service task in which I add a script to launch a new process called "process2" version "1.0". Examples of Bonita's documentation not have all the code and sometimes lack me how to get the current session, other times to get the current users ... please does anyone have a complete example or can help me?

Thank you. Regards,

Comments

Submitted by Sean McP on Wed, 08/05/2015 - 08:37

what code do you have so I can have a look?

however a hint to start:

you need to search the list of processes and process versions to get the processID, note: in community search doesn't work as you might hope search(processName, processVersion) doesn't return only one processID. You need to get the FULL list of processes and then loop through them...

get list of processes in listOfProcesses

  1. for (processes in listOfProcesses){
  2. if (processes.getName() === "process2" AND processes.getVersion() === "2.0"){
  3. processID = processes.getId();
  4. startprocess(processID);
  5. }
  6. }

hope this helps,

regards Seán

Submitted by vilcholo on Wed, 08/05/2015 - 09:31

Hello Sean, I'm trying with Bonita's documentation, but not being the complete code not get it to work. I tried it with code from the community ... but no way. Thank you very much for your help.

Submitted by Sean McP on Wed, 08/05/2015 - 10:26
No answers yet.
Notifications