Skip to main content


 

Symptoms

 


Having issues with loops and Activity Destination Instance Data
 

 

Diagnoses

 


We have a WF that retrieves data from a SmartObject into a XML process field with repeating nodes. I then go to an activity which is setup to loop through all the nodes in the XML process field and fire an event for each loop.

In the loop activity, i set the plan per slot (no destinations) option and it creates the _ of slots based on repeating xml node

In the past I create an IPC event in this activity and pass the Activity Destination Instance -> Instance Data to a process XML field in the sub-process. However I don't want to use an IPC event and see on your documentation that you can have it loop without calling an IPC event.

My problem is accessing the single XML node of data while looping in that activity. If I access the XML field, it gives me all nodes, versus the current one it is looping through. I see that the Activity Destination Instance Data field has the current single node of data, however I don't know how to access that as an XML node or map it to an XML field.

I tried a data transfer event, where source is "ActivityInstanceDestInstanceData' (which has the current single XML node) and destination is a XML field I created that matches the schema of a single item.

(This mapping is done automatically using IPC, but I can't figure out how to access this Activity Instance Dest Instance Data within the looping activity.

I have attached the KPRX and screenshots. I see that it basically tries putting the HTML encoded version of the XML node inside my "SingleExtractItem" XML node as shown in screenshot.
 

 

Resolution

We performed the following for the Plan Per Slot loop to work without IPC event:

1. Create a matching activity level XML structure (for the activity implementing Plan Per Slot) in which the repeating node is just a single node this can be done via .XSD manipulation if you had created the original process level XML structure via .XSD this may be as simple as changing the .XSD schema for the repeating node from:

 

 

 

<xs:element minOccurs="1" maxOccurs="unbounded" name="ADDRESSDATA">

to
 

 

<xs:element minOccurs="1" maxOccurs="1" name="ADDRESSDATA">

 


Alternatively, if you generate a sample XML file from the process level XML structure and delete the repeating nodes such that it would only contain one instance of the repeating node then you can use this revised sample XML structure without the repeating node to generate the activity level XML structure.

2. When mapping the ActivityInstanceDestData to the activity level XML structure, if you check the very top node then the data will be properly transferred and the "less than" and "greater than" symbols won't be encoded to "andlt" and "andgt".

If your structure looks like so in the object browser:

1. Process level XML

TestXML
----connect
--------ADDRESSDATA (repeating)
------------Name
------------Address

2. ADDRESSDATA node was selected during the Plan Per Slot to generate the looping/activity instance behavior

3. Activity level XML

TestXML
----connect
--------ADDRESSDATA (non-repeating)
------------Name
------------Address

4. The data transfer event within the Activity that is using Plan Per Slot, will map (ActivityInstanceDestData) ---> (TestXML) node of the activity level XML

 

 



 
Be the first to reply!

Reply