Using Log Output for Debugging of Script Task

I would like to introduce a function of logging of Script Task/Service Task (Add-on) which has been newly added to Version 11.6.

A Script Task is a Step that allows the Workflow engine to perform some kind of automatic processing. It is a function for engineers, which allows describing contents of automatic processing with ECMAScript.

A service task (Add-on) is a modularized version of the automatic processing performed at those Script Tasks. By importing a modularized definition file, you can add a corresponding auto-step item. You can also create your own definition files.

M415 Adding an Auto-Step to be Used for Business Process Definition

 

In order to facilitate debugging of these Script Tasks/Service Task (Add-on), we have added a logging function. Since it is used in the Add-on of “Google Drive Folder Generate”, you can refer to the codes of the script in the definition file.

Add-on: Google Drive Folder Generate

 

For log output method, use engine.log(). The character string specified as the argument of the method is output as it is as a log.

Line breaks are entered for each method, and newlines in the string are kept intact and logged.

engine.log("status:" + status);
engine.log("response:");
engine.log(resText);

 

The output log can be checked in the detail screen of the Process on Administrator mode.
Below is an example of the log output from the “Google Drive Folder Generation” Add-on I mentioned earlier.

 

Until now, I suppose that there was no way other than saving the log in a String type Data Item in order to examine the behavior in the script in detail.

This method has a weak point, that is, a Script Task/Service Task cannot be failed, if it does, the log is not stored in the Data Item.

The logging function has an advantage that the log can be saved in either of success or failure of the Script Task/Service Task. You will not need to disguise the Step which should be naturally recorded as a failure, to a success.

I hope that from now on, you can use the logging function for debugging Script Task/Service Task (Add-on).

 

Recommendations
Prev article - 50. Questetra Tips About Performance after Ver. 11.6 Release
Another article - Hatanaka Akihiro Call Center with Twilio, without Telephone Machine (Receiving Phone calls on the Browser)

Archive

 RSS