Table of Contents

Search

  1. Preface
  2. Introduction to Data Transformation
  3. Data Processor Transformation
  4. Wizard Input and Output Formats
  5. Relational Input and Output
  6. XMap
  7. Libraries
  8. Schema Object
  9. Command Line Interface
  10. Scripts
  11. Parsers
  12. Script Ports
  13. Document Processors
  14. Formats
  15. Data Holders
  16. Anchors
  17. Transformers
  18. Actions
  19. Serializers
  20. Mappers
  21. Locators, Keys, and Indexing
  22. Streamers
  23. Validators, Notifications, and Failure Handling
  24. Validation Rules
  25. Custom Script Components

Data Transformation User Guide

Data Transformation User Guide

CalculateValue

CalculateValue

Calculates numerical values or concatenates string values.
To calculate numeric values, use the following operators between parameters:
  • +
  • -
  • *
  • /
You can use parentheses to clarify the numeric expression. You can use variables of the following data types:
  • xs:anyType
  • xs:anySimpleType
  • numeric data types
  • string data types
If the parameters are all numeric data types or numeric strings, CalculateValue performs an arithmetic calculation. Non-integer results are rounded to 14 decimal places.
To concatenate strings, use the plus sign (+) operator between parameters and strings.
The following table describes the properties of the
CalculateValue
action:
Property
Description
disabled
Determines whether the Script ignores the component and all of the child components. Use this property to test, debug, and modify a Script. You can choose one of the following options:
  • Selected. The Script ignores the component.
  • Cleared. The Script applies the component.
The default is cleared.
expression
Defines a JavaScript expression. To represent an input parameter, use a dollar sign ($) followed by an integer. To represent a string, enclose it in single quote marks.
failure_action
Determines the behavior in the event of failure. You can choose one of the following options:
  • Ignore. The transformation continues.
  • HaltExecution. The transformation stops.
Default is Ignore.
name
A descriptive label for the component. This label appears in the log file and the
Events
view. Use the
name
property to identify the component that caused the event.
on_fail
The action to take if the component fails. You can choose one of the following options:
  • Cleared. Take no action.
  • CustomLog. Write to the user log.
  • LogError. Write an error message to the engine log.
  • LogInfo. Write an information message to the engine log.
  • LogWarning. Write a warning message to the engine log.
  • NotifyFailure. Send a notification.
Default is cleared. For more information about handling component failures, see Failure Handling.
optional
Determines whether a component failure causes the parent component to fail. You can choose one of the following options:
  • Selected. Component failure does not cause the parent component to fail.
  • Cleared. Component failure causes the parent component to fail.
Default is cleared. For more information about component failure, see Failure Handling.
params
Defines a list of data holders that contain the input parameters.
phase
Determines when the Script processes the component. You can choose one of the following options:
  • initial. The Script processes the component during the initial phase.
  • main. The Script processes the component during the main phase.
  • final. The Script processes the component during the final phase.
For more information, see How a Parser Searches for Anchors.
Default is main.
remark
A user-defined comment that describes the purpose or action of the component.
result
Determines a data holder that stores the output.
For more information about the JavaScript syntax that the Data Processor transformation supports, see EnsureCondition. For more information about the precision of
xs:decimal
and
xs:float
values, see Precision of Numerical Data.