Posts tagged "script"

LiveCycle ES: Namespace problems in SetValue and Script services

Issue

When working with namespaces in the SetValue and Script objects in LC7, you may receive an error saying the “path” is unreachable, or similar errors pointing to problems in the expressions, after migrating to LC ES.

Reason

These errors can occur in LC ES when using namespaces such as in the following example:

LiveCycle ES now validates XPath expressions more strictly than it did in LiveCycle 7.  LC ES requires you to define the namespaces in the process, whereas Lc7 did not have this requirement.

Solution

Adding the namespace to the process properties will fix the issue.  You only need to add these namespaces once for each process, and all the Script and SetValue activities in that process will be able to reference those namespaces.

To add the namespaces:

Open the process properties and go to the Advanced > Registered Prefixes for Namespaces used in XPaths and enter the prefix (i.e. soap), and the namespace (i.e. “http://schemas.xmlsoap.org/soap/envelope/“).

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)

LiveCycle ES: ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.

Issue

When reading XML data into a process variable in LiveCycle ES you may receive the following exception:

Target exception: ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:74)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:69)
at bsh.Interpreter.eval(Interpreter.java:594)
at bsh.Interpreter.eval(Interpreter.java:682)
at bsh.Interpreter.eval(Interpreter.java:672)
at com.adobe.workflow.qpac.script.ScriptService.execute(ScriptService.java:88)

This particular exception occurred using the Script QPAC to read in the XML data using script as follows:

String clean_xml = patExecContext.getProcessDataStringValue("/process_data/myxmlbranch");

clean_xml = clean_xml.replaceAll("(<)","<");

clean_xml = clean_xml.replaceAll("(>)",">");

patExecContext.setProcessDataValue("/process_data/myxmlbranch",clean_xml);

This script works fine in LiveCycle 7, but after upgrading to LiveCycle ES, the script throws the error.

Reason

There are some unexpected characters in the XML data stream.

Solution

In this case there were quotation marks at the start and end of the XML stream.  Such characters were stripped away automatically in LiveCycle 7, but LiveCycle ES is more strict with the format of the incoming  XML.  You must remove the unexpected characters manually and then it will process the XML without problems.

Additional Information

If a LiveCycle 7.x process, that is upgraded to LiveCycle ES, includes the Script QPAC, the Script QPAC may contain script that was developed using the LiveCycle 7.x API. To ensure compatibility with LiveCycle ES, the script may need to be rewritten based on the LiveCycle ES API.

In this case the getProcessDataStringValue() and setProcessDataValue() methods of the patExecContext embedded object are available in ES just as they were in LiveCycle 7 so there were no changes necessary in the script.

reference: (180833653)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)