Math Update

MathUpdate is a unique operation that allows a math variable to update a policy or segment field value held in memory when an activity processes. It resides inside transaction math much like MathIF and MathLoop. This math variable is similar to the CopyToPolicyFields or CopyToSegmentFields attached rules, except that it does not actually update database values.

The MathUpdate element in transaction math indicates an activity that processes projections. The actual results of projection processing are maintained in memory only, and no database contents are modified.

MathUpdate leverages the input context for activity processing. This input context is also used by CopyTo rules to retrieve the original values of fields. A CopyTo will not create an update for the field if the newValue and the oldValue are equal.

If MathUpdate updates a field which is also a target in a CopyTo, MathUpdate needs to set the original value in the input context before math processing completes.

Important: It is not recommended to use MathUpdate on transactions that have attached business rules. Using MathUpdate with attached business rules can affect data persisted in the database.

Math Update Math Variable in Palette Window

Math Update Math Variable in Palette

Define the Math Update Math Variable

Drag and drop the Math Update math variable from the Palette window onto the Math Pane. Enter the following information for the math variable.

  • Type a field name in the FieldName field. This is the name of the table Field to update in memory. This is required.

  • Select a Type from the Type drop down box. The type identifies the source table of the record type to update. The available options are: POLICYFIELD, SEGMENTFIELD or SEGMENTFIELDCOLLECTION. SegmentFieldCollection updates the named Segment field records with the collection values. This is required.

  • Type the Segment field name in the Segment field. This field is only available if Type=SEGMENTFIELD. The Segment field name appears in the XMLas the value of the SEGMENTGUID attribute.

  • Type the name of the math variable that will be used to update the field name defined in the FieldName box above. This is required. This will be an auto complete field consisting of all the configured math variables in the transaction defined before the MathUpdate plus empty for an initial value. The field will be saved in the XML as the value of the MathUpdate element.

Note: The Debugger does not display the values of MathUpdate variables or the field itself.

Check-in the transaction to save the information to the database.