Script on transitions Question

0
Question posted 7/6/09 by Stephane Venne
Details:

Is there a way to easily add a script for every transition? I don't feel like adding it manually to all the transitions in my workflow.




Thanks, any idea appreciated!
Responses (6)
  • Accepted Answer

    Thursday, January 27 2011, 02:28 PM - #Permalink
    0
    Comment posted 7/6/09 by mtcarver

    no but instead you could run script in the notification context. Create a rule that fires on Last State Change Date when changes - and fire your script. You may need to make adjustments to your script.
    Another idea if you could figure out the database schemas for it is a manual update to the sql tables to add your script to every transition, not recommended but possible.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, January 27 2011, 02:28 PM - #Permalink
    0
    Comment posted 7/6/09 by Stephane Venne

    I was thinking about the notification context, but it felt like hacking ;-) But it worth the try.
    Thanks
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, January 27 2011, 02:28 PM - #Permalink
    0
    Comment posted 7/6/09 by Lynn Mattie

    You could use the pre-state instead of post-transition context. It works almost the same and there are usually less states in the workflow then there are transitions. The difference is the script will only fire if the transition is changing the state. Of course, you could also add the script to any of your "Any" to "Same" transitions as well, if you need the script to run on those.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, January 27 2011, 02:28 PM - #Permalink
    0
    Comment posted 7/7/09 by Stephane Venne

    Since it's to enable/disable edits in some field i think your approach make sense.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, January 27 2011, 02:28 PM - #Permalink
    0
    Comment posted 7/6/09 by Jeff Malin

    With the usual caveat about making back-end DB modifications (always backup, test in a non-production environment, not supported if it goes awry, etc...), couldn't you just use SQL to select each of the transitions in your workflow from the TS_TRANSITIONS table, then change their TS_PREMACROID or TS_POSTMACROID to point to the desired script's row in the TS_MACROS table? I believe it would also take a reload of the DLL to take effect (IISRESET).
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, January 27 2011, 02:28 PM - #Permalink
    0
    Comment posted 7/7/09 by Stephane Venne

    It's a bit scary, but we do have a dev environement on a separate server, maybe i'll try. Thanks for enumarating the fields that i need to edit.
    The reply is currently minimized Show
Your Reply

Recent Tweets