Consumption Analytics Documentation

Home > Documentation for older versions > Cloud Cruiser 3 > Batch XML Reference > Transform processors > CalculateResource


Table of contents
No headers

Creates a new resource calculated from existing resource values. Any resource already in the record can be used in a free form algebraic expression to compute a value for the target resource. If the target resource already exists, then it will be updated with the calculated value. For more information on expression syntax and supported variables, see Expression parser.

Resources that are charged for based on state can be computed for a particular state. Since state is an identifier on the record, a state conflict is resolved by creating a new record with all identifiers from the old record except for state, then adding the target resource with the calculation result and the target state to the new record.


<bean class="com.cloudcruiser.batch.transform.CalculateResource">


<property name="expression" value="expression" />

Sets an algebraic expression using resource names as variables where needed. Use parenthesis for explicit order of operations.

<property name="targetResource" value="targetResource" />

Sets a resource Id that will have its value set from the result.

<property name="targetState" value="targetState" />

(Optional) Sets a resource state for the target resource. This might result in a cloned record (identifiers only) in order to add the resource when another state is already defined.

Spring Batch XML Example

<batch:step id="transform" next="charge">
    <bean class="com.cloudcruiser.batch.CCRecordTransformTasklet">
      <property name="processors">
          <bean class="com.cloudcruiser.batch.transform.CalculateResource">
            <property name="active" value="true" />
            <property name="targetResource" value="IPSpaceNumAddress" />
            <property name="expression" value="(2^(32 - IPSpaceCidrMask)) - 2" />
Last modified


This page has no custom tags.


This page has no classifications.

 (c) Copyright 2017-2020 Hewlett Packard Enterprise Development LP