createPathWithName problem
Posted: Fri May 27, 2011 12:16 pm
Hello,
A few weeks ago I craeated a simple flow of 2 automanaged folders that are linked through a script element wit the following code:
function timerFired( s : Switch, job : Job){
s.setTimerInterval(3000);
var FlowName = s.getFlowName();
var newFile = job.createPathWithName('Switch_dummy_'+FlowName+ '.xml');
LogFile = new File(newFile);
LogFile.open(File.Append);
LogFile.writeLine('<root>');
LogFile.writeLine('<program>Switch</program>');
LogFile.writeLine('<item>'+FlowName+'</item>');
LogFile.writeLine('</root>');
LogFile.close();
job.sendToSingle(newFile);
}
The intention of the flow, is to create a xml file every 5 minutes and output the file to a folder.
The flow wordek perfect, but now I'm ready to deploy and I get the following error:
27-5-2011 10:50:52,Error,SwitchScript0,test,Create_XML_Timer,,Error in line 5 of script : TypeError. Undefined member function 'createPathWithName' for object 'undefined' of type: 'Undefined'
I have tried to add the code s.createNewJob(); after the s.setTimerInterval(3000);, but it does not help.
Can anybody tell me what I am doing wrong?
With kund regards,
Niels
A few weeks ago I craeated a simple flow of 2 automanaged folders that are linked through a script element wit the following code:
function timerFired( s : Switch, job : Job){
s.setTimerInterval(3000);
var FlowName = s.getFlowName();
var newFile = job.createPathWithName('Switch_dummy_'+FlowName+ '.xml');
LogFile = new File(newFile);
LogFile.open(File.Append);
LogFile.writeLine('<root>');
LogFile.writeLine('<program>Switch</program>');
LogFile.writeLine('<item>'+FlowName+'</item>');
LogFile.writeLine('</root>');
LogFile.close();
job.sendToSingle(newFile);
}
The intention of the flow, is to create a xml file every 5 minutes and output the file to a folder.
The flow wordek perfect, but now I'm ready to deploy and I get the following error:
27-5-2011 10:50:52,Error,SwitchScript0,test,Create_XML_Timer,,Error in line 5 of script : TypeError. Undefined member function 'createPathWithName' for object 'undefined' of type: 'Undefined'
I have tried to add the code s.createNewJob(); after the s.setTimerInterval(3000);, but it does not help.
Can anybody tell me what I am doing wrong?
With kund regards,
Niels