Hi there,
Bonita Studio 6.3.2, Java 1.7.0.67, Windows 8.1
Still getting the handle on apiaccessor and other bonita classes etc.
So has anyone got a working sample piece of code for ProcessRuntimeAPI, I want to use SendSignal for a varyoing number of processes.
Many thanks and best regards
Seán
OK - after about 6 hours work (I told you I’m not good at Java) I’ve done it!!!
Here is the code I used with tracing, hope other find it useful,
many thanks and best regards
import org.bonitasoft.engine.api.ProcessRuntimeAPI;
import java.util.logging.Logger;
String thisTrace = "SignalNextProcess: "
Logger logger= Logger.getLogger(“org.bonitasoft”);
logger.severe(thisTrace+“Start Trace”)
ProcessRuntimeAPI processRuntimeAPI = apiAccessor.getProcessAPI();
try{
List signalNextProcess = new ArrayList();
signalNextProcess.add("ABCDE01");
logger.severe(thisTrace+"after add 1")
signalNextProcess.add("ABCDE02");
logger.severe(thisTrace+"after add 2")
for(String nextProcess : signalNextProcess) {
logger.severe(thisTrace+"in for - before sendsignal "+nextProcess.toString())
try{
processRuntimeAPI.sendSignal(nextProcess);
}
catch(e1){
logger.severe(thisTrace+"Error e1: "+e1.message)
}
logger.severe(thisTrace+"in for - after sendsignal "+nextProcess.toString())
}
}
catch(e){
logger.severe(thisTrace+"Error e: "+e.message)
}
logger.severe(thisTrace+“End Trace”)