BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

Data mapping in IBM Workflow Designer: What’s new and why it matters

By David Chung posted 8 days ago

  

Data mapping is essential for process automation developers, enabling them to map business data across different parts of a process - even when underlying services vary. With the wide range of complex data types used in mapping process flow data within the Workflow Designer, we’ve significantly enhanced both the design and user experience of data mapping. 

These enhancements make mapping simpler through clearer visualization, as well as safer and more efficient. With features like the mapping of child attributes of complex types with automatic parent-structure creation, flexible mapping modes, and real-time validation, the new mapper moves our product closer to a no-code solution and makes data mapping easier for users. 

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.

With the legacy data mapping, assigning a value to a child attribute required ensuring that every parent object in the hierarchy of ancestors has been initialized. In the new data mapper, to provide safety at runtime and to ease the modeling experience, the mapper automatically creates any missing parent structures for the target of the mapping, removing this burden from the user. When mapping a value from an attribute of objects that have not been initialized, a null value will be assigned without a runtime error. You can now map directly from or to a leaf field, and the runtime safely reads values or builds and initializes the entire path leading to the target attribute behind the scenes.

This data mapper provides a clear visual representation of which variables can be mapped, even when working with nested complex variables. These variables can be mapped either at their own level or through their individual child attributes. Complex variables can be expanded or collapsed to show or hide their child attributes.

 

When collapsed, the top-level complex variable displays an icon indicating that attributes are mapped and the counter indicates how many child attributes have mapped values.

Data mapping modes

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

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.

Improved user experience

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.

Tabbed layout (default):

Horizontal layout:

Vertical layout:

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.
The new data mapping also features better validation. Whether if a variable is mapped incorrectly with data type incompatibilities or if a variable is mapped to a non-existent variable, validation will catch any faulty mappings and point the user's attention to it.

Conclusion

The new data mapper offers improved mapping capabilities, safer and more efficient execution, and a more intuitive experience. By reducing the multiple steps previously required in the JavaScript-only approach, it brings IBM Business Automation Workflow and IBM Cloud Pak for Business Automation closer to a no-code solution, making data mapping easier for users.

0 comments
81 views

Permalink