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)
TeamSite::WFworkflow->GetVariable() issue
Bowker
I'm trying to get the value of a variable within a workflow. The variable has three possible values:
XXXXX
<nothing>
<not defined>
XXXXX and <Nothing> is a valid value. when I call TeamSite::WFworkflow->GetVariable() and the value is <nothing> I get 'undef' returned. Now how can I tell the difference between <nothing> and <not defined>
Dan Bowker
Northern Trust
Web Publishing Technology
Find more posts tagged with
Comments
james1
You can call GetVariables() to see if your variable exists on the workflow.
-- James
--
James H Koh
Interwoven Engineering
Bowker
GetVariables() does not list the variable
iwgetwfobj shows the variable as <variable key="branch" value=""/>
Dan Bowker
Northern Trust
Web Publishing Technology
james1
What is the distinction in your mind between "<nothing>" and "<not defined>". I assumed that "<nothing>" meant the value of the variable was the empty string ("") and that "<not defined>" meant that the variable was not defined (i.e., did not exist at all). But I think you meant something different?
-- James
--
James H Koh
Interwoven Engineering
Bowker
Correct.
<nothing> is the empty string ""
XXXXXXX is something like "NF"
<not defined> is not even mentioned in the file at all.
Dan Bowker
Northern Trust
Web Publishing Technology
jbonifaci
Dan, I believe you misunderstood what James is saying. You should be able to do exactly what he said:
use TeamSite::WFworkflow;
my $wfId = 12345;
my $wfObj = new TeamSite::WFworkflow($wfId);
my $variable = $wfObj->GetVariable("myVariable");
if (!defined $variable)
{
print "wf variable not defined\n";
}
elsif (!$variable)
{
print "wf variable defined, but empty\n";
}
else
{
print "wf variable defined: $variable\n";
}
Bowker
You are correct - I did misunderstand. Your code (BTW: thanks for the copy/pasteability of it) set the record straight and did EXACTLY what I wanted.
THANKS
Dan Bowker
Northern Trust
Web Publishing Technology
jbonifaci
No problem Dan, I'm glad you got your issue resolved.
Jeff