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)
need help with workflow design
sandy_893
Hi,
I needed some help in workflow.
I need to create a workflow that has the following flow:
1) Author selects Approver 1 and Approver 2 and submits the data. The data goes to Apporver1 first.
2) Approver1 rejects it, it goes back to the Author; if he approves it , it goes to Approver2.
3) Approver2 rejects it, it goes back to the Author; if he approves it , it gets submitted.
Now the problem that i am facing is that i want that if Approver2 has rejected the data, then when the Author again submits it, the data should go to Approver2 directly for approval and not to the Approver1.
Find more posts tagged with
Comments
Adam Stoller
For this to work the way you want you either need
two usertasks defined for the Author, one that transitions to the first reviewer, and one that transitions to the second reviewer, or
an externaltask after the usertask that keys off of a job variable to determine which review task should be transitioned to (
in this case you might use the
wfvarstartop
and/or
wfvarfinishop
sub-elements for your review task definitions
)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
sandy_893
Hi
thanx for the suggestions Fish. The first one was pretty straight forward, how could i not think of that.
Now i have another problem.
At the moment my workflow get initiated when some one submits the file. I want that it should get initiated when some one submits an xml or a doc file and for all other files it should get submitted to the staging without initiating the workflow.
Plz let me know whether this is possible, if so then how ??
thanx
sandy
Adam Stoller
As of 6.x - all submits run through workflows - the issue is whether any additional processing / reviewing is required (by your organization) or whether it should go straight to a submittask - that kind of logic you can add to the internals of your workflow or an externaltask script within the workflow as you see fit.
There is no file pattern constraint in available_templates.cfg - so regardless of whether they're submitting an html, doc, xml, whatever file - you either need to have them select "the right" workflow from a choice of workflows everytime they submit something, or automate the filtering process.
For automating the filter process you could, within the wft, check the extension of the pre-selected file(s) during instantiation and generate either a job description file that just does a submittask (.xml or .doc) or generates a job description file that goes through a review process (anything else) - however, this kind of logic might break down if one were to select multiple files of which only some are .xml and/or .doc files and others are not.
You could split things up within a single workflow using an externaltask to process the list of attached files and maybe temporarilly store all .xml and .doc files in a job variable and then remove them from the task while you proceed through the review process and then re-attach them in another externaltask script just prior to the submittask.
Or, you could do something similar to what we do - which is we have a submit workflow whose sole responsibility is to divide the pre-selected files into "buckets" (in your case, a ".xml and/or .doc bucket" and an "everyting else bucket") and then have that workflow invoke other workflows to process the "buckets" that have contents. If you just have entries in the first bucket - you could perhaps just proceed to a submittask and be done with it. If you just have entries in the second bucket you could invoke (through various means which I believe have been discussed in other threads) a second workflow with those entries being set as pre-selected. If you have entries in both buckets - you would do both things: invoke another workflow for the non-xml-non-doc files, remove them from the current job and then proceed to the submittask with the remainder of the pre-selected files (the xml / doc files)
There are probably a number of other possible ways of approaching this too -- the best thing would be for you to figure out the logic that makes the most sense to you and then develope the code to support your design.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
sandy_893
hi
i was try to get the names of the files to separate them, but when i was using the following code
CODE A :
use TeamSite::WFtask;
use TeamSite::WFworkflow;
my($jobid, $taskid) = (shift, shift);
my $task = TeamSite::WFtask->new($taskid);
my $area = $task->GetArea();
my(
@files)
= $task->GetFiles();
i was getting the files array of size zero, but using this
CODE B :
for (my $i=0; $i < __ELEM__('iw_file'); ++$i)
{
my $fileName = "__TAG__(iw_file[$i]);";
}
i got the loop to work but do not know how to get the names of the files.
Any idea how this can be done and why the above code A is giving a zero size array
thanx
sandy
Adam Stoller
Code A is for an externaltask script
Code B is for a WFT - and I believe you want to use __VALUE__() instead of __TAG__() inside the loop.
I think you need to spend a bit more time reading the manual and/or Workflow Tutorial Supplement - and/or taking some training classes.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
sandy_893
ya even i think the same and i had tried __VALUE__ but that too was not working. Any ways i managed to solve it.
Now tell me one thing that does a temp file of the workflow template gets generated when it is compiled, if so, then whats the location where this file gets generated.
thanx
sandy
Adam Stoller
ya even i think the same and i had tried __VALUE__ but that too was not working. Any ways i managed to solve it.
Care to elaborate on
how
you managed to solve it?
Now tell me one thing that does a temp file of the workflow template gets generated when it is compiled, if so, then whats the location where this file gets generated.
Read up on workflow debugging.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
sandy_893
i retrieved the list of files using the following function
TeamSite::CGI_lite::escape_html_data
but i still do not have any idea why the code in previous posts did not work.
smenon
With TeamSite 6.1 SP2 and in TeamSite 6.5 SP1 you could also specify branch regex matching in available_templates to go all the way down to the folder vpath. So if all of your html files were being saved into a /html folder, you could create a workflow that is applicable only to that folder. In this scenario, your end-users will not see a choice of workflows if they are trying to invoke a workflow from that folder. I hope this made sense and I didn't confuse you..
thanks
--Sunil Menon
Product Manager
Interwoven, Inc.