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)
login id
cmalempati
I have a workflow in which I have an external task which executes a ipl file. I want to be able to access the login user in ipl file. How do I do that?
Find more posts tagged with
Comments
NathansDIS
If you have it set as a variable in the workflow, perhaps you can pass it as a parameter to the ipl.
-Nathan
Migrateduser
I assume you're referring to the task owner. Use these two lines:
my $task = new TeamSite::WFtask($ARGV[1]);
my $taskowner = $task->GetOwner();
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 5.5.2 SP2 on Win2K
cmalempati
I am attaching the workflow for your reference. I want the user who approved the group task (approval_task) to be available in my publishEditionFMMATest.ipl file. How can I access the user in this file?
<?xml version="1.0" standalone="no"?>
<!DOCTYPE workflow SYSTEM "../iwwf.dtd">
<workflow name="Money Market / Fixed-Rate"
owner="__TAG__(iw_user);"
creator="__TAG__(iw_user);"
description="Money Market and Fixed-Rate notes rates change Workflow">
<template_script><![CDATA[
# Import routines from library
use Time::Local;
use TeamSite::Usertask qw(
cleanup_paths
get_names_from_file
get_mail_cmd
make_branchpathlist
get_month
get_day
get_year
);
######################################################################
# Name: set_area
# Args: btag - TAG_info variable name for branch path.
# watag - TAG_info variable name for workarea.
# Usage: ($a, $b, $w, $s) = set_area("$btag", "$watag");
# Purpose: If the built-in variables for branch and workarea have
# not been set, pull the information from the workflow
# instantiation form (using the btag and watag info).
# Use the branch and workarea information to generate
# a valid areavpath (using a library routine)
# Returns: Returns the generated areavpath, the branch path, the
# workarea name, and a boolean indicating whether or not
# the branch and workarea need to be prompted for during
# instantiation (this relies on the fact that this code
# is run multiple times during the instantion process).
######################################################################
sub set_area{
my($btag, $watag) =
@_
;
my($avpath, $bpath, $wapath, $skip);
my($iwbpath, $iwwapath) = (__VALUE__("iw_branch"),
__VALUE__("iw_workarea"));
($bpath, $wapath, $avpath) = cleanup_paths(__VALUE__("$btag"),
__VALUE__("$watag"));
return("$avpath", "$bpath", "$wapath", "FALSE");
}
my($area_vpath, $branch_path, $work_area, $skip_branch) =
set_area("branch_path", "work_area");
#======================================================================
# Set some variables for later use
#======================================================================
use TeamSite::Config;
my $iwhome = TeamSite::Config::iwgethome();
my $iwmount = TeamSite::Config::iwgetmount();
my($roles) = "$iwhome/conf/roles";
#---------------------------------------------------------------------
#======================================================================
# Create drop-down menu of all available 'authors' from which to
# choose an assignee.
#======================================================================
my($author_html) = get_names_from_file(undef, 1, undef, "$roles/author.uid");
#---------------------------------------------------------------------
#=====================================================================
# DEBUG
#---------------------------------------------------------------------
sub debug{
TAG_info(
iw_output_file => "<input type='text' value='/ford/.u_01/byee/foo.xml'>",
iw_debug_mode =>
"<input type='radio' value='true'>True</input>" .
"<input type='radio' value='false'>False</input>",
);
}
#---------------------------------------------------------------------
#&debug;
#=====================================================================
# INIT FORM HTML
#---------------------------------------------------------------------
CGI_info(
html_body_options => "bgcolor='#COCOCO'
onLoad='top.resizeTo(600,400);'",
submit_label => "Start the Workflow" ,
cancel_label => "Cancel the Workflow" ,
);
TAG_info(
iw_desc =>
[ html => "<textarea rows='5' cols='40'></textarea>",
label => "Please enter a description of the Task to be completed",
error_msg => 'Please enter a description of the task to be completed',
],
branch_path =>
[ html => "<select name='branch_path' size=1><option value='/default/main/Internet_Web_Sites/FordCredit_ATG6/FordCredit_ATG6_DEV'>FordCredit_ATG6_DEV</select>",
label => "<font face='verdana' size='2'><b>Select Branch</b></font>",
],
work_area =>
[ html => "<input type='text'></input>",
label => 'Enter Workarea',
valid_input => 'wa_validator($_, 0)',
error_msg => q{'wa_validator($_, 1)'},
],
);
__INSERT__("
<variables>
<variable key='http_host' value='$ENV{HTTP_HOST}'/>
</variables>
");
sub wa_validator{
my($wa, $error) =
@_
;
my($branch) = __VALUE__('branch_path');
my($avpath);
(undef, undef, $avpath) = cleanup_paths("$branch", "$wa");
if (! -d "$iwmount$avpath"){
return(0) if (!$error);
return("Invalid path: '$iwmount$avpath'");
}
return(1);
}
#---------------------------------------------------------------------
#=====================================================================
# Some more variables for later use
#=====================================================================
my($iw_author) = __VALUE__('iw_author');
my($iw_user) = __VALUE__('iw_user');
#---------------------------------------------------------------------
]]></template_script>
<updatetask
name="get_latest_task"
description="This will make sure that the lastest files are there before editing. You may need to resolve conflicts."
owner="__TAG__('iw_user');"
overwritemod="t"
start="t">
__INSERT__("<areavpath v='$area_vpath'/>");
<successorset>
<succ v="enter_data"/>
</successorset>
<srcareavpath v="/default/main/Internet_Web_Sites/FordCredit_ATG6/FordCredit_ATG6_DEV/STAGING/" />
<files>
<file path='/templatedata/Internet_Web_Sites/moneymarket/data/moneymarket1' comment='Edit this DCR'/>
<file path='/templatedata/Internet_Web_Sites/fixedrate/data/fixedrate1' comment='Edit this DCR'/>
<file path='doc/content/moneymarket/index.html' comment='Regenerate this file'/>
<file path='doc/content/moneymarket/account_comparison.html' comment='Regenerate this file'/>
<file path='doc/content/fixedrate/rates_terms.html' comment='Regenerate this file First'/>
<file path='/doc/moneymarket/fmma_rate_history.pdf' comment='Do not modify this file'/>
<file path='/doc/fixedrate/frn_rate_history.pdf' comment='Do not modify this file'/>
<file path='/doc/images/moneymarket/fmma_acct_com_chart.jpg' comment='Do not modify this file'/>
</files>
</updatetask>
<usertask name="enter_data"
owner="__TAG__('iw_user');"
description="Update the percentages for the bar chart and the date, preview the copy and barchart, and select: Finished">
__INSERT__("<areavpath v='$area_vpath'/>");
<successors>
<successorset description="Finished">
<succ v="email_approver"/>
</successorset>
</successors>
</usertask>
<externaltask name="email_reject"
owner="__TAG__('iw_user');"
description="Notification sent via e-mail to the Business Author to re-enter the rates as per the comments">
__INSERT__("<areavpath v='$area_vpath'/>");
<successors>
<successorset description="Email Finished">
<succ v="enter_data"/>
</successorset>
</successors>
<command v="/usr/iw-home/local/config/wft/iwsend_mail_fc.ipl moneymarketTest_author"/>
</externaltask>
<externaltask name="email_approver"
owner="__TAG__('iw_user');"
description="Notification sent via e-mail to Business owner to approve/reject the information">
__INSERT__("<areavpath v='$area_vpath'/>");
<successors>
<successorset description="Email Finished">
<succ v="approval_task"/>
</successorset>
</successors>
<command v="/usr/iw-home/local/config/wft/iwsend_mail_fc.ipl moneymarketTest_approval"/>
</externaltask>
<grouptask name="approval_task" owner="__TAG__('iw_user');"
description="View the data and approve/change/reject the information" readonly="t">
__INSERT__("<areavpath v='$area_vpath'/>");
<successors>
<successorset description="Approve">
<succ v="submit_to_staging_task"/>
</successorset>
<successorset description="Reject">
<succ v="email_reject"/>
</successorset>
</successors>
<sharedby>
<user v="cmalempa"/>
<user v="jcremeri"/>
</sharedby>
</grouptask>
<submittask
name="submit_to_staging_task"
description="Following files are submitted to STAGING after approval."
owner="__TAG__('iw_user');"
unlock ="t">
__INSERT__("<areavpath v='$area_vpath'/>");
<successorset>
<succ v="create_edition"/>
</successorset>
</submittask>
<externaltask name="create_edition"
owner="fcfcwkfw"
description="Create an Edition after submitting files to STAGING">
__INSERT__("<areavpath v='$area_vpath'/>");
<successors>
<successorset>
<succ v="end"/>
</successorset>
</successors>
<command v="/usr/iw-home/local/bin/publishEditionFMMATest.ipl moneymarketTest_it_bus_approval"/>
<variables>
<variable key="branch_name" value="__TAG__('branch_path');" />
__INSERT__("
<variable key='workflow_approver' value='__TAG__(iw_user);'/>
");
</variables>
</externaltask>
<endtask name="end">
<activation>
<pred v="create_edition"/>
</activation>
</endtask>
</workflow>
Adam Stoller
Are you asking how you can access the userid of the owner of an already performed task within an externaltask script of a subsequent task?
If so, look at the perldoc for TeamSite::WFtask - especially parts related to GetTaskByName() and GetOwner().
If not, please try to clarify your question.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
cmalempati
Exactly. I am trying to access the owner of the already performed task in an external subsequent task. Please help.
Adam Stoller
I already did help - I pointed you at the documentation which you should look at to help you write your code. Please look at my last response again.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
training_record.pdf
cmalempati
Thanks for your help.