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)
dynamic number of approvers
Enthu
Hi all,
I need a suggestion regarding my workflow. In my workflow I have two multi-select list boxes for approvers. First list box is mandatory and other is optional. So user must select one or more approvers from first list box and can select one or more approvers from 2nd list box. After all approvers(from the first list box) grant the needed approval i.e. they will be concurrent approvers then mail should go to the approvers of 2nd list box else author should be notified and process starts over where author makes neccesary changes and re-submits work. And if all concurrent approvers selected from second list box approve the content then content should be submitted.
Now three things need to be consider...... number of approvers will be dynamic, second thing second list box is not mandatory and third thing in both the case approvers will be concurrent.
So whats the best way to design this type of workflow ?
My environment is TS 6.0.1 and win2k3.
Find more posts tagged with
Comments
jbonifaci
Build it exactly as you just stated really. If you have 7 approvers in the first list box that are concurrent, build 7 tasks called First_List_Box_Approver_1, First_List_Box_Approver_2 ... First_List_Box_Approver_7. All 7 of these will either transition to your Second_List_Box_Email_Notification task or your Post_Approval_Processing task, depending on whether the 2nd list box has any users. If it goes to the notification task, this task will then transition to each of your Second_List_Box_Approval_X tasks, which will transition to the Post_Approval_Processing task. The Post_Approval_Processing task will not be activated until all of the approval tasks have completed.
~Jeff
Adam Stoller
I believe the implicit assumption here is that the WFT code is being generated dynamically based upon the information filled in / retrieved from the instantiation form. As such - I'd agree - process the information received to determine how many tasks are needed for the first concurrent review cycle (which will also provide successor and predecessor information for whatever preceeds and follows the first concurrent review cycle - and then if there's a second review, the same thing is done for that.
If the question was how to do this with a statically written XML wft code - then the answer is: use embedded Perl code and generate the tasks and their associated transitions, dynamically.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Enthu
build 7 tasks called First_List_Box_Approver_1, First_List_Box_Approver_2 ... First_List_Box_Approver_7.
Here how do you want me to build these 7 tasks. Dynamically ? Because number of approvers will be known at runtime only and total number of approvers in one list box can be anything.
jbonifaci
Yes, I thought I made that clear, but I guess not. You build all of your task xml and appropriate successorsets/preds based on the contents of your list boxes. I guess I should have made the 7 an X to make it more clear.
~Jeff
iwovGraduate
You might want to look at how the OOTB solutions workflows are implemented. It pretty much gives your a baseline on which you can build.
gzevin
I thinl Johny has written an article about it
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
james1
Take a look at iwhome/local/config/wft/solutions/configurable_author_submit.wft (or configurable_author_assignment.wft, if you don't want a submit workflow). If you pretend for a moment that the dynamically selected approvers are known ahead of time, then you could just configure the workflow with this parameter:
review_type=serial[concurrent[user:user1frombox1,user:user2frombox1],concurrent[user:user1frombox2,user:user2frombox2]]
I might suggest that you make a copy of that WFT, and change its logic to dynamically build its "review_type", instead of looking it up in its config file. I think that figuring out how to do this would take far less time that writing your WFT from scratch.
Hope this helps.
-- James
--
James H Koh
Interwoven Engineering
Enthu
I am attaching a workflow which i made from one of the tutorial but this workflow is also not running. After debuging i came to know that it is not assgning successor and predessor correctly. so plz help me resolve this bug.
Adam Stoller
Have you tried to debug this?
Have you looked at the generated job description file?
Can you document exactly what aspects of this wft you changed from the original?
Did the original work?
Is there a reason why the highlighted line was commented out?
for(my $i=0; $i < __ELEM__('reviewer'); ++$i) {
# $pred_list .= "<pred v='Review_". __TAG__("reviewer[$i]") . "'/>\n";
}
Since you're using succ_list and pred_list in various places within the WFT and succ_list is based off of pred_list - if you don't set pred_list - this will probably break a whole bunch of things in the instantiated code.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Enthu
Actually by mistake i left it commented while attaching the workflow in this forum. While debugging (the original workflow) i came to know that i was getting the error because of this line only. so i did some trial and error but couldn't get the success. This line in original workflow is not generating the desired output. It gives the output like
review_1
review_2
in place of review_nameofreviewer
Adam Stoller
I believe if you replace __TAG__ with __VALUE__ in that line, it might work a bit more as desired.
But again - it helps to look at the generated job description file to verify whether the code is being instantiated the way you desire.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Enthu
I tried with VALUE tag also but it didn't work. It works well only if I choose one reviewer from list box. I am attaching the workflow output which i got after debugging it.
Adam Stoller
whoops, my bad - I think (though still untested) the code should be:
for(my $i=0; $i < __ELEM__('reviewer'); ++$i) {
$pred_list .= "<pred v='Review_".
__ELEM__
("reviewer
")[$i]
. "'/>\n";
}
or:
for(my $i=0; $i < __ELEM__('reviewer'); ++$i) {
$pred_list .= "<pred v='Review_".
(
__ELEM__
("reviewer
")
)
[$i]
. "'/>\n";
}
Try those, and see if that fixes the problem.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Enthu
Thanks Adam it worked. Sorry for being late in response, I have near about finished it but facing one syntax problem. How can I use if-else statement in template-script tag used for creating dynamic tasks? I am attaching snippet of my code for reference. When I use if-else statement like the way we use it generally I get javacript error (error is some { missing).
Adam Stoller
Something doesn't look right in that picture - I'm assuming that's the output from turning on debugging within the wft - i.e. the yellow-and-green screen of which you only showed the green part?
If so - you should not be seeing ANY perl code within that window - it should be pure XML - and so you've got bigger problems than you may have first thought.
As for the syntax of the section you were asking about - well - that's pretty trivial - but it points to a lack of understanding of Perl coding which makes me feel you would be better served taking some real training / reading some good books / or hiring a consultant to do the work for you rather than having me / us spoon-feed you answers ... however, to give you a hint so that you might discover this on your own... consider that you seem to be trying to insert a conditional statement in the middle of a large string....
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com