Expand my Community achievements bar.

Form Server Render Form Problem

Avatar

Former Community Member
Hi,



I want to create multiple instances of a table row inside the workflow, so I wrote a script inside the form:ready event of my table row. The script adds new instances using the NumberOfRows variable which stands in my xml schema and I set it inside the workflow using setvalue qpac. After these, I am using the form server render qpac to be able to run the script and have multiple rows in the form before it reaches to any user.



There is no problem untill here. Everything goes well and I successed all. However, when I try to fill in one of the rows that I have newly created, I get a stalled action :) and many error message.



I used this expression in setvalue qpac to set newly created row :



/process_data/formvar/form-data/data/xdp/datasets/data/SATalepFormu/DetayliAciklama/UrunBilgileri[2]/Urun



This is the error :



ERROR [com.adobe.workflow.AWS] stalling action-instance: 1099 with message: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.

at org.apache.xerces.dom.CoreDocumentImpl.createElement(Unknown Source)

at com.adobe.workflow.datatype.xml.XMLDataTypeNode.newElement(XMLDataTypeNode.java:53)

at com.adobe.workflow.dom.InstanceElement.createAndAppendElement(InstanceElement.java:246)

at com.adobe.workflow.pat.service.PATExecutionContextImpl.createNodesForXPathExpression(PATExecutionContextImpl.java:906)

at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataValue(PATExecutionContextImpl.java:697)

at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataWithExpression(PATExecutionContextImpl.java:429)

at com.adobe.workflow.qpac.set_value.SetValueService.execute(SetValueService.java:72)

at com.adobe.workflow.engine.PEUtil.executeAction(PEUtil.java:184)

at com.adobe.workflow.engine.ProcessEngineBMTBean.continueBranchAtAction(ProcessEngineBMTBean.java:2371)

at com.adobe.workflow.engine.ProcessEngineBMTBean.asyncInvokeProcessCommand(ProcessEngineBMTBean.java:512)

.......



It became a long message but I wait for your replies:)

...
5 Replies

Avatar

Former Community Member
I also wanted to add that when I use the same script in the click event of a button and create multiple instances by opening and using the form inside the form manager, I can achieve to set values of newly created rows inside the workflow then. The problem occurs when the form rendered by the fsrf qpac.



Is it possible the problem occurs because the fsrf qpac does not accept xdp for transformation type that we fill in Form Preference field? I wrote "PDFForm" into this field because of that.

Avatar

Level 9
Hi Guvenc



The SetValue QPAC does not allow you to use predicates (i.e. square brackets) on the left hand side of an assignment.

In other words:

/process_data/@myvalue = /process_data/myxml/root/repeat[3]/name

is okay, but

/process_data/myxml/root/repeat[3]/name = /process_data/@myvalue

is not okay.



There are actually some good reasons for this behaviour - Xpath is a way of retrieving data, not creating it - this is actually very unfortunate, because it would be very helpful, as you've found. (There are some interesting technical problems around using XPath to create xml, such as: what should it do if /repeat[1] and repeat[2] don't exist?)



One way to work around this is to create the entire xml document in a string or XML variable, and then assign the entire thing to the root node of your form. You may have to mess with the syntax a bit (I haven't verified that this expression is exactly correct), but it would be something like:

/process_data/formvar/form-data/data/xdp/datasets/data =

deserialize(/process_data/@xml_as_a_string)



We have a SetText QPAC which makes it a little easier to construct a large xml file as a string like this (with embedded xpath expressions), but you can also create it by using SetValue and the Xpath concatenate() function.

You can downlaod SetText from:

http://www.avoka.com/avoka/qpac_library.shtml



Depending what you're trying to do, you could also write a custom QPAC (once you have a DOM, you can do whatever you need to), or we would be happy to write one for you.



Good luck...

Howard

http://www.avoka.com

Avatar

Former Community Member
Thanks Howard,

You are right. I can't assign values because repeated fields even don't exist. Your advise seems a little challenging, but I'll give a try :)

Avatar

Level 9
If you have difficulties, reply to this forum, or email us directly at info@avoka.com.

Howard

Avatar

Former Community Member
I tried the method with a complete instance xml file, but I think I couldn't achieve to use deserialize function correctly. I get a ClassCastException :<br /><br />ERROR [com.adobe.workflow.AWS] stalling action-instance: 1246 with message: java.lang.ClassCastException<br /> at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataValue(PATExecutionContextImpl.java:723)<br /> at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataWithExpression(PATExecutionContextImpl.java:429)<br /> at com.adobe.workflow.qpac.set_value.SetValueService.execute(SetValueService.java:72)<br /> at com.adobe.workflow.engine.PEUtil.executeAction(PEUtil.java:184)<br /> at com.adobe.workflow.engine.ProcessEngineBMTBean.continueBranchAtAction(ProcessEngineBMTBean.java:2371) .........<br /><br />My xml text is like :<br /><br />" <?xml version='1.0' encoding='UTF-8' ?> <br /><SATalepFormu > <FormBilgileri> .......<br />... </FormBilgileri> </SATalepFormu> "<br /><br />I set this text to a variable /process_data/@xmlstring ,<br />and my setValue expression is like :<br />/process_data/fromvar/form-data/data/xdp/datasets/data = deserialize(/process_data/@xmlstring)