You are viewing limited content. For full access, please sign in.

Question

Question

Throw an error to cause failure

asked on August 16, 2017

I am calling workflows from other workflows.  Within the parent workflow I have the call to the child workflow inside a Try-Catch activity.  I would like to be able to throw errors in the child workflow which will cause the Catch activity of the parent workflow to execute.  Is there a way to do this?

 

if not, what is the recommended approach to resolving this problem?

0 0

Replies

replied on August 16, 2017

Can you give a more specific example?  Like what type of errors are you expecting in the child workflow?

0 0
replied on August 16, 2017

I am not expecting an error to occur by Laserfiche.  In my child workflow I am calling a web service to retrieve customer information, passing the customer number as a parameter.  If the customer number is invalid then the JSON comes back with no customer information.  When this occurs I want to be able to throw my own error in the child workflow so the Catch activity in my parent workflow will execute.

0 0
replied on August 16, 2017

So the child workflow is passing back the JSON string?  Or at least tokens created in the child workflow from the JSON?

Can you make it a decision tree instead of a try catch?  Wait for the child workflow to pass back the JSON.  Have an activity that tries to read the JSON.  Then a decision try to continue if it is not empty and a branch of whatever you want to do if it is empty.

 

ReturnJSON.jpg
ReturnJSON.jpg (42.43 KB)
0 0
replied on August 16, 2017

If your parent workflow is waiting on the child workflow to complete, the child can pass back output parameters. Then you can check those values in the parent and run the activities you need.

0 0
replied on August 16, 2017

I can do that but I wanted a Try-Catch in the parent workflow anyways in case a Laserfiche failure occurred in the child workflow so I was hoping to be able to utilize the same activities in the Catch activity when a "non-Laserfiche" error occurred.

 

So, I guess what you are telling me is that there is no way to throw my own error?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.