I guess I have a similar(maybe different) situation:
I have a form-type process variable FM_1 defined for the workflow WF_1.
In the custom QPAC I created, I want to access this instance of form(FM_1) associated with WF_1. I'd like to find out the FM_1's structure(field names, data types and corresponding values).
Wot Chris sed.
Except the returned object type is: com.adobe.workflow.datatype.form.FormDataTypeInstanceImpl
You can call getXFAData() on this object to get the underlying XML for the form. This in turn should allow you to get at the element names and values. It will not tell you the datatypes - these would be determined by your forms xml schema.
Howard, now I can get this com.adobe.workflow.datatype.form.FormDataTypeInstanceImpl class from adobe-wfk.jar(contained inside LiveCycle.ear). I have further question on this(because I don't think this class is documented anywhere):
FormDataTypeInstanceImpl.getXFAData() returns a byte, I can see the runtime form-type structure/value in a xml-like structure using toString() printout. This is exactly what I need. From this point, can you enlighten me on which package I should use to interpret this byte array? Any special utility class/method in the SDK can help? Or, I need to write code using DOM/SAX API to traverse the xml tree? Please advise.
Once you've got your XML, there are lots of ways you can process it. Usually this mean processing the text using some sort of XML library, such a DOM, JDOM, DOM4J, etc.
Adobe have some static methods in a class called DOMUtils (or DOMUtil, I can't remember) that has a few simple utility methods, but basically, it ends up with a DOM tree that you can traverse. This is also undocumented, but the methods are fairly self-explanatory.
After I processed some of the node values in xml document, I have to pass in the ***whole updated xml content*** by calling public setXFAData(byte xfaData), right? This is the only one I found seems can set value back to workflow.
Is there better way to do it in Workflow SDK? I am afraid this is going to impact the performance. Please advise.
Do you know the default field length output parameter(for String type)?
I tested my customer QPAC which can take input sql string and set output parameter with a string of multiple record(with delimited for fields and records) but run into the length limitation. This exception is showed in the log when I have a string which length is 105. When I have a smaller string it works.
which type of data is more suitable for a longer string datatype in SDK?
2006-10-23 12:54:15,852 ERROR [com.adobe.workflow.AWS] stalling action-instance: 868 with message: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]String or binary data would be truncated.