Switch scripting basic question

Post Reply
Iede
Newbie
Posts: 2
Joined: Sun Sep 22, 2019 2:25 pm

Switch scripting basic question

Post by Iede »

I want to load an xml dataset from an incomming job where the dataset can be set in a flow element property.

I've added a pdf to the script fixture panel with a metadata datasets value added (this is a xml backing file). Which is an xml file that i've checked in a xml validator, to be sure that it's valid.

It looks like it doesn't get loaded at all. In the logging variable theXML seems to be empty and also the variable dataset is undefined. Did if configure the setup of the incomming job wrong?

Hope someone is willing to help..

The script:


function jobArrived( s : Switch, job : Job )
{
var theXML = s.getPropertyValue('Tag');
job.log(1,"theXML" +theXML);
var dataset = job.getDataset(theXML);
job.log(1,"dataset" +dataset);
var xml = new Document(dataset.getPath());

}

Logging:

22-9-2019 14:42,Info,Scripter control,Test Flow,Script Element,,bestand.pdf,Script evaluation message: End jobArrived entry point with the test fixture
22-9-2019 14:42,Error,,Test Flow,Script Element,00001,bestand.pdf,Error in line 9 of script : Undefined member function 'getPath' for object 'undefined' of type: 'Undefined'
22-9-2019 14:42,Error,Control,,,,,Invalid XML document:
22-9-2019 14:42,Assert,Control,,,,,Libxml error 1549: 'failed to load external entity "" ' in file '' on line 0
22-9-2019 14:42,Assert,Control,,,,,Libxml error 1515: 'Invalid argument' in file '' on line 0
22-9-2019 14:42,Assert,Control,,,,,Libxml error 1515: 'Invalid argument' in file '' on line 0
22-9-2019 14:42,Info,,Test Flow,Script Element,00001,bestand.pdf,datasetundefined
22-9-2019 14:42,Info,,Test Flow,Script Element,00001,bestand.pdf,test
22-9-2019 14:42,Progress,,Test Flow,Script Element,00001,bestand.pdf,Executing jobArrived entry point
Iede
Newbie
Posts: 2
Joined: Sun Sep 22, 2019 2:25 pm

Re: Switch scripting basic question

Post by Iede »

This topic can be closed.

I found it. I forgot to fill in the dataset name in the property value. I thought it was enough to fill in the job 'Metadata datasets' property field under incomming jobs. Learning everyday ;)
Post Reply