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 Serial approval
Hazzie
I have posted before asking for information on Dynamic approval, and thanks to the people who replied as your ideas helped me solve my problem. This is similar and would seem a much more simple task to do, however the implementation of it is causing me problems.
I already have in place code that allows me to select 1-n amount of approvers via a multi select box. This allows me to build up a concurrent approval workflow. The business users are now asking for the same ability i.e. they can pick any number of people but this time they want it in a serial workflow. i.e. one approver does his/her job and then it moves on to the next and so on till the end of the approvers.
Now at first glance it would seem as if I have most of the code in place for this already however, I do not think a multi select box is appropriate for this type of job. I would much prefer an ordinary drop down select box.
Is there a way of creating a 'replicant' type approach to this. i.e. the workflow input form is displayed allowing an author to be selected. Then a drop down select box is available to the user to select an Approver. Once they have selected a user, the form is reloaded and another approver box appears to allow the next approver (if needed) to chosen.
Hazzie
TS 5.5.2 on NT.
Find more posts tagged with
Comments
Bowker
This is a good one.
I can think of three different ways to do this neither is pretty.
1) (this is what we did) build different workflows, one for each different number of approvers you may want. (one approver, two approvers, ...) and duplicate what you already have. When the user tries to initiate the job, he/she would have to pick how many serial approval steps there are. Unless you are dealing with 1 to LOTS different approver this is the easiest of the three choices I'm presenting here.
2) Build the workflow from an application that would build the workflow XML file. The external application would create the XML file with the proper tasks already built in. Once the XML is built it should be started with iwjobc and iwinvokejob. An example of the XML you want to start with can be viewed by running your current workflow with debug on.
3) Build a workflow with the maximum number of approval steps possible. Between each step put an external task that would either continue to the next approver, or skip over the approvers (probably to a submit near the end). The external task would have two successors and you could check a job variable to see if there are more approvers left. The external task would then do a callback X where X depends upon the next step desired. Remember all the 'skipped' tasks must be owned by someone even if they won't be used.
There may be other solutions, but I don't know of a 'simple' way to do this.
SMITTY?
nipper
I do this often with a 0 timeout. So I fill out the N approval steps and during startup put a timeout of 999999 or 0 depending on if the parameters
The only catch is that when an approval times out, it needs to go to a different step than the original. So I have it go to a dummy task that moves to the approval step.
My email notification has the ability to send to nobody which just returns success, so the email review task steps is bypassed as well.
HTH
Andy (and don't call me Smitty)
Bowker
I really like Andy's solution!!!
The 'timeout' succ could go the last step thus avoiding the other approval / e-mail steps.
Migrateduser
While you gentlemen have possibly solved the problem in the job spec, you have cleverly left poor Hazzie hanging as far as the UI part - how would she be able to allow for a dynamic number of approver names be entered. This one is perplexing. I am not a UI wizard, and so creating fancy HTML/JavaScript stuff is not my thing. The only solution I can think of that will not require a lot of coding trial and error is this, and it's probably the least desirable of all. Simply have a free-form text input for approvers, and have the workflow creator type in the sequence of approvers, comma separated. It's simple and will work for any number of approvers you need. What it forces you to do is some error handling - validating the users in case of typos and such, but that's a **** of a lot easier to do that come up with a way to redisplay the drop-down box dynamically.
Thanks for asking Dan. And Andy, you should have thanked Dan for calling you Smitty - that's quite an honor.
At least he didn't call you moron.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Bowker
Dave -
You weren't supposed to notice the lack of 'UI' help there.
A multiple select list box with all the possible approvers could presented and each selection could be put as the user/group in all the tasks that will already have been built.
nipper
>While you gentlemen have possibly solved..
Gentlemen ? Who came in ?
>left poor Hazzie hanging as far as the UI part - how would she
There you go again, calling a he a she. For one who complains about the profile, you should read Richard's. :-)
The UI piece is pretty easy.
On the CGI, we have 5 pull downs for optional approvers, mapping the author.uid to Ldap. Default is nobody, otherwise listed as names.
I do not think the UI needs to be completely dynamic, n pull downs are not too tough. See if that will work.
I can send a screen shot if needed.
Andy (working on my Moron status)
Hazzie
>>While you gentlemen have possibly solved..
>Gentlemen ? Who came in ?
apparently not me....
>>left poor Hazzie hanging as far as the UI part - how would she
>There you go again, calling a he a she. For one who complains about the profile, you should read Richard's. :-)
.
>The UI piece is pretty easy.
>On the CGI, we have 5 pull downs for optional approvers, mapping the author.uid to Ldap. Default is nobody, otherwise listed as names.
>I do not think the UI needs to be completely dynamic, n pull downs are not too tough. See if that will work.
>I can send a screen shot if needed.
>Andy (working on my Moron status)
Andy,
Why 5? If that is a limit you have imposed then you may have the wrong end of the stick. I am looking for a way i can have 1 to any number of approvers. This i can do with a multi select box, but i am wanting to do it as individual drop down box's as i think this in a UI sense is more appropriate.
Can you send me the screen shot. I will pm you my email address.
Hazzie
TS 5.5.2 on NT.
Bowker
I've been wrong in the past but....
If you want up to N approval tasks with different approvers in a serial fashion, unless you are doing nested workflows and dynamically assigning the user of the 'sub job' repeatedly until you run out of approvers, won't you need to create a workflow with "N" unique user/group tasks?
nipper
You are correct, & nested WFs are a serious pain. Unless you are a consultant & want to pad your hours. :-)
Had them here, people hated them (do to the start nested job). There is a script to start a nested job but it is of marginal value since it will not work on dynamic WFs. (per support)
Andy
Adam Stoller
Off the top of my head:
Use Perl within your WFT to generate the review tasks.
During instantiation - prompt for the number of reviewers (store the resultant value in a workflow variable)
During instatiation, loop for
N
times generating
N
reviewer tasks (and associated tasks if need be for things like notification) - the reviewer tasks should be systematically named "
review_
N
" or something like that.
Within a
<cgitask>
(start task, or just somewhere prior to the review cycle), prompt for the
N
reviewers (where
N
was defined when you instantiated the workflow).
The CGI can retrieve the value
N
from the workflow variable and generate a reasonably nice entry form that prompts for reviewers for each of the
N
tasks (and even do some validation to make sure that the same person isn't selected more than once)
The CGI then performs
TeamSite::WFtask:
etOwner()
calls for each of the
N
tasks (this can be programmatically done because the tasks were systematically named, and you can lookup each task by name to retrieve the task object and then make the method call on it using the information provided in the CGI form for that Nth review task.
I'm in the middle of other work right now, so I'm not sure if I actually finished explaining the concepts above - but hopefully that will give you an idea of how to achieve what you're looking for.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Hazzie
Let me see if i have understood your idea.
1) You suggest i have on the job specification page a box where i can input the number of approvers required.
2) Then once the job is instantiated the workflow is created built up with a number of default apprvoer steps called approver_N
3) Then I have a cgi task at the statr of the workflow that programtically searches the wft spec for the numebr of apprvoers and present on the cgi form box's for the user to fill in the correct people.
4) Then using Teamsite functions i can then set the owner of the code.
Have i understood correctly?
Hazzie
TS 5.5.2 on NT.
Adam Stoller
Yes - everything except the misspelling of "statr" :-) - that would be my approach, Of course how you decide to design the UI for the cgitask to select the reviewers is wide-open.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com