I agree about debugging…
However: this is a common issue with all services that have two environments for development and execution. The studio is one environment and the Tomcat is another, and they simply don’t meet like in JAVA EE, which is great for debugging code etc…Why doesn’t Bonita use Eclipse JAVA EE with embedded Tomcat which can be debugged from within the environment? I wonder if this is a licensing issue? I love walking through code and debugging via logs is SO OLD SCHOOL…takes me back.
The Editor I must admit seems crippled when compared to normal Eclipse and wish Bonita would fix some of the issues (which I’m sure is because of their implementation of it).
For example: full and complete intellisense for groovy, java and javascript. Proper Code Colouring, Code Folding, Code Formatting, a mode for showing HTML possibly, etc. FIND and REPLACE for goodness sake in the expression editor!
Enough ranting, my thoughts anyway…
Below is my version of Yannicks’ submission for logging,
import org.bonitasoft.engine.api.ProcessRuntimeAPI;
import java.util.logging.Logger;
int dI = 0;
boolean debug = true;
ProcessRuntimeAPI processRuntimeAPI = apiAccessor.getProcessAPI();
String processName = processRuntimeAPI.getProcessInstance(processInstanceId).getName();
//set the name of the routine
String thisTrace = " "+processName+ " mySpecificName: "
Logger logger= Logger.getLogger(“org.bonitasoft”);
if(debug){dI++; logger.severe(dI+thisTrace+“Trace Start”);}
//I always use ArrayList to return as I find I generally return more than one result
//this way in the last step of defining the connector I just have
// variable x Takes Value Of result[0]
// variable y Takes Value Of result[1]
//etc.
ArrayList returnList = new ArrayList();
//TODO - START OF Code goes in here
returnList.add(my first result);
returnList.add(my second result);
returnList.add(etc.);
//TODO - END OF Code goes in here
if(debug){dI++; logger.severe(dI+thisTrace+"returnList: "+returnList.toString());}
if(debug){dI++; logger.severe(dI+thisTrace+“Trace End”);}
return returnList;
As stated in the code:
//I always use ArrayList to return as I find I generally return more than one result
//this way in the last step of defining the connector I just have
// variable x Takes Value Of result[0]
// variable y Takes Value Of result[1]
//etc.
for example:
i=0;
while databaseRead.next(){
returnList.add(databaseRead.get(0));
i++;
}
returnList.add(i); // number of records
regards