Debug a process

1
0
-1

Hi
How can I debug a process?
Is it possible to see the value of the parameters and variables during the debug (execution)?
By clicking on Debug button in cool bar an empty big box appears with title "Configure the debug execution" and nothing is in it. Then by clicking debug the process starts and goes to the end and it is not like debugging.
Thank you

1 answer

1
0
-1
This one is the BEST answer!

The easiest way is by logging, really, it is.

I don't know what the debug tool does, and I've never got it to work either. I rely completely on having a solid platform for logging.

It works well can be refreshed quickly in-between tasks and is easy to follow. There is no method of running real-time step-by-step debugging like a normal program if that is what you are looking for.

I have set code that I modify on in-and-out connectors and anywhere I use code as follows, you have to add your own variables as necessary for writing out etc.

import org.bonitasoft.engine.api.ProcessRuntimeAPI;
import java.util.logging.Logger;

int dI = 0; //a counter for this execution
boolean debug = true;

ProcessRuntimeAPI processRuntimeAPI = apiAccessor.getProcessAPI();
String processName = processRuntimeAPI.getProcessInstance(processInstanceId).getName();

//set the name of the routine
String thisTrace = " "+processName+ " getCompletedOutputDocuments: "

Logger logger= Logger.getLogger("org.bonitasoft");
if(debug){dI++; logger.severe(dI+thisTrace+"Trace Start");}
 //TODO - Code goes in here - START
 
 ArrayList<Object> returnList = new ArrayList<Object>();

 //TODO - Code goes in here - END
if(debug){dI++; logger.severe(dI+thisTrace+"returnList: "+returnList.toString());}
if(debug){dI++; logger.severe(dI+thisTrace+"Trace End");}
return returnList;

When doing a for or other loop I use this in addition:

int fl = 0; //a counter for this for loop execution
for(i=0;i<=5;i++){
if(debug){fl++; logger.severe(dI+"-"+fl+" "+thisTrace+"myText in for loop: "+forLoopData);}
}

Hope this helps

regards
Seán

PS: If this reply answers your question, please mark a resolved.

Notifications