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)
Local folder
fish
TS 552 Solaris
In starting a job from any folder with no files or folders selected. How do I determine which folder the user is in prior to starting the workflow?
Branch and workarea are obvious, however, local folder is not...
If I place show_env.cgi as the start task there is no environment variable giving me where the user is in the directory tree.
Surely I'm missing something obvious here!
Steve
Find more posts tagged with
Comments
Jeremy
Hi Steve,
What about placing the show_env code into the WFT itself - right at the begining before the workflow is kicked off. Write the output of this to a file.
There maybe a variable set in there that may say the folder.
HTH.
Jeremy
Migrateduser
It's posted as FORM data, not really part of the ENV hash, but the variable is "vpath". And, just a note... 6.1 has another form variable called "cwd.vpath" but I'm not sure that it's reflected in 5.5.2. Incidentally, both variables appear to be identical, so you should be able to get away with "vpath".
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
fish
Hi Jeremy,
Gave it a go and was only able to get out the Environment Variables.
Tried sniffing around the iwwft_instantiator.cgi and I'm not convinced that the local folder is passed on to the Job.
Thanks anyway,
Steve
Jeremy
Steve,
Did you try getting the vpath variable as FORM data as Dave had suggested.
Think that may be the way to go?
fish
Just doing it now - should be OK
Cheers,
Steve
fish
Hi Dave,
I'm back on the case of my local folder issue:-
I've tried a very simple workflow just attempting to extract the form data and cannot get anything out. I think I'm missing something here in my understanding of the Workflow Engine and how it processes the wft file (also, trying a different tack, I've tried the CGI module with $cgi->dump with no success).
I've put my code below - can you see the problem?
#######################################################
<?xml version="1.0" standalone="no"?>
<!DOCTYPE workflow SYSTEM "iwwf.dtd">
<template_script>
<![CDATA[
use TeamSite::CGI_lite;
$|=1;
my $cgi = TeamSite::CGI_lite->new();
$cgi->parse_data();
open FILE, ">/tmp/foo";
print FILE "FORM\n";
foreach $key (sort keys %{$cgi->{form}})
{
if (!ref $cgi->{form}{$key}) { print FILE "$key " . $cgi->escape_html_data($cgi->{form}{$key}) . "\n"; }
else {
foreach my $val (@{$cgi->{form}{$key}}) { print FILE "$key " . TeamSite::CGI_lite->escape_html_data($val) . "\n"; }
}
}
print FILE "ENV\n";
foreach $key (sort keys %ENV) { print FILE "$key " . $cgi->escape_html_data($ENV{$key}) . "\n"; }
close FILE;
]]>
</template_script>
<template_script>
<![CDATA[
TAG_info(
iw_debug_mode => "<input type='hidden' value='false'>",
iw_output_file => "<input type='hidden' value='" . __VALUE__("iw_home") . "/custom/bin/sdlcode/debug.xml'>",
);
]]>
</template_script>
<workflow name="snTest" owner="__TAG__('iw_user');" description="__TAG__('iw_desc');" creator = "__TAG__('iw_user');">
<!-- ================================================================== -->
<!-- ========================== CGI vars ============================== -->
<cgitask name="showEnv"
start="t"
owner="__TAG__('iw_user');"
description="cgi vars"
immediate="t">
<areavpath v="__TAG__('iw_workarea');"/>
<successors>
<successorset description="End">
<succ v="end"/>
</successorset>
</successors>
<command v="show_env.cgi"/>
</cgitask>
<!-- ===================================================================== -->
<!-- ============================== The END ============================ -->
<endtask name="end">
</endtask>
</workflow>
#################################################
Appreciate any help,
Steve
Migrateduser
Nothing jumps out at me, unfortunately. Are you saying that nothing appears in /tmp/foo? What about the timestamp on it? Is it at least accessing the file?
Can you try changing the following line to reflect the value in red?
iw_debug_mode => "<input type='hidden' value='
true
'>",
Also, you can see the posted variables because they're passed on in the successive forms you have to go through in order to start a workflow. In other words, just before you start the workflow, do a VIEW SOURCE on the very last screen to see what the hidden variables are.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
Adam Stoller
Why are you parsing and processing the CGI info in your WFT?
My guess is that this could cause problems since the internals of the workflow engine could also be trying to do this and one or the other will be stripping away the information from where it's expected to be found before the other can get to it.
I'm not sure I entirely understand what you're trying to do - why does it matter what directory within the branch/workarea the user was in when they initiated the workflow? Also, how is the workflow being initiated (new_job, submit, asign, tt_data)?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
fish
I'm trying to get any variables that I can use to form my folder path.
The Workflow is a new_job and the business requirement is that the user can only do this in a particular folder. The wider picture is the workflow kicks off an integration/transfer process from our translation agency Content System to TeamSite and the requirement is for the user to be in the folder where any inbound translations from the agency will be received.
I'm just rather surprised I cannot get the local folder info. Any ideas other than upgrade to TeamSite 6.x?
PS you're right about the problems with the internals of the workflow engine and possible problems - I would not recommend parsing and processing the CGI info in your WFT.
Steve
Adam Stoller
new_job workflows can be (or at least used to be able to be) controlled via branch regex's in the available_templates.cfg and you can use a regex to indicate that it can only be started within a subdirectory of a given branch(es).
You can also use an externaltask within the workflow to verify that any file(s) are contained within subdirectories of the areavpath associated with the task.
That might be a lot easier than trying to control the process at the wft instantiation screen
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
fish
I thought there had to be a simple explanation ...
Many thanks,
Steve