Petals ANT Tasks SNAPSHOT

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (1)

View Page History
</petals-extract-flow-step-info>
{code}

h2. Task {{petals-assert-flow-instance}}

This task applies the given assertions as nested elements to the given flow instance previously read MONIT traces. This task is used in association with the task '{{petals-monit-read-logfiles}}' to load MONIT traces.

|| Attribute || Description || Default ||Required ? ||
| refid | Reference name of the internal object associated to MONIT traces loaded. | - | Yes |
| flowInstanceId | The flow instance identifier on which the given assertions must be validated | - | Yes |

h3. Nested elements

h4. Assertions to apply on a flow step of the flow instance: {{assertFlowStep}}

For the flow step identified by its index '{{flowStepIdx}}'' in the given flow instance:
* the assertions given as nested elements will be executed,
* and, if needed, information can be extracted using '{{flowStepInfo}}'.

Available assertions on a flow step are relative to its attributes:
* '{{attributeEquals}}': the actual value of the property identifier by '{{name}}' must be equals to the value given by '{{value}}',
* '{{attributeSet}}': the flow step must contain a property named '{{name}}'.
By default, assertion operates on attributes available on the beginning MONIT traces. Using '{{onEnd="true"}}" will force to use properties of the ending MONIT traces.

Extracted information from a flow step assertion block are available for next flow step assertion blocks.

h4. Flow step information extracted: {{flowStepInfo}}

The property given by its name '{{name}}' is retrieve from the flow step and put into the property with the given name '{{property}}.

h3. Example

{code}
<petals-monit-read-logfiles id="flows" dir="${petals.home}/logs/flow-monitoring" />
<petals-assert-flow-instance refid="flows" flowInstanceId="${process-instance-flow-instance-id}">
<assertFlowStep flowStepIdx="0">
<attributeEquals name="traceCode" value="consumeFlowStepBegin" />
<attributeEquals name="correlatedFlowInstanceId" value="${initial-flow-instance-id}" />
<attributeEquals name="correlatedFlowStepId" value="${initial-flow-step-id}" />
<attributeEquals name="processDefinition" value="vacationRequest" />
<attributeSet name="processInstanceId" />
<flowStepInfo attribute="flowStepId" property="flowStep.0.id" />
</assertFlowStep>
<assertFlowStep flowStepIdx="1">
<attributeEquals name="traceCode" value="provideFlowStepBegin" />
<attributeEquals name="flowStepInterfaceName" value="{http://petals.ow2.org/samples/se-bpmn/notifyVacationService}notifyVacation" />
<attributeEquals name="flowStepServiceName" value="{http://petals.ow2.org/samples/se-bpmn/notifyVacationService}notifyVacationService" />
<attributeEquals name="flowStepOperationName" value="{http://petals.ow2.org/samples/se-bpmn/notifyVacationService}newVacationRequest" />
<attributeSet name="flowStepEndpointName" />
<attributeEquals name="flowPreviousStepId" value="${flowStep.0.id}" />
</assertFlowStep>
<assertFlowStep flowStepIdx="3">
<attributeEquals name="traceCode" value="provideFlowStepBegin" />
<attributeEquals name="flowPreviousStepId" value="${flowStep.0.id}" />
<attributeEquals name="taskDefinition" value="handleVacationRequest" />
<attributeEquals onEnd="true" name="correlatedFlowInstanceId" value="${validation-flow-instance-id}" />
<attributeEquals onEnd="true" name="correlatedFlowStepId" value="${validation-flow-step-id}" />
</assertFlowStep>
</petals-assert-flow-instance>
{code}