How startPhase is currently implemented
- startPhase is configured in composition definition element and defines the order of execution of instance elements;
- Any instance element is executed only once;
- All instance elements whit same startPhase are executed at same time in parallel;
- startPhase is used by deploy and unlock; startPhase in reverse order is used by lock, undeploy and delete;
Example using the Demo. The table below shows the startPhase for each Composition Definition Element
...
The diagram below shows the flow of messages:Note:
- startPhase is configured in composition definition element and defines the order of execution of instance elements;
- Any instance element is executed only once;
- All instance elements whit same startPhase are executed at same time in parallel;
- startPhase is used by deploy and unlock; startPhase in reverse order is used by lock, undeploy and delete;
Alternative flow with "stage"
...
- Still valid the startPhase definition for backward compatibility;
- Using startPhase and stage in a composition definition is not valid;
- stage is configured in composition definition element;
- Any composition definition element could have different sptePhase stage for each operation: for example the order for deploy could different for migrate;
- Any instance element could be executed more then one time;
- All instance elements whit same stage are executed at same time in parallel;
- stage has not reversal order.
...
Code Block | ||
---|---|---|
| ||
properties: stage: - deploy: [0,1] - migrate: [0,2] - update: [0] - undeploy: [10] - delete: [10] |
All not defined operations will be set to 0.
...
Code Block | ||
---|---|---|
| ||
/** * Handle an update on a automation composition element. * * @param compositionElement the information of the Automation Composition Definition Element * @param compositionElementTarget the information of the Automation Composition Definition Element Target * @param instanceElement the information of the Automation Composition Instance Element * @param instanceElementMigrate the information of the Automation Composition Instance Element updated * @param stage the stage to perform * @throws PfModelException from Policy framework */ void migrate(CompositionElementDto compositionElement, CompositionElementDto compositionElementTarget, InstanceElementDto instanceElement, InstanceElementDto instanceElementMigrate, Integer stage) throws PfModelException; |
Note: instanceElement will contain the old properties only in the first call, if required we can implement old properties for each stage.
When an instance element has completed a stepstage, not means that the full implementation execution is completed (DEPLOYED state).
...
Code Block | ||
---|---|---|
| ||
/** * Update the stage of a automation composition element. * * @param automationCompositionIdinstanceId the ID of the automation composition to update the state on * @param elementId the ID of the automation composition element to update the state on * @param stateChangeResult the indicator if error occurs * @param nextStage the next stage to do * @param message the message */ void updateAutomationCompositionElementStage(UUID automationCompositionIdinstanceId, UUID elementId, StateChangeResult stateChangeResult, Integer nextStage, String message); |
...
Code Block | ||
---|---|---|
| ||
"709c62b3-8918-41b9-a747-d21eb79c6c23": { "id": "709c62b3-8918-41b9-a747-d21eb79c6c23", "definition": { "name": "onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElementSefAutomationCompositionElement", "version": "1.2.3" }, "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c91", "deployState": "DEPLOYINGMIGRATING", "stage": 12, "lockState": "NONELOCKED", "description": "SinkSef Automation Composition Element for the Demo", "message": "Stage 0 completed", |