I am trying to add a newly created dcr file using external task (ipl) into workflow task. And it just doesn’t work. But I could add the newly created file to the task using edit task/add file.
Any help appreciated
Workflow:
------------
<externaltask name="CreateFile"
owner="__TAG__('iw_user');"
description="Tester Ex"
start="t">
<areavpath v="/default/main/STAGING"/>
<successors>
<successorset description="Done">
<succ v="GetFileList"/>
</successorset>
</successors>
<command v="/space/iw-home/httpd/iw-bin/create_file.ipl"/>
</externaltask>
create_file.ip l:-
----------------
($wfid, $taskid, $area) = (
@ARGV[0..2]);
$job = new TeamSite::WFworkflow($wfid);
my ($this_task) = new TeamSite::WFtask($taskid);
my $CreateFile = $workArea . "/templatedata/demo/details/data/details304";
open(CFILE,">$CreateFile") || die $!;
print CFILE "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
print CFILE "<!DOCTYPE record SYSTEM \"dcr4.5.dtd\">\n";
print CFILE "<record name=\"details$current_count\" type=\"content\">";
close CFILE;
my $attrCommand = "/space/iw-home/bin/iwextattr -s TeamSite/Templating/DCR/Type=demo/details " . $CreateFile;
my $returncode = system($attrCommand);
my $returncodeforAdd = $this_task->AddFile("$CreateFile", "comment");