This group of tasks covers two data structures - Dictionary and List - along with the tasks that let a Business Process create, read, update, and inspect them while it runs.
- A Dictionary is a key/value store. Each entry has a unique String key mapped to a value of any type. Use it when you need to look something up by name or code - vendor IDs, currency mappings, UOM conversions, error messages keyed by field name.
- A List is an ordered, indexed collection. Use it when order matters or when you're accumulating items as you go - a batch of records to process, a running set of validation errors, a queue of output documents.
The tasks include:
| Dictionary | List |
|---|---|
| Create, Get, Put, Remove, Has Key, Keys, Values, Size | Create, Get, Add, Remove, First, Last, Size |
General reasons to use Collections tasks
-
In-memory lookups instead of repeated queries. Rather than querying a database or re-scanning a source file every time you need a reference value, you load it once into a Dictionary at the start of the BP and do fast key-based lookups (
Has Key,Get) for the rest of the run. This is the single most common use case in integration BPs — mapping trading partner codes, account numbers, or product IDs to internal equivalents. -
Accumulating results across a loop. Lists are the natural place to collect things a BP encounters while iterating — validation errors, matched records, generated output filenames — so you can act on the full set after the loop finishes (e.g. checking
List - Sizeto decide whether to send an exception alert). - Dynamic data whose shape isn't known up front. Unlike fixed BP variables, Dictionaries and Lists can grow or shrink at runtime, which is essential when a BP is processing a variable number of trading partner documents, line items, or API response records.
- Passing structured data between BP steps or subprocesses. A Dictionary is a convenient way to bundle several related values (e.g. a parsed header record) into one object that can be passed around instead of tracking many individual variables.
Practical tips
-
Putoverwrites silently if the key already exists — useful for upserts, but worth guarding withHas Keyif you want to detect duplicates rather than clobber them. - Always initialize with
Createbefore the firstPut/Add— these tasks add to or read from an existing collection, they don't implicitly create one. -
Get/First/Laston an empty or missing entry will typically cause a runtime error, so pair them withSizeorHas Keychecks in branching logic rather than assuming the item exists. - Dictionary keys are always Strings — if your lookup key is numeric (e.g. an account number), remember it'll be compared as a string, so formatting/leading zeros matter.
- These tasks are almost always used together with looping tasks and decision/branch tasks elsewhere in the BP — Collections tasks themselves don't iterate or branch, they just store and retrieve.
Use Case
See this Collection BP Tasks Use Case for an example of the Collection tasks in use.
Tasks
Dictionary - Create
This task initializes a variable or parameter of type Dictionary as an empty Dictionary.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Dictionary | Dictionary | The resulting Dictionary. | Yes |
Dictionary - Get
This task gets an item in the dictionary with a specified key.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Result | Any | The item that was retrieved. | Yes |
| Dictionary | Any extends Dictionary | The dictionary that an item will be retrieved from. | Yes |
| Key | String | The key of the item in the dictionary. | Yes |
Dictionary - Has Key
This task returns a boolean indicating whether or not an entry with the specified key exists in the dictionary.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Dictionary | Any extends Dictionary | The dictionary to be checked for a specified key. | Yes |
| Key | String | The key that will be checked. | Yes |
| Result | Boolean | The result indicating whether or not an entry with the specified key was found. | Yes |
Dictionary - Keys
This task returns a list containing all keys in the dictionary.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Result | List | A list of all keys in the dictionary. | Yes |
| Dictionary | Any extends Dictionary | The source dictionary. | Yes |
Dictionary - Values
This task returns a list containing all values in the dictionary.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Result | List | A list of all values in the dictionary. | Yes |
| Dictionary | Any extends Dictionary | The source dictionary. | Yes |
Dictionary - Put
This task puts a new entry in the dictionary with the specified key.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Dictionary | Any extends Dictionary | The dictionary that the new entry will be added to. | Yes |
| Key | String | The key of the new entry that will be added to the dictionary. | Yes |
| Entry | Any | The value of the new entry that will be added to the dictionary. | Yes |
Dictionary - Remove
This task removes an entry from the dictionary with the specified key.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Dictionary | Any extends Dictionary | The dictionary that the entry will be removed from. | Yes |
| Key | string | The key of the entry to remove from the dictionary. | Yes |
Dictionary - Size
This task returns the number of entries in the dictionary.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Result | Long | The number of entries in the dictionary. | Yes |
| Dictionary | Any extends Dictionary | The dictionary that the number of entries will be counted from. | Yes |
List - Create
This task initializes a variable or parameter of type List as an empty List.
| Parameter | Type | Description | Required |
|---|---|---|---|
| List | List | The resulting list. | Yes |
List - Get
This task gets an item in the list at a specified index.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Result | Any | Output. | Yes |
| List | Any extends list | The list containing the item. | Yes |
| Index | Long | The index of the item to be retrieved. | Yes |
List - Add
This task adds an item to the list.
| Parameter | Type | Description | Required |
|---|---|---|---|
| List | Any extends list | The list to be added to. | Yes |
| Item | Any | The item to be added to the list. | Yes |
List - Remove
This task removes an item from the list at a specified index
| Parameter | Type | Description | Required |
|---|---|---|---|
| List | Any extends list | The list that an item will be removed from. | Yes |
| Index | Any | The index of the item to be removed. | Yes |
List - First
This task gets the first item in the list.
| Parameter | Type | Description | Required |
|---|---|---|---|
| List | Any extends list | The list that the first item will be retrieved from. | Yes |
| Result | Any | The first item in the list. | Yes |
List - Last
This task gets the last item in the list.
| Parameter | Type | Description | Required |
|---|---|---|---|
| List | Any extends list | The list that the last item will be retrieved from. | Yes |
| Result | Any | The last item in the list. | Yes |
List - Size
This task gets the number of items in the list.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Result | Long | The size of the list. | Yes |
| List | Any | The list that the number of items will be counted from. | Yes |
Comments
0 comments
Please sign in to leave a comment.