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

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.

  1. import org.bonitasoft.engine.api.ProcessRuntimeAPI;
  2. import java.util.logging.Logger;
  3.  
  4. int dI = 0; //a counter for this execution
  5. boolean debug = true;
  6.  
  7. ProcessRuntimeAPI processRuntimeAPI = apiAccessor.getProcessAPI();
  8. String processName = processRuntimeAPI.getProcessInstance(processInstanceId).getName();
  9.  
  10. //set the name of the routine
  11. String thisTrace = " "+processName+ " getCompletedOutputDocuments: "
  12.  
  13. Logger logger= Logger.getLogger("org.bonitasoft");
  14. if(debug){dI++; logger.severe(dI+thisTrace+"Trace Start");}
  15. //TODO - Code goes in here - START
  16.  
  17. ArrayList<Object> returnList = new ArrayList<Object>();
  18.  
  19. //TODO - Code goes in here - END
  20. if(debug){dI++; logger.severe(dI+thisTrace+"returnList: "+returnList.toString());}
  21. if(debug){dI++; logger.severe(dI+thisTrace+"Trace End");}
  22. return returnList;

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

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

Hope this helps

regards
Seán

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

Notifications