IBM Business Automation Workflow 25.0.1.0 and IBM Cloud Pak for Business Automation 25.0.1 deliver the latest improvements to the data mapper.
Before the introduction of the new data mapper, mapping data was handled through the legacy data mapping, which relied on JavaScript. This legacy mapping was highly restrictive, required variables to be mapped using JavaScript expressions, supported only top-level input or output mappings, and often cluttered the process model because it typically required additional activities or JavaScript tasks. This blog highlights key features and improvements to the data mapping experience in the designer.
Mapping child attributes of complex types
Previously, the mapping of attributes of complex types required writing custom JavaScript outside of the legacy data mapper - typically inside a Script task or a pre/post assignment. If you needed to access a child attribute – for example, the department and date of a requisition, then you had to manually traverse through the entire requisition variable hierarchy in JavaScript. This approach to mapping child attributes was error-prone, inefficient, and it required coding, that could result in mapping errors and wasted time.
The mapping of inputs or outputs can now be performed in one of the three modes: Variable mode, Literal mode, or JavaScript expression mode. Each mode offers its own advantages, giving designers the flexibility to choose the approach that best fits their needs. This also allows users to continue using JavaScript mappings when necessary while exploring the safer, easier, low-code mapping options.
Variable mode (Recommended)
Variable mode allows users to select a variable from a list of all available variables and use it directly for mapping. It serves as the default and primary mapping mode, as it is the simplest and most convenient option, requiring no manual typing. With just two clicks, mappings can be completed effortlessly. Variable mode has a large advantage in terms of safety of access at runtime over the other modes when working with attributes, especially within nested business objects. This mapping mode ensures type compatibility and prevents referencing invalid fields for selection, which removes the risk of common JavaScript mistakes such as typos and referencing non-existent fields, or finding out at runtime that parent object is undefined, which would result in script errors.
Literal mode
Literal mode allows users to enter specific values for their variables instead of referencing other variables. This mode is available for input variables or their attributes that are of primitive simple types – such as strings or dates. It is the perfect and most straightforward mapping mode for simple data types, and it’s commonly used to assign constants.
JavaScript expression mode was originally used in the legacy data mapper. It’s an option for advanced users comfortable with JavaScript expressions and syntax. It is less preferred for mappings where Variable or Literal mode could be used instead. JavaScript mode doesn’t offer the same level of efficiency or ease of use as Variable or Literal mode. This mapping mode offers complete freedom to manipulate data however needed, but this flexibility comes with some trade-offs, including a higher risk of runtime errors, increased maintenance effort, and performance impact.
The data mapping experience is more intuitive than ever before. Variables are displayed in rows with their respective variable names, variable types, mapping values, and selected mapping modes prominently indicated.
The layout of the data mapper is now customizable and comes in three different options: Tabbed layout, Horizontal layout, and Vertical layout so that we can choose how we want to customize the data mapper view for our needs.
The data mapping preview provides a quick read-only overview of mapped variables inside the property sheet positioned below a diagram which provides easy access and eliminates the need of having to open the data mappings dialog. The preview displays inputs and outputs of an activity, their names and types with the ability to expand to reveal their attributes, and defined mappings all in one place.