As I need to generate an WF JobSpec XML in an external task, I am trying to execute the wft.The jobfile(WF Job Spec XML) is not forming properly??The code snippet is like this:my $log = "/usr/local/fisher/cms/TeamSite/local/config/wft/fisher/conReview.xml";open(LOG,">$log") or die "Could not open $log";##### Instantiate workflow #####my $wft = TeamSite::WFtemplate->new( template => $workflow);$wft->{tag}{owner}{value} = "iwadmin";$wft->get_tags();my $jobfile = $wft->get_workflow();print LOG $jobfile;Please let me know if any implemented a functionality, of invoking a wft from external task.
my $system = new TeamSite::WFsystem();my $wf = $system->CreateWorkflow($wfFile);if (!($wf->IsValid())){my $wfError = $wf->GetError();}else{$wf->Invoke();}
Does any one have sample code snippet, to execute the wft file from an external task, to get JobSpecXML file as output.Thanks in advance.
Use the code: my $wf = $system->CreateWorkflow($wfFile);my $system = new TeamSite::WFsystem();if (!($wf->IsValid())){my $wfError = $wf->GetError();}else{$wf->Invoke();}
my $wf = $system->CreateWorkflow($wfFile);my $system = new TeamSite::WFsystem();if (!($wf->IsValid())){my $wfError = $wf->GetError();}else{$wf->Invoke();}
How can I create an jobfile(Workflow Job Spec File)?I am trying to execute the nested workflow automatically.For that I am using the jobfile element in the WFTask. Before this task, through an external task, I need to generate the jobspec file.Please give your sugggestions on this.
Thanks for your reply.Even the Interwoven support team has recommended to use the WFconstructor.pm.I am not finding enough documentation or sample code snippet to implement itCould you please provide with sample code snippet or any relevant documentation to do it.Thanks in advance.
use strict;use TeamSite::WFsystem;use TeamSite::WFtemplate;use TeamSite::CGI_lite; # needed by WFtemplateuse TeamSite::WFworkflow;use TeamSite::WFtask;my $workarea = "your WA";my $branch = "your branch";my @files = (Your File List to attach to WF);my $job = undef;my $wf_template = "$iwhome/local/config/wft/.../your.wft";if (-f $wf_template) { # Get WF Template my $wft = TeamSite::WFtemplate->new(template => $wf_template,); # Add Required Tags $wft->{tag}{iw_user}{value} = "Your User"; $wft->{tag}{iw_desc}{value} = "Description"; $wft->{tag}{iw_branch}{value} = $branch; $wft->{tag}{iw_workarea}{value} = $workarea; $wft->{tag}{custom1}{value} = "Something"; $wft->{tag}{custom2}{value} = "Something Else"; # Associate Files for Attachment $wft->{cgi_elem}{iw_file} = scalar(@files); $wft->{tag}{iw_file}{value} = \@files; # Get Workflow Specs $wft->get_tags(); my $job_specs = $wft->get_workflow(); # Instantiate New Workflow. if ($job_specs) { my $wf_tmp = ($^O eq "MSWin32")? "$iwhome\\tmp\\cci\\workflow" : undef; my $wfs = new TeamSite::WFsystem; $job = $wfs->CreateWorkflow($job_specs, $wf_tmp); if ($job->IsValid) { log_it("Workflow Created, JobID is: " . $job->GetId() . "\n"); # invoke WF eval { $job->Invoke(); }; if ($@) { log_it("Failure Invoking Workflow: $@\n"); } else { log_it("Workflow " . $job->GetId() . " Invoked\n"); } } else { log_it("Error Creating Workflow: " . $job->GetError() . "\n"); } } else { log_it("Error Getting Workflow Specs: " . $job_specs->{error_message} . "\n"); }}else { log_it("Workflow Template \"$wf_template\" not found\n");}
...the email notification task is being ignored and never executes...Any ideas why?
I found this thread very helpful. Thanks all. But, I got following questions when I want to invoke a sub WF from an external task. My questions are: (a) How can a child workflow (created by an external task from the parent WF) pass some variables back to external task of the parent WF?? (b) After the child WF passes variables to parent WF, will the external task going to execute again from the start (in this case, the external task kicks-off the sub WF again) or will it be executed from where it kicked-off sub-WF?? Please throw some light on this. Thank in adavnce.Environment:TS 6.5 SP2 on Windows 2000.
I have no idea how to kick-off nested WFs dynamically by using wftask... I am going for "Executing an WFT from an External Task".
I think I can keep the parent external task ACTIVE by not calling back to next transition...
I am not sure how to solve my questions (a) and (b)
Thank You ISCBorisB!!! your post changed my mind and now I am going for nested workflows (using wftask) from configurable WFs. So, you say that, depending on the number of locales loop the wftask element, right? I assume that the linking also need to be done the same way. If I am wrong, please let me know. Also, I think I need to use "logical AND" to callback to parent WF while linking tasks.Thanks alot.
/-(wftask[locale1])-\(some_task[start?])-+--(wftask[locale2])--X(AND)->... \-(wftask[locale3])-/