This article explains the functionality of the Map context to order items activity, which allows you to transfer variables from a specific path context to the main order item context in a workflow. This capability is essential for workflows with multiple paths, ensuring that variables generated in one path can be accessed by activities in another path.
Understanding the Importance
In workflows with multiple paths, each path creates its own context. Variables generated within a specific path, such as a filename from an imposition step, are only accessible within that path. This limitation can hinder the use of these variables in subsequent activities that operate at the order level.
For instance, if you have a path named "Poster Cut and Stack Duplex" that generates a plate PDF filename, you may need to use that filename in an SFTP activity or include it in an XML file. However, these activities cannot access variables from the "Poster Cut and Stack Duplex" context, as they only have access to the order item context.
The Map context to order items activity addresses this issue by copying a variable from any context into the order item context, making it available for all subsequent activities in the workflow.
How the Activity Functions
The Map context to order items activity requires two inputs:
Key — This is the name you want the variable to have in the order item context. You can choose any text (e.g.,
file_name).Value — This is the variable you wish to map, selected from the available context at the point where the activity is placed (e.g., the plate PDF from the imposition step).
Once saved, the defined key is added to the order item context, allowing any subsequent activity in the workflow to look up and utilize that key's value.
Step-by-Step Instructions
In the workflow builder, position the Map context to order items activity where the variable you need is available, typically right after the activity that generates it.
In the activity configuration, enter a Key. Choose a descriptive name for easy identification later (e.g.,
plate_pdf_filename).In the Value field, select the variable you want to map using the context picker to browse available variables.
Save the activity.
In any subsequent activity, open the order item context and search for the key you defined. The mapped value will be available for use as an input.
Practical Example
Consider a workflow with an imposition path that generates a file named plate.pdf. Later, an SFTP activity requires the filename to construct the upload path, but since SFTP operates at the order level, it cannot directly access the imposition path's context.
Solution:
Place the Map context to order items activity immediately after the imposition activity.
Key:
file_nameValue:
[plate PDF](selected from the imposition path context)
Now, when configuring the SFTP activity, you can open the order item context, search for file_name, and select it. The SFTP activity will receive the correct filename at runtime, even though it was generated in a different path. This mapped value can be reused by any number of downstream activities without needing to repeat the mapping.
Key Considerations
Placement is crucial. Ensure the Map context to order items activity is positioned after the activity that produces the value you want to map; otherwise, the mapping will be empty.
Case sensitivity matters. When searching for a mapped key in downstream activities, use the exact key name you entered (e.g.,
file_nameis not the same asFile_Name).One key per instance. Each Map context to order items activity maps a single key-value pair. To map multiple variables, add multiple instances of the activity.
Fixed value at mapping time. The value is captured when the activity runs; if the source variable changes later, the mapped copy does not update automatically.
Advanced feature. This activity is most beneficial in workflows with branching paths and cross-context dependencies; it may not be necessary for simple single-path workflows.
Common Use Cases
Making an imposition-generated filename available to an SFTP upload activity.
Passing a computed value from a path-specific step into an XML or JSON generation activity at the order level.
Surfacing a path-specific reference ID or asset URL for use in a print operator console notification.
Sharing any variable produced inside a named path with all remaining activities in the workflow.
Video:
