I would like to introduce a function for logging Script Tasks/Service Tasks (Add-on) which has recently been 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 you to describe the contents of automatic processing with ECMAScript.
A Service Task (Add-on) is a modularized version of the automatic processing performed in 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.
In order to facilitate debugging of these Script Tasks/Service Tasks (Add-on), we have added a logging function. Since it is used in the Google Drive: Create Folder add-on, you can refer to the codes of the script in the definition file.
For the log output method, use
engine.log(). The character string specified as the argument of the method is output 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 in Administrator mode.
Below is an example of the log output from the Google Drive: Create Folder add-on I mentioned earlier.
Until now, there was no other way to examine the behaviour of a script in detail than by saving the log in a String-type Data Item.
The weakness of this method was that it was not possible to cause a Script Task/Service Task to fail, and if it did, the log would not be stored in the Data Item.
The logging function has the advantage of keeping a log of both the successes and failures of the Script Task/Service Task. You will not need to disguise a Step which should be naturally recorded as a failure, as a success.
I hope that from now on you can use the logging function for debugging Script Tasks and Service Tasks (Add-on).