Highlighted

Script component set get / ProcessDataValue

Avatar

06-03-2009

Inside the script cmponent how can I set and get the process data

which is either Object or custom Object?



I found some info at on these methods

patExecContext.setProcessDataValue(aPath, aVal)(aPath, aVal)patExecContext.getProcessDataValue(aPath)

at http://kb.adobe.com/selfservice/viewContent.do?externalId=kb402587

but it is not working as mentioned but getting error (see below) any clue why?



Thanks

Yog



Target exception: ALC-DSC-119-000: com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object:

Replies

Highlighted

Avatar

Avatar

Jasmin_Charbonn

Avatar

Jasmin_Charbonn

Jasmin_Charbonn

06-03-2009

What variable type are you trying to set?



For example if you want to set a string you can use setProcessDataStringValue(path,value) although setProcessDataValue() should work.



Jasmin
Highlighted

Avatar

06-03-2009

It is the custom veriable type. ( A custom component exports this custom data type note: I can see this variable type while creating new variable so it is visible to LCWB)



Thanks

Yog
Highlighted

Avatar

06-03-2009

// I able to overcome InvalidCoercionException error it was classpath problem but still not able to get it work getting null pointer



// ok here is simple test script TestExport is just plain POJO



import TestExport;

TestExport testExport = new TestExport();

System.out.println(" TESTING NOW 1");

testExport.setName("YYYYYYY");

System.out.println(" TESTING NOW 2");

testExport.setId("IDDDDD");

System.out.println(" TESTING NOW 3");

patExecContext.setProcessDataValue("/process_data/testExport", testExport);



System.out.println(" TESTING NOW 4");



TestExport testExport2 = (TestExport) patExecContext.getProcessDataValue("/process_data/@testExport");



testExport = (TestExport) patExecContext.getProcessDataValue("/process_data/@testExport");



System.out.println(" TESTING NOW 5"); // till here get printed

System.out.println(" testExport2 is here = "+ testExport.getNameID() );// throw null pointer



System.out.println(" testExport2 is here = "+ testExport2.getNameID() );// throw null pointer

System.out.println(" TESTING NOW 6"); does not print this

Avatar

Avatar

Jasmin_Charbonn

Avatar

Jasmin_Charbonn

Jasmin_Charbonn

09-03-2009

What is the type of /process_data/testExport in Workbench? Did you create a custom data type called testExport? Or you used Object?



Jasmin
Highlighted

Avatar

11-03-2009

Hi Jasmin,
The type of /process_data/testExport in Workbench is TestExport, I created a custom data type called TestExport inside package mycommonpackage.
The component that export this datatype has component.xml with export as below.


mycommonpackage


---------
Another related question: when does the custom component start showing up inthe xpath builder under property tab?
Thanks
Yog