Running a script against a Catalog Task from a workflow

Jason_DaSilva
Tera Guru

I have a bit of an interesting problem.  I need to run a script at the end of our hiring process.  Unfortunately for me the people that initially set up those processes where years before me.  I am still trying to track down all the processes, but it appears that there may be 4-6 different workflows for the new hire process (depending on how the new hire is started).

 

That said, I am trying to run a script at the end of that process off of one of the SCTASKs created from the process (usually there are 3; Account creation, Facilities details, Hardware deployment).  I am also trying to track down if they are at least consistent with the description for the Hardware deployment in each of these workflows.  As I try and pull all that info together, I am trying to think of the best way to target a script to that SCTASK.  Before I found out that there were multiple starting points (each with a different flow) I was just going to work it into the flow, but now I am not so sure.

The other (probably poor on efficiency) way I was thinking was a business rule that runs when an SCTASK is closed to check if it meets the criteria of the target SCTASK then run the script that way, but that leaves it separate from the actual process and leaves room for it to fail if changes are made to the hire process (I would add this to the documentation stream if I could find it...)

Any ideas on this would be greatly appreciated.  Thanks.

1 ACCEPTED SOLUTION

LorenzVdV
Giga Guru

I'd run the script with the business rule as you said, and add in the work notes of the task/RITM that triggers it "Automated message: Script to do x finished successfully". This makes it more visible for future developers.

Maybe a better trigger would be the RITM closure, and add in the BR condition the catalog items for which it should run. Then you are not dependent on the 'description for the Hardware deployment in each of these workflows'.

View solution in original post

5 REPLIES 5

Sounds indeed like you've inherited some technical debt. It's a good idea to get rid of it as you move along, but as this is simply tacking on a script at the end of the process I don't think this is the opportunity to do it.