- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2014 07:41 AM
I've seen the stage updated with a red X when the workflow for a Request Item is canceled. I would like to make that X appear under a certain error condition in my workflow. Does anyone know how I can accomplish that?
Below is a screenshot of what I am talking about.
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2014 11:48 AM
Ok, I figured out a really easy way to do it.
I have the conditions on a catalog task for 3 closed states (Closed Complete, Closed Incomplete, and Closed Skipped). The catalog task activity is set to the stage I want to show the rejected icon on if it fails. On the Incomplete and Skipped states I have it transition to a Run Script activity. The following is the code in the Run Script. It marks the previous activity as cancelled, which causes the red x to appear.
var gr = new GlideRecord('wf_history'); if( gr.get( activity.previous_activity ) ) { gr.state = 'cancelled'; gr.result = 'cancelled'; gr.update(); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2020 01:19 PM
this code is not helping me.
The activity is getting failed but the stage still shows completed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2014 09:15 AM
Hi Jason,
You can follow below steps to achieve,
1) I would recommend to add one attribute value in the state field of Requested item saying 'Error in Workflow' or have a new field on task table.
2) Set the value of the state value = Error in workflow if there is any error on the worklow, by writing business rule on Workflow context table when state changes to Error in Workflow context record.
3) Have one more condtion in the script include 'WorkflowIconsStages' for state = Error in workfllow.
Please mark answer as correct if it was really helpful!!
Regards,
Solutioner
Enhance Knowledge NOW@ www.solutioningnow.com
http://www.solutioningnow.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2014 11:42 AM
Thanks for the suggestion, but I got it working without having to do much customization. I'll be posting my solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2014 11:48 AM
Hi Jason,
Would look for the easiest solution that you implemented without customization .
Please mark answer as Helpful/correct if it was really helpful!!
Regards,
Solutioner
Enhance Knowledge NOW@ www.solutioningnow.com
http://www.solutioningnow.com/