Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How is the activity conditions value set for catalog task activities?

sherard
Mega Expert

Need assistance with workflow activity catalog tasks. I need the workflow activity catalog task to accept additional conditions. I can add new conditions to the activity, but it is not accepting it and the catalog task activity just sits there. Am I missing something?

So I have a new state value of 'Failed' with db value as 15 as part of my Catalog Task status field. I created a condition in my workflow catalog task activity to look at activity.result == 15. So, when I run my workflow, update the created catalog task state value to 'Failed' (15), I would expect the catalog task activity to accept the new condition. am i doing this wrong?

1 ACCEPTED SOLUTION

Something about this bugs me.   If you set the condition so that the state value is 4 and it works, that means there's a business rule that's touching hte parent workflow again.



Here's something to try.   Build a temporary business rule on sc_task table.   Copy the contents of "SNC - Run parent workflows" business rule.   Make your conditions current.active.changesTo(false).   That rule will essentially tell the parent workflow to check if it needs to proceed when you set an SC_Task to inactive.



Also... that got me thinking.   This is a Catalog Task activity right?   And that new state is a state on the Catalog Task table?


View solution in original post

23 REPLIES 23

Hi Robert,



Yes. and Yes. I created a new state value on sc_task table for state field. The state is 'Failed QC' with a value of 15. I have added a dictionary override attribute for the sc_task table of the close_states and defined my value there to indicate this value as active=false. This all currently works in the sc_task form. I can manually change the state to 'Failed QC' on the sc_task form and the active changes to false when updated.



However, the workflow sees nothing and I am not sure how the workflow activity works to check the activity condition of activity.result == 15 as I update the record.


Ok... Just went to a workflow activity of mine that I know operates with custom conditions.       Not sure if it makes a difference, but you can try peeling those spaces out.


find_real_file.png


Looking at the catalog task under activity definitions, I noticed in the description that it only accepts results listed as:



'You can assign a result value using 'activity.result' from within a script field of the activity. The final 'State' value of the catalog task record determines the result value for the Create Task activity. Possible result values are:


*Closed complete


*Closed incomplete


*Closed skipped


*Deleted


*Cancelled



If I change my custom state value to one of these recognized out of the box values, like we don't use 'Closed incomplete' state value 4 in our processing. but make my custom state value use '4' to fake it out, then it works.           i.e. - instead of my custom state 'Failed QC' has value 15. I changed the value for my custom state to use value 4 as we are not using the Closed incomplete status.



It looks like you have to use the values that represent one of these states above. Or is there a way to customize that select list only?



Is this the right method to use? It doesn't seem like it would be.


The screenshot above is from a Create Task activity on a custom table with completely custom States.  


I took out the spaces as indicated to mimic your syntax of the conditions value. Still no luck.



Would there be a difference is that it is a catalog task and not a create task?