How do I get job variable.
Options
I have a workflow with 10 external tasks. In the second external task I am creating two job variables. I would like to get these variables in third external task.
I tried with these command. It works from command line. But doesn’t work from the workflow.
$iwhome/bin/iwjobvariable -g FormatReviewUsers $wfid
$workflow->GetVariable($option_step);
and also I used $workflow->Refresh() in the second workflow.
Any Ideas?
Thanks
I tried with these command. It works from command line. But doesn’t work from the workflow.
$iwhome/bin/iwjobvariable -g FormatReviewUsers $wfid
$workflow->GetVariable($option_step);
and also I used $workflow->Refresh() in the second workflow.
Any Ideas?
Thanks
0
Comments
-
Try wrapping quotes around your argument for GetVariable.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com0 -
-
Maybe if you attached your externaltask script that isn't working properly, it would help debug the problem.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com0 -
#!/bin/iwperl
use TeamSite::WFworkflow;
use TeamSite::WFtask;
use TeamSite::Config;
use strict;
my $option_step_name = $ARGV[0]; # job variable
my $wfid = $ARGV[1];
my $taskid = $ARGV[2];
my $workflow = new TeamSite::WFworkflow($wfid);
my $task = new TeamSite::WFtask($taskid);
my $iwhome = TeamSite::Config::iwgethome();
open (LOG, ">>$iwhome/custom/logs/intranet/ta_check_for_options.log");
my $cmd="$iwhome/bin/iwjobvariable -g '$option_step_name' $wfid";
my $test =`$cmd`;
print LOG "\ncmd=$cmd\n\nTEST2: $test\n\n";
print LOG "DEBUG:" . $workflow->GetVariable('$option_step_name');
print LOG "\nERROR: $?\n";
close (LOG);
exit;0 -
And what does your log output look like?
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com0 -
So if I understand correctly, you can execute the command:
/www/negril3/interwoven/iw-home/bin/iwjobvariable -g 'FormatReviewUsers' 8460
from the command line and it works, but it doesn't work within this externaltask script, nor does GetVariable. Correct? That is weird. How are you creating the workflow variable? Please post the entire script and can you try doing a GetVariable in the same script where you create the variable and log whether it works?
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com0 -
Yes, It works from command line. Doesn’t work from externaltask.
I am creating variables like this
my $out = $workflow->CreateVariable("FormatReviewUsers", "$FormatReviewUsers");
print "AAAAA out: $out";
$workflow->CreateVariable("EditorialReviewUsers", "$EditorialReviewUsers");
$workflow->CreateVariable("FormalApprover", "$FormalApprover");
$task->Refresh();
$workflow->Refresh();
print LOG $workflow->GetVariable("FormatReviewUsers");
the last command is getting job variable. But I want to get these job variables in the other external task.0 -
Well I'm stumped. You shouldn't need to perform any refreshes during this process. Have you tried hardcoding the variable name in the GetVariable command in the second externaltask instead of using a variable? I assume you got the correct value printed in the log when you added the GetVariable to the externaltask that creates the variable?
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com0 -
OK, last request, because I think the Interwoven folks will ask for this anyway. Can you attach your job spec for the workflow that is being used to call these externaltasks and note which task is the one setting the variable and which task is the one that's attempting to read it?
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com0 -
A bit of a shot in the dark but.......
I've had problems writing to wf variables from cgi tasks when ran with out the use of the cgi wrapper (impersonates the task owner user). However your scripts are external tasks and should run fine. the owner of the task is okay in terms of security permissions ?0 -
my $cmd="$iwhome/bin/iwjobvariable -g '$option_step_name' $wfid"; my $test =`$cmd`; print LOG "\ncmd=$cmd\n\nTEST2: $test\n\n"; print LOG "DEBUG:" . $workflow->GetVariable('$option_step_name'); print LOG "\nERROR: $?\n";
Uhm - the code above shows you using single-quotes ('...'
) around a variable ($option_step_name
) - single-quotes prevent the variable from being interpolated so the result is that you are literally asking for the value of a variable named$option_step_name
- which I'm pretty sure was not your intention.
Have you tried replacing those single quotes with double-quotes?
Also - what version of TeamSite are you using on what platform?
--fish
(Interwoven Senior Technical Consultant)0
Categories
- All Categories
- 109 Developer Announcements
- 49 Articles
- 100 General Questions
- 122 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
TeamSite Developer Resources
If you are interested in gaining full access to the content, you can register for a My Support account here.
- Docker Automation
- LiveSite Content Services (LSCS) REST API
- Single Page Application (SPA) Modules
- TeamSite Add-ons
If you are interested in gaining full access to the content, you can register for a My Support account here.