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)
use lib
pbenn
TS 6.5 SP1
Sol9
I have the following configuration:
Server1 contains a dev and test branch
Server2 contains the production branch
The location of the test and production branch is the exact same directory structure (we OD from test to production). The dev branch has the same workarea structure, but because it resides on the same machine as test, it obviously needs to live in a seperate workarea.
Our workflow is about 160 steps, with about 110 external tasks. Each external task includes some custom perl modules. These perl modules reside in the dev branch and are promoted to test and production. Each external task script has a 'use lib /path/to/custom/module' directory. This path needs to be updated when promoting the code base from dev to test.
Question: I'd like to avoid the hardcoding of the use lib path. Each branch has it's own database. I'm thinking I could do something like this:
BEGIN {
use DBI;
<open connection>
$wa = dbquery(<qwuery to get workarea>);
use lib "$wa/path/to/custom/perl"
}
Make sense? One problem is that I still need to know the specific branch login information. Arrgh!
Any other ideas? Other solutions I've considered are to add it to site/lib. That wouldn't work because the code would be shared between dev and test on Server1. I haven't tested relative paths in the use lib call. Do scripts which run as iw_areaowner run in the local workarea?
I need a way to determine the workarea at load time, is the summary of my problem.
TIA,
P.
Find more posts tagged with
Comments
Adam Stoller
Our workflow is about 160 steps, with about 110 external tasks.
Yikes! this sounds like a very questionable design - but we'll let that pass for now.
Each external task includes some custom perl modules. These perl modules reside in the dev branch and are promoted to test and production. Each external task script has a 'use lib /path/to/custom/module' directory. This path needs to be updated when promoting the code base from dev to test.
Question: I'd like to avoid the hardcoding of the use lib path. Each branch has it's own database. I'm thinking I could do something like this:BEGIN {
use DBI;
<
open connection
>
$wa = dbquery(<
qwuery to get workarea
>);
use lib "$wa/path/to/custom/perl"
}
Make sense? One problem is that I still need to know the specific branch login information. Arrgh!
Any other ideas? Other solutions I've considered are to add it to site/lib. That wouldn't work because the code would be shared between dev and test on Server1. I haven't tested relative paths in the use lib call. Do scripts which run as iw_areaowner run in the local workarea?
I need a way to determine the workarea at load time, is the summary of my problem.
The externaltask script has access to the externaltask id - from which you can create a task object, from which you can obtain the current task's areavpath. So you might be able to do something like this:
...
use TeamSite::WFtask;
my $task = q{};
my $area = q{};
BEGIN{
$task = TeamSite::WFtask($ARGV[1]);
die("invalid task ($ARGV[1])") if (!$task->IsValid());
$area = $task->GetArea();
use lib "$area/path/to/custom/perl";
use custom::module;
}
(the above is untested - but I believe it will work, possibly with some tweaking though)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Edited by ghoti on 02/02/06 09:50 AM (server time).
pbenn
Thanks that looks like it'll do the trick ... btw, the workflow captures a multi year review process that users were resistent to re-engineer before/during workflow design. The 160 steps includes those in nested workflows so it isn't (quite) as bad as you'd think. But yeah, the complexity of the workflow is unmatched, I think.
P.