Translate Data Within an Action
The amps-action-do-translate-data
action allows you to translate the value from variables in the current context. One common use for this action is to translate a large number of status values into a smaller number of states before publishing that information in a message. For example, an order processing system may track a large number of finely-grained status codes, while the reporting view for customers may want to map those status codes to a smaller set of codes such as "pending", "shipped" and "delivered". This action allows you to easily translate those codes within AMPS.
When used to assemble a message, this action provides equivalent results to a set of nested conditional statements in a view projection. However, if you are using actions to parse, assemble and publish messages, this action gives you the ability to change values.
Parameter | Description |
---|---|
| The data to translate. Most often, this is the value of a variable in the current context. |
| The variable to store the translated value in. |
| A translation statement. The translation statement takes the form of This action allows you to provide any number of The action matches the For example, the following translation statement translates a value of There is no default for this option. |
| The default translation. AMPS sets the value of the variable to the contents of this element if no This element is optional. If no |
Last updated