I want to pass the user selected values from CGI task to Workflow.Can any one help me in this.And also can we get the variable (Environment) from the workflow to CGI task by using following line. If so please let me know how to retrive in the CGI task. wfvarstartop op="set" name="Environment" value="Development" Thanks in Advance
I want to pass the user selected values from CGI task to Workflow.Can any one help me in this.
And also can we get the variable (Environment) from the workflow to CGI task by using following line. If so please let me know how to retrive in the CGI task. wfvarstartop op="set" name="Environment" value="Development" Thanks in Advance
it can be done by setting the workflow variable within your CGI script. You have to create a WfObject using the job id being passed as default param to CGI task froma workflow.my $jobObj = TeamSite::WFworkflow->new($jobid);$jobObj->SetVariable("environment", "development");
use TeamSite::CGI_lite; use TeamSite::WFtask; use TeamSite::WFworkflow; ... [do stuff] ... my $cgi = TeamSite::CGI_lite->new(); $cgi->parse_data(); my $taskid = $cgi->{form}{iw_taskid} || $cgi->{form}{task_id}; $taskid = $$taskid[0] if (ref($taskid) eq "ARRAY"); my $task = TeamSite::WFtask->new($taskid);if (! $task->IsValid()){# error handling goes here} my @files = $task->GetFiles();# specific addition for this postingmy $jobid = $task->GetWorkflowId();my $job = TeamSite::WFworkflow->new($jobid); if (! $job->IsValid()) { # error handling goes here}... [do stuff] ... $task->CallBack(0, "Rejected Generated HTML File"); print join("", "<script language='JavaScript'>", "if (opener.top.Ctl) { opener.top.Ctl.pw_refresh(); }", "else { opener.location.reload(); }", "window.close();", "</script>");
It is also be done using job Object and its GetVariable method.$myValue = $jobObj->GetVariable("Environment");Having said this.... still read on more for Wft Developers Guide.