Please suggest some effective ways to debug code of script activity in workflow . Also tokens created are scoped for the script can be traced through track tokens activity within workflow or not?
Question
Question
Answer
See the below code for creating tokens (StringToken and NumberToken) and outputting debug messages:
// Create two tokens SetTokenValue("StringToken","This is the value of the StringToken"); SetTokenValue("NumberToken",12345); // Output messages WorkflowApi.TrackInformation("This is an information message that contains the NumberToken: "+GetTokenValue("NumberToken").ToString()); WorkflowApi.TrackWarning("This is a warning message that contains the StringToken: "+GetTokenValue("StringToken").ToString()); WorkflowApi.TrackError("This is an error message that contains both the StringToken and NumberToken: "+GetTokenValue("StringToken").ToString() +" / "+GetTokenValue("NumberToken").ToString());
These messages can be used to debug token/variable values. When you run this script you'll see the following:
Also, any tokens created using this method can be used downstream in the same Workflow:
They are also fully trackable:
Replies
Hi Arjun,
You and @████████have been asking a bunch of questions about the same project but haven't yet said what you're actually trying to accomplish with this workflow and the Script activity it contains. It's been difficult for us to offer advice specific to your situation because we still don't know what you're try to do.
If you can share details about your objective and what this script is doing and why, people might be able to offer you more relevant guidance. Better yet, post the script code (redact/replace variable names etc. if you think that's necessary for confidentiality), and some of the programmers who frequent Answers might take a look.
Hi Carson,
I think you are referring to High CPU usage we are posting
I have started separate thread for the same.
Workflow CPU Load - Laserfiche Answers
If ask is not clear can elaborate on the above thread.
Thanks.