Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
DCR submit
summergs
Does anyone know if it is possible to have a database field end a workflow? (or how to do it)
Find more posts tagged with
Comments
Adam Stoller
Can you expand a bit on what you're trying to do here? What do you mean by "have a database field end a workflow"?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
summergs
Sure. I need a workflow to assign multiple contribs/approvers (assignment workflow) and send out casual contributor emails with links to the multiple DCR's. Normally, it seems that a workflow would end with the successful submission of a DCR, however, I need to either:
1. keep the life of the workflow going until a flag is set in a database table at which time the workflow would end.
-OR-
2. allow the assignment workflow to end after sending out emails BUT somehow retain the contribs/approvers so that each time a DCR is saved, it would be routed properly.
Background: My DCR's will be often updated over the course of several years.
Any Ideas?
Adam Stoller
Your workflow can have any kind of tasks in it you want (of the kind supported) - so you could certainly have an externaltask at the end of your workflow that pushes data into a DB and/or polls a DB to look for a record it expects to see.
If you attach EAs to the DCRs that include the information about the contributors / reviewers, you could have your workflows use that information when the same DCR is later edited and re-submitted.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Dwayne
It sounds like a pretty strange setup, but I'll throw out some ideas on the assumption that you know what you need.
If I understand correctly, you want this workflow to keep looping through a cycle of Edit >> Approve >> Submit >> (whatever) >> Edit ... until such time as an external event (a database update, in this case).
You could have an external task inserted in the workflow at whatever point(s) would be appropriate to check for this flag, and exit out if set.
If you need to have this checking be more "async" to the process, so that even if the job is sitting in somebody's To Do list the database update will be "caught," then you could have a parallel path through the workflow with a dummy task that either sleeps forever, and a database trigger "wakes it up" and causes a transition to the end task, or you have that dummy task transition every X amount of time (once per hour, once per day, whatever) and have it then run an external task which checks the flag, and either restarts the dummy task or ends the workflow.
--
Current project: TS 5.5.2/6.1 W2K
summergs
Can you tell me how I would use a flag in a database to end the workflow? I can go out to a database via perl and grab the flag, but I cant figure out how to end the workflow if the flag is set.
Dwayne
Assuming that you're reading the database flag from an external task handler:
Have the externaltask have two sucessorsets: one for when the flag is set, and one for when it is
not
set. The first parameter to the
CallBack
method of your
TeamSite::WFtask
specifies which successorset to use.
Have the one that's invoked when the flag
is
set transition, either directly or indirectly, to the
endtask
. The
endtask
becoming active is the proper way to terminate a workflow.
--
Current project: TS 5.5.2/6.1 W2K
summergs
Ahhhh...Thanks!