Home > Cloud Cruiser 3 > Batch XML Reference > Filters > ResourceBooleanExpression

ResourceBooleanExpression

Table of contents
No headers

Filter condition that evaluates a boolean expression per record after substituting resource values to resolve resource names as expression variables. Algebraic notation can be included, but the expression must evaluate to a boolean result. Use parenthesis for explicit order of operations.

Class

<bean class=”com.cloudcruiser.batch.filter.ResourceBooleanExpression”>

Properties

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

Specifies that the processor only processes records if the Boolean expression is using resource names as variables.

Spring Batch XML Example

<batch:step id="transform" next="charge">
  <batch:tasklet>
    <bean class="com.cloudcruiser.batch.CCRecordTransformTasklet">
      <property name="processors">
        <list>
          <bean class="com.cloudcruiser.batch.transform.CreateResourceFromConstant">
            <property name="filter">
              <bean class="com.cloudcruiser.batch.filter.ResourceBooleanExpression">
                <property name="expression" value="cpuCount &lt;= 1" />
              </bean>
            </property>
            <property name="targetResource" value="1CPU" />
            <property name="constantValue" value="1" />
          </bean>
          <bean class="com.cloudcruiser.batch.transform.CreateResourceFromConstant">
            <property name="filter">
              <bean class="com.cloudcruiser.batch.filter.ResourceBooleanExpression">
                <property name="expression" value="memory &gt; 1024 &amp;&amp; memory &lt;= 2048" />
              </bean>
            </property>
            <property name="targetResource" value="2GBRAM" />
            <property name="constantValue" value="1" />
          </bean>
        </list>
      </property>
    </bean>
  </batch:tasklet>
</batch:step>
Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP