I have a Subprocess that is a Loop type. I am calling a web service within the loop. The data is pulled using a database adapter. One of the data values I am passing to the service is "Furniture & amp; Office Equipment" (title). Ignore the space between the & and amp;, I did that so it posts properly. The input data association is using this XPath Expression:
<v1:ProjectName>", bpmn:getDataObject('inputData')/ns2:projectName, "</v1:ProjectName>
<v1:CostCode>", bpmn:getDataObject('costCodes')/ns:costCodes[bpmn:getActivityInstanceAttribute('SUBPROCESS5114801681331', 'loopCounter')]/ns1:costCode, "</v1:CostCode>
<v1:Title>", bpmn:getDataObject('costCodes')/ns:costCodes[bpmn:getActivityInstanceAttribute('SUBPROCESS5114801681331', 'loopCounter')]/ns1:title, "</v1:Title>
My process is failing when it hits the data containing the title that has the & amp; in it. Can someone suggest how to properly parse this?
I agree and do not really want to use the string concatenation. I am looping through an array in the subProcess. When I use a XSLT transformation in this case how do I have access to the loopCounter? Is there a sample available to show how to do this?
Guessing you probably know this, but you can have an XSLT "for-each" that will iterate through your array.
If this is all you need to do, here's a video that demonstrates how to do this from the XSLT diagram as well as from the source - http://youtu.be/llULUp3B_CU.
Hope this helps,
Yes, I have used the "for each" before but in this case the loop is in the subProcess and my web service call is within the subProcess so I don't want to iterate the array in the XSLT. The Loop Characteristics of the subProcess are: Loop and the loop condition is a simple expression "loopCounter <= costCodes.costCodes.length()". I would like to attach an image of the subProcess but I don't see how to do that. To describe it; for each costCode in the array I want to do a read to see if it exists, if it does, update it, else create it, end.
Edited by: Rudy Meyer on Nov 15, 2012 9:56 AM
I found my SubProcess loop characteristics needs to be defined as "MultiInstance" and NOT "Loop". This way I get a handle to each item in the array. After this I was still not able to assign an XSL transformation to my service call. I ended up creating a re-usable process for the service calls and have a Call activity in the loop to pass the item into it. I was then able to use XSL to call the service. This does not seem correct but it is working.