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)
Using _TAG_() to match patterns
cheeku
I want to match a pattern in the filepath (which I am getting from TAG__(iw_file[0])), based on which I would decide the tasks in the workflow.
I use the following code in the <template_script> tag:
$filepath='__TAG__(iw_file[$i]);';
$filepath=~/events/;
this returns false even if 'events' exists in the string.
I got the value of $filepath printed in a file:
It gives $_this-->_VALUE(iw_file[0])
I tried using
$filepath='_VALUE(iw_file[0]);' ;
Even this does not work
Find more posts tagged with
Comments
Adam Stoller
You want
__VALUE__(...);
[note double-underscore both before *and* after the word "VALUE"]
__TAG__()
outputs
its value, and thus should only be used *outside* the
<template_script>
sections
__VALUE__()
returns
its value, and thus should only be used *inside* the
<template_script>
sections.
In your case - you probably (I'm guessing from the bare fragments of code you showed) want something like:
<template_script><![CDATA[
...
for(my $i = 0; $i < __ELEM__('iw_file'); $i++){
my $filepath = "__VALUE__(iw_file[$i])";
# note: only one semi-colon, at the end of the statement
if ($filepath =~ /events/){
# do something ...
}
else {
# do something else ...
}
}
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
cheeku
I have used the following which does not work
<template_script><![CDATA[
open(DEBUG,">c:\\1.txt");
print DEBUG '__VALUE__(iw_file[0])' ;
my $filepath = "__VALUE__(iw_file[0])";
if ($filepath=~/events/)
{
__INSERT__("<successorset description=\"End\">\n");
__INSERT__("<succ v=\"End\"\/>\n");
__INSERT__("<\/successorset>\n");
}
else
{
__INSERT__("<successorset description=\"Deploy_Mail\">\n");
__INSERT__("<succ v=\"Mail_Deploy_Deployer\"\/>\n");
__INSERT__("<\/successorset>\n");
}
]]></template_script>
In the debug file it prints $_this_-->__VALUE__(iw_file[0])
JonathonG
I believe these couple of lines:
print DEBUG '__VALUE__(iw_file[0])' ;
my $filepath = "__VALUE__(iw_file[0])";
should be:
print DEBUG __VALUE__('iw_file[0]');
my $filepath = __VALUE__('iw_file[0]');
Jonathon
Independent Interwoven Contractor
cheeku
Thanks.It worked.
There's another problem. When I select the debug mode as true and click on 'run job'. There comes an alert which says' object expected' in iwwf_instantiator.cgi. While if i select false, no message appears and the workflow starts.
Second, can I limit the rights to change the task owner only to editor?
Adam Stoller
Not sure what's happening when you select debug_mode - chances are it's an error in your wft code somewhere.
Second - no - you cannot limit the rights to change the task owner only to editor. It is limited, by the system, to be: (a) the task owner, (b) the job owner or creator (can't remember which), (c) a master user.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
cheeku
Just to repharse my question, perhaps it was not clear:
I want that only editor should be able to change the task owner. So I want to disable the 'Change Task Owner' option in the 'Job Admin' menu for other roles. Is it possible?
Adam Stoller
to the best of my knowledge - no - it is not possible to remove that menu item, nor to restrict the use of that menu item to only an editor.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com