Skip to main content
Business rules are JavaScript functions that allow you to perform transformations and filters on data during the integration.

Transform data

Modify or combine values

Filter data

Remove data from the integration

Business rule structure

Every business rule is a JavaScript arrow function that receives a parameter and returns a value.
The context contains the current data being processed, and the function returns a value that can be used in the integration.

Object reference

Reusable rule

In RWS Integration it is possible to reuse an existing rule.

When to use

  • When the same logic is used in multiple rules
  • To encapsulate very complex logic

How it works

You can use the BusinessRule.transform function to call an existing rule, it works with the following parameters:

Example

To create a reusable rule for price formatting and call it from other rules: Price Formatting Rule (ID: 67f51e19c8a10ceefa121cd2):
Product Rule (calls the formatter):

Auxiliary libraries

RWS provides several JavaScript libraries that you can use in your business rules