Home
TeamSite
Mid-workflow assignments
spud
Greetings all.
I am trying to build a workflow that will allow a usertask to set the owner of the next user task. The idea is that a "New Job" is started which will go to a manager. Then I am trying to get a user task to be able to make an assignment for the owner of the next user task (ie manager assigns developer a job from a drop down list of developers)
Has anyone done anything like this in the past? Any help would be greatly appreciated.
Thanks
Tim Peterson
Websense
Find more posts tagged with
Comments
Adam Stoller
Use a cgitask - and make use of the methods in TeamSite::WFtask
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
spud
Thanks for the input. I've played around with the sample cgi workflow provided by TS (we're on 6.1 sp1)
The cgi task looks like this:
<cgitask name="CGI Test"
owner="__TAG__('iw_user');"
description="Let a user run the CGI program"
start="t"
immediate="t"
readonly="t">
<areavpath v="__TAG__('iw_workarea');"/>
<successors>
<successorset description="Finish Job">
<succ v="End"/>
</successorset>
<successorset description="Retry Later">
<succ v="Wait for next test"/>
</successorset>
</successors>
<command v='__INSERT__($cgi_command);'/>
<template_script><![CDATA[
if (
@submit_file
!= 0)
{
__INSERT__("<files>\n");
for (my $i=0; $i <
@submit_file
; ++$i)
{
__INSERT__(" " x 12 . "<file path='$submit_file[$i]' "
. "comment='__TAG__(File_comment_$i);'/>\n");
}
__INSERT__(" " x 8 . "</files>");
}
]]></template_script>
<!-- Some example task variables -->
<variables>
<variable key="sign" value="Virgo"/>
<variable key="city" value="Paris"/>
</variables>
</cgitask>
I've looked at the sample_cgi_task.ipl which is called by this task but cannot figure out how to get back anything that was inputed into the form for use later in the workflow. (ie. taking a name for a developer and using it as the next task's owner) The call back routine within the sample_cgi_task.ipl task looks like this:
# do_task_transition
# Redirects the browser to /iw-cc/transitiontask with the correct
# done page. Leave it up to /iw-cc/transitiontask to handle
# immediate CGI behavior.
#
# ARGUMENTS
# $transition
# $taskid
# $done_page
# $comment
#
# RETURNS
# Nothing.
#---------------------------------------------------------------------
sub do_task_transition
{
my ($transition, $taskId, $comment, $donePage) =
@_
;
my %parameters;
# Required parameters to transition this CGI task:
$parameters{'taskid'} = $taskId;
$parameters{'cgi_transition'} = "true";
# Optional parameters:
if (defined $transition) {
$parameters{'transition'} = $transition;
}
if (defined $comment) {
$parameters{'comment'} = $comment;
}
if (defined $donePage) {
$parameters{'done_page'} = $donePage;
}
foreach my $key (keys %parameters) {
print "<input type=\"hidden\" name=\"$key\" value=\"$parameters{$key}\">\n";
}
print<<EOS;
</form>
<script language="JavaScript">
document.forms['transitiontask'].submit();
</script>
EOS
}
The file mentioned in this line
print "<form name=\"transitiontask\" method=\"POST\" action=\"/iw-cc/transitiontask\">\n";
seems nowhere to be found. Now perhaps I've just exposed my very limited experience with perl or maybe the directory is just flat out missing I done know... Any hints from the gurus out there?
Thanks again!
Adam Stoller
Your questions sound like you are lacking in the skills necessary to do TeamSite Workflow development and customizations.
My suggestions are: Find and read the workflow tutorial supplement (available on devnet) - learn CGI coding, learn Perl, read perldocs on TeamSite::WFtask, TeamSite::WFworkflow, and TeamSite::CGI_lite (and others) - or hire a consultant who will be willing and able to do this for you at a reasonable price.
- or hope someone else feels like doing your work for you and posting it here.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
spud
Funny, I thought the whole point of these forums was to get some simple pointers from the more experienced people. I would never ask someone to do my work for me. And you're right. I am new to perl but certianly not programming. I even admitted so in the previous post. Beating people over the head with the truth of their non-experience in a given language doesn't help much. I was only asking a simple question.
How does one get information returned from a CGI task back to the workflow? If someone could point me to an example somewhere, its all I would need.
Just found the workflow tutorial supplement. Good info in there. Thanks for the pointer.
Edited by spud on 07/21/05 08:40 AM (server time).
Adam Stoller
I'll repeat part of my previous response:<ul>My suggestions are: Find and read the workflow tutorial supplement (available on devnet) - learn CGI coding, learn Perl, read perldocs on TeamSite::WFtask, TeamSite::WFworkflow, and TeamSite::CGI_lite (and others)</ul>If you need help with Perl, I recommend the O'Reilly book: "Programming Perl".
To answer your question: "How does one get information returned from a CGI task back to the workflow?" - Usually by using Perl to set task or job-level variables within the wft by virute of having created a task or workflow object using the Perl modules previously cited.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
awizardly
Look at the PerlDocs
https://support.interwoven.com/library/perldocs/perldocs.asp
Pay Close attention to modules that begin with WF
WFSystem
WFTask
WFWorkflow
Look at the methods available.
Also look at the CLT guide for something that sets the owner of a task to something else. The Perl modules generally just invoke the CLT's or underlying API's to perform their actions.
The sample cgi does nothing other than print out values and then perform a callback, you will have to invoke other code when the form is submit in order to affect other portions of the workflow.