This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.
Implementation - SmartObject method
The following steps show how to set up the Plan per slot (no destinations) planning option in order to return a list from a SmartObject:
- Create a SmartObject containing the list you want to use. The use of a SmartObject GetList method allows the Plan per slot (no destinations) planning option to create an activity destination instance for each record in the list (in other words each event in the activity will execute the number of times there are records).
- Open the activity’s Destination Rule, click Back and select Advanced Mode.
- Click Next and select Plan per slot (no destinations).
- Click Next.
- Select the last option (Select a list field to determine how many slots should be created)
- Drag the ID of your GetList method into the field.
In runtime, it will create an activity destination instance for each record in the list (in other words each event in the activity will execute the number of times there are records)
Each SmartObject record’s ID will be stored in the Workflow Context field ActivityDestinationInstance_InstanceData which can be used in a Load or Update method.
When using the Plan per slot (no destinations) planning option, make sure to add a Succeeding Rule stating [ActivityDestinationInstance_Status] All = “Completed”
Implementation - XML
When only using one property from the group, the same method applies as per the above SmartObject method implementation.
The following steps show how to set up the Plan per slot (no destinations) planning option in order to return a list from an XML repeating group node to have access to all properties in the group:
- Follow the steps as per above up to step 6.
- Drag the repeating group node into the Plan per slot (no destinations) planning option (not any of the properties, the main repeating group node). This will cause the InstanceData to contain something like “<repeating><property1>val1</property1><property2>val2</property2> etc… </repeating>” at runtime.
- Create an Activity level XML Field (not shared), that contains a group node (not repeating) with the same name, structure and properties as the main XML Field you are working from.
- Add a Data Event to the activity, select the Transfer Data option and click Assign. Drag an Expression from the Function browser into the source.
- Create a string Data Field with an initial value of <XmlDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">. A string Data Field is used as typing this value into the expression will cause a validation error.
- Drag this Data Field into the Expression, then add a “&” (without quotes), drop the ActivityInstanceDestination_InstanceData field, and add another “&” (without quotes) and then type “</XmlDocument>” (with quotes)
- Finish the expression
- Drag the entire Activity level XML Field as created above, into the destination field on the Assign Mapping.
- Now you have each repeated node inside a non repeating structure where you can use each property from the activity level XML Field individually.
The above implementation is only for illustration purposes and will differ for other scenarios.