Hello there,
I'm currently working on creating a Teamsite Workflow. We currently have a submit workflow titled "Application Workflow" written in the old XML format. Some new requirements have been added and rather than modify the existing workflow, we saw this as an opportunity to recreate it within the new Workflow Modeler. I went to the training course last month in Chicago and was able to assemble the workflow, however I had some questions regarding specific variables.
In the existing workflow, the following line and function are used to bring in user lists for User tasks:
my ($app_users) = iw_getnames("app_users", __VALUE__("iw_user"), __VALUE__("iw_workarea"));
sub iw_getnames {
my ($list, $user, $branch) = (shift, shift, shift);
$branch =~ s|.*/main/(.+)/WORKAREA/.*|$1|;
$branch =~ s|/|_|g;
my $file = "$iwhome/local/config/wft/common/userlists/$branch.$list";
if(!open(IN, "<$file")) {
$html = "";
} else {
$html = "\n";
foreach my $line () {
my ($uid, $name) = split(":", $line);
if($uid eq $user) {
$html .= "$name\n";
} else {
$html .= "$name\n";
}
}
$html .= "\n";
}
return $html;
}
TAG_info(
app_user => [
html => "$app_users",
label => "User Approval:",
is_required => "true"
],
...
Then, throughout the workflow the following is used:
owner="__TAG__('app_user');"
Basically the list of available users for a task is read in from a file based upon the current branch. I was considering redoing this entire mechanism as a data source and having the data source simply read the names using BufferedFileReader objects in Java. I started writing a class that implement ArrayDataSource similar to the one located on p;67 of the TeamSite 6.7.1 Advanced Workflow Development workbook.
I wanted to know what would be the best way to pull in variables such as the branch name and user. I assume it would be using the com.interwoven.cssdk.common API, however I can't seem to find Javadocs for that API on the reference CD I was given.
Also, how is logging handeled within the DataSource class? I didn't notice the log4j jar files in the Teamsite lib directory. Is there a standard API for logging/debugging as well used throughout Teamsite?
I also had a question regarding the deployment task. In the current setup, we only have external tasks that call the opendeploy commands as seen here:
#!c:\iw-home\iw-perl\bin\iwperl
use TeamSite::WFtask;
use TeamSite::WFworkflow;
use TeamSite::Config;
my $iwhome = TeamSite::Config::iwgethome();
my ($deployment, $wfid, $taskid, $workarea) = (shift, shift, shift, shift);
my $task = new TeamSite::WFtask($taskid);
my $odhome = "F:/Interwoven/OpenDeploy";
my $iwperl = "$iwhome/iw-perl/bin/iwperl";
my $oddeploycmd = "$odhome/OpenDeployNG/solutions/perl/iwodstart.ipl";
my $branch = $workarea;
$branch =~ s|\\|/|g;
$branch =~ s|.*/main/(.+)/WORKAREA/.*|$1|;
$deployment = "$branch/$deployment";
my $resultsdir = "$iwhome/local/logs/wft/wf$wfid";
mkdir($resultsdir, 777);
my @files = $task->GetFiles();
my $filelist = "$iwhome/local/logs/wft/wf$wfid/f$taskid.txt";
my $results = "$iwhome/local/logs/wft/wf$wfid/r$taskid.txt";
open(FILELIST, ">$filelist");
foreach my $file(@files) {
print FILELIST "$file\n";
}
close FILELIST;
my $status = system("$iwperl $oddeploycmd $deployment -inst .wf$wfid -k filelist=$filelist -k workarea=\"Y:\\$workarea\" > $results");
if ($status) {
$task->CallBack(1, "Error with deployment: $status");
} else {
$task->CallBack(0, "Deployment Successful");
}
exit;
With the addition of the actual Deployment task, how is this handled? I noticed the $oddeployment command (iwodstart.ipl). Is this was the deployment task essentially replaces? The flat file list that's generated and sent to opendeploy using -k filelist=$filelist; does filelist become a variable in the new workflow manager and should I use javascript to generate that flat file list?
Just trying to get an handle on this migration and wrap my head around the workflow. Any help is appreciated.
Sumit