# Activity Definition¶

## Description¶

The term Activity is derived from the SysML item “Activity” [SysML] where it specifies a transformation of inputs to outputs through a controlled sequence of actions. In the context of MPFO-XML, an Activity defines the sequence of linked actions and/or parallel activity sequences (see also Action Definition). Activities link several operating phases (i.e., Actions) to a sequence or flow.

## Definition of ‘ActivityDefinition’ Element¶

The ActivityDefinition element holds one or more Activity elements.

In case the ActivityDefinition element is not defined in the MPFO-XML document, it is assumed that all defined actions are to be considered independently of their real sequence.

The contents of the ActivityDefinition element can be encrypted using the W3C XML-encryption mechanism [XML-SEC].

## Definition of ‘Activity’ Element¶

The Activity element references a single action.

## Definition of ‘ActivityFlow’ Element¶

The ActivityFlow element defines a sequence of actions by defining a list of previous Action ID references of an Action element in the PreviousAction sub-element.

The creation of an action sequence is accomplished by the following rules:

• If element attribute PreviousActionRef is undefined for an Activity element, the action referenced will then be linked to the implicitly existing START ID action element reference.
• If an action is not referenced as predecessor of another action:
• If the action itself is referencing another action, then it represents the end of an action sequence. It is then linked to the implicitly existing END ID action element reference.
• If the action itself is not referencing another action, then it represents the start and end of an independent action sequence. It is then linked to the implicitly existing START ID and END ID action element references.

This back-reference approach allows the creation of action sequences. Action sequences can be split at an action A if at least two succeeding actions reference to action A. Two or more action sequences can be merged at an action A if action A references actions of preceding action sequences. The latter approach would also allow the creation of action sequence cycles.

## Examples¶

Example 1: Activity Definition

<!-- Component definition as MPFO-XML mission profile document. -->
<MPFo Id="ID.COMPONENT.0">
...
<!-- Component activity definition: sequence of operating phases -->
<ActivityDefinition>
<!-- Define activities -->
<Activities>
<!-- Operating phase 1 -->
<Activity Id="ID.Activity.0">
<ActionSetRef Ref="ID.ActionSet.0"/>
</Activity>
<!-- Start operating phase 2 after operating phase 1 -->
<Activity Id="ID.Activity.1">
<ActionSetRef Ref="ID.ActionSet.1"/>
</Activity>
</Activities>
<!-- Consider operating phase 2 to start after operating phase 1 -->
<ActivityFlows>
<ActivityFlow Id="ID.Activity.Flow.0">
<ActivityRefs>
<ActivityRef Ref="ID.Activity.0"/>
<ActivityRef Ref="ID.Activity.1"/>
</ActivityRefs>
</ActivityFlow>
</ActivityFlows>
<!-- Define a activity flow set -->
<ActivityFlowSets>
<ActivityFlowSet Id="ID.Activity.FlowSet.0">
<References>
<ActivityFlowRef Ref="ID.Activity.Flow.0"/>
</References>
</ActivityFlowSet>
</ActivityFlowSets>
</ActivityDefinition>
...
</MPFo>