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)
Capturing the value from a User Variable
Hazzie
I have a requirement to send an email out to a person to tell them they have work to do, if the Author is different to the job creator. My stumbling block is that the Author is set via a User variable within the workflow and i do not seem to be able to capture that value until i hit the author task. The Author task is after the email task. Basically it goes like this. Start->CGI-task->Email-task->Author-Task->RestOfWorkFlow.
Has anyone any ideas on how to capture the variable $uAuthor when it is set at the Start point?
is their a way to find the owner of a task that appears in the future? i.e. when the CGi-Task is hit look up the owner of the Author task (set by the value of $uAuthor) and write it to the workflow variables usnig the SetVariable command?
Thanks for any help.
Find more posts tagged with
Comments
Migrateduser
You can examine the value of $uAuthor in the wft <template_script> code, and set the owner of the author task appropriately before the job ever starts. Use the __VALUE__() function to read the value of $uAuthor. if __VALUE__($uAuthor eq $iw_user) then the author is the same as the job creator.
bw
Bob Walden [bob.walden@interwoven.com]
Interwoven Education Group
IM: Yahoo, MSN bob_walden
Hazzie
Thanks for your help bob. However, I would just like to clarify a couple of things. When you say wft template script area do you mean the perl code editor window within workflow builder. If so i tired the following and it doesnt seem to work.
use TeamSite::WFtask;
use TeamSite::WFworkflow;
my ($wfid, $taskid, $workarea,
@files)
=
@ARGV
;
my $Task = new TeamSite::WFtask($taskid);
my $JobID = $Task->GetWorkflowId();
my $Job = new TeamSite::WFworkflow($JobID);
$Job->SetVariable("AuthorName","__VALUE__($uAuthor)");
when i inspect the workflow using iwgetwfobj there is no variable being set. Have i missed something obvious?
Cheers for any help.
Migrateduser
This goes beyond what we can achive in a question-response forum like DevNet. I suggest you read the wf dev guide very carefully, as well as the wf dev tutorial (
https://support.interwoven.com/kb/download.asp?AttachmentID=1214&fn=workflow_tutorial2
). What you need to do is to study WFT scripting a bit more. The code you're showing us as a sample won';t work in a WFT--it's meant for use in an externaltask script.
bw
Bob Walden [bob.walden@interwoven.com]
Interwoven Education Group
IM: Yahoo, MSN bob_walden
Migrateduser
How are you setting the $uAuthor variable? Is this something you have in your TAG_info section? Using Workflow Builder is both a benefit and a disadvantage - it doesn't help you much when you need to do something remotely complex. If you have defined the author in your TAG_info section, you can set up a workflow variable to contain the value of the chosen author:
<variable key='author' value='__TAG__('iw_author');'/>
I'm not sure how you do this in Workflow Builder, but you can edit the wft file that Workflow Builder spits out if need be. If you want further help with this, email me directly.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com