5 Replies Latest reply on Mar 11, 2009 9:05 AM by (Yog)

    Script component  set get / ProcessDataValue

      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?


      Target exception: ALC-DSC-119-000: com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object:
        • 1. Re: Script component  set get / ProcessDataValue
          Jasmin Charbonneau Level 4
          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.

          • 2. Re: Script component  set get / ProcessDataValue
            Level 1
            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)

            • 3. Re: Script component  set get / ProcessDataValue
              Level 1
              // 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");
              System.out.println(" TESTING NOW 2");
              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
              • 4. Re: Script component  set get / ProcessDataValue
                Jasmin Charbonneau Level 4
                What is the type of /process_data/testExport in Workbench? Did you create a custom data type called testExport? Or you used Object?

                • 5. Re: Script component  set get / ProcessDataValue
                  Level 1
                  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.


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