Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Priming The CLAMP Automation Composition Runtime Lifecycle Management uses the following system-level dialogues. These dialogues enable the CLAMP runtime capabilities described in Section 2 of TOSCA Defined Automation Compositions: Architecture and Design. Design Time dialogues will be described in future releases of the system.

...

1 Dialogues on Participants

1.1 Register a Participant

...

Participant Registration is performed by a Participant when it starts up. It registers its ID and type the ACM Element Types it supports with the ACM runtime.

PlantUML Macro
@startuml

participant Participant
participant ACM_Runtime
database ACM_Database

Participant -> ACM_Runtime: [ASYNC] Register
ACM_Runtime -> ACM_Database: Create or Update Participant Registration
Participant <-\nand store supported ACM element types
ACM_Runtime -> ACM_RuntimeDatabase: Registration Accepted

loop over all Automation Composition Types
  alt This Automation Composition Type has the Participant Type of this Participant
    Set Participant State as ONLINE
Participant <- ACM_Runtime: Registration Accepted

ACM_Runtime -> ACM_Runtime: TriggerMark Primingall ofACM thisElement Automation Composition Type
  end
endInstances\nrunning on Participant as ONLINE
activate ACM_Runtime
deactivate ACM_Runtime

@enduml

1.2 Deregister a Participant

...

Participant Registration Deregistration is performed by a Participant when it shuts down. It deregisters its ID and type with the ACM runtime. The ACM runtime reprimes any Automation Composition Types that use the participant type of the removed participant because the participants available to the Automation Composition Type  have changed. It also triggers supervision of any AC instances using this particular participant so that the instance can be moved to another participant or can be marked as errored

The participant should already have cleared down all its ACM Element instances and set their states to "Not In Service".


PlantUML Macro
@startuml

participant Participant
participant ACM_Runtime
database ACM_Database

Participant -> ACM_Runtime: Participant: Uninitialize all ACM Element Instances running on Participant\n(See Instantiation Dialogues)
activate Participant
deactivate Participant

Participant -> ACM_Runtime: [ASYNC] Deregister
ACM_Runtime -> ACM_Database: Delete Participant Registration
ACM_Runtime -> ACM_Database: Set Participant State as OFFLINE
Participant <- ACM_Runtime: [ASYNC] Deregistration Accepted

loop over all Automation Composition Type Definitions
  alt This Automation Composition Type has the Participant Type of this Participant
    ACM_Runtime -> ACM_Runtime: Trigger Priming of this Automation Composition Type
  end
end

loop over all Automation Composition Instances
  alt This Automation Composition Instance uses this Participant
    ACM_Runtime -> ACM_Runtime: Trigger supervision of this Automation Composition Instance
  end
end

@enduml

2 Dialogues on Automation Composition Types

Commissioning dialogues are used to commission and decommission Automation Composition Types and to set the values of Common Parameters. The values of common parameters are included in the TOSCA YAML file that defines the full Automation Composition Type.

2.1 Commissioning an Automation Composition Type

PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Commission Automation Composition Type
alt Automation Composition Type exists and has Instances
  ACM_Runtime -> REST: Automation Composition Type Commissioning Failed
else
 ACM_Runtime -> ACM_Database: Create and Store Automation Composition Type
 ACM_Runtime -> REST: Automation Composition Type Commissioned
 ACM_Runtime -> ACM_Runtime: Trigger Priming of Automation Composition Type
 activate ACM_Runtime
 deactivate ACM_Runtime
end

@enduml

2.2 Commissioning an Automation Composition Type using SDC

PlantUML Macro
@startuml
participant SDC
participant Policy_Distribution
participant ACM_Runtime

SDC -> Policy_Distribution: [DMaaP] CSAR containing Automation Composition Type Definition
Policy_Distribution -> ACM_Runtime: Commission Automation Composition Type\n(See Commissioning Sequence Diagram)
Policy_Distribution <- ACM_Runtime: Result of Commissioning
Policy_Distribution -> SDC: [DMaaP] Return result of Deployment

@enduml

2.3 Decommissioning an Automation Composition Type Definition

PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Decommission Automation Composition Type
alt Automation Composition Type has Instances
  ACM_Runtime -> REST: Automation Composition Type Decommissioning Failed
else
 ACM_Runtime -> REST: Automation Composition Type Definition Decommissioning Ordered
 ACM_Runtime -> ACM_Runtime: Trigger Depriming of Automation Composition Type Definition
 activate ACM_Runtime
 deactivate ACM_Runtime
 ACM_Runtime -> ACM_Database: Delete Automation Composition Type
end

@enduml

2.4 Priming an Automation Composition Type Definition on Participants

The Priming operation sends Automation Composition Types and common property values to participants.

PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant
database ACM_Database

ACM_Runtime -> ACM_Database: Read all Automation Composition Definitions
loop over all Automation Composition Definitions
 loop over all Participant Automation Composition Definitions
alt Automation Composition Definition not Primed on Participants
  ACM_Runtime -> ACM_Database: Read Automation Composition Definition
  ACM_Runtime -> ACM_Database: Read Common Parameter Values for Automation Composition Definition
  alt Common Parameter values set for Automation Composition Definition
    ACM_Runtime -> Participants: [DMaaP] Update Participants with Automation Composition Definition and values for Common Parameters
    ACM_Runtime -> REST: [REST] Automation Composition Definition priming ordered on participants
  else Automation Composition Definition already primed on Participants
    ACM_Runtime -> REST: [REST] Common Parameters not set\non Automation Composition Definition
  end
else Automation Composition Definition already primed on Participants
  ACM_Runtime -> REST: [REST] Cannot set Common Parameters on\nAutomation Composition Definition that has\nbeen primed on participants
end

== Participant Responses ==
Participants -> ACM_Runtime: [DMaaP] Result of Update with Automation Composition Definition and values for Common Parameters
ACM_Runtime -> ACM_Database: Store result of Automation Composition Definition Update on Participant

== Supervision ==
loop forever
  ACM_Runtime -> ACM_Database: Read Automation Composition Definitions
  loop over each Automation Composition Definition
    alt Automation Composition Definition Participant priming underway
	  ACM_Runtime -> ACM_Database: read result of Automation Composition Definition Updates from participants
      alt Updates completed on all participants
	    ACM_Runtime -> ACM_Database: set Automation Composition Definition as primed on Participants
      else Updates not completed
        alt Priming of Automation Composition Definition on participants timed out
	      ACM_Runtime -> ACM_Database: set Automation Composition Definition priming as timed out on Participants
	      ACM_Runtime -> ACM_Runtime: Log error
        else Wait for updates to complete
        end
      end 
    else Automation Composition Definition Participant priming not underway
    end
  end
end
@enduml

2.5 De-Prime an Automation Composition Type Definition on Participants

This dialogue allows an Automation Composition Type Definition to be de-primed so that it can be deleted or its common parameter values can be altered.

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database ACM_Database  CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Type Definitions
CLAMP_Runtime -> ACM_Database: Read Automation Composition Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Type Definition for de-priming on Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] De-prime Automation Composition Type Definition on Participants

alt Automation Composition Type Definition primed on Participants
  alt Automation Composition Instances do not exist for Automation Composition Type Definition
    CLAMP_Runtime -> Participants: [DMaaP] Update Participants, removing Automation Composition Type Definition and values for Common Parameters
    CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Type Definition de-priming ordered on participants
  else Automation Composition Instances exist for Automation Composition Type Definition
    CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Type Definition cannot be\n de-primed on participants\nit is in use on Automation Compositions
  end
else Automation Composition Type Definition not primed on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Type Definition has not\nbeen primed on participants
end

== Participant Responses ==
Participants -> CLAMP_Runtime: [DMaaP] Result of Update to remove Automation Composition Type Definition and values for Common Parameters
CLAMP_Runtime -> ACM_Database: Store result of Automation Composition Type Definition Update on Participant

== Supervision ==
loop forever
  CLAMP_Runtime -> ACM_Database: Read Automation Composition Type Definitions
  loop over each Automation Composition Type Definition
    alt Automation Composition Type Definition Participant de-prime underway
	  CLAMP_Runtime -> ACM_Database: read result of Automation Composition Type Definition Updates from participants
      alt Updates completed on all participants
	    CLAMP_Runtime -> ACM_Database: set Automation Composition Type Definition as de-primeed on Participants
      else Updates not completed
        alt De-priming of Automation Composition Type Definition on participants timed out
	      CLAMP_Runtime -> ACM_Database: set Automation Composition Type Definition de-priming as timed out on Participants
	      CLAMP_Runtime -> CLAMP_Runtime: Log error
        else Wait for updates to complete
        end
      end 
    else Automation Composition Type Definition Participant de-prime not underway
    end
  end
end
@enduml

2.6 Decommissioning an Automation Composition Type Definition in CLAMP

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database ACM_Database  CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Type Definitions
CLAMP_Runtime -> ACM_Database: Read Automation Composition Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Type Definition for Decommissioning
CLAMP_GUI -> CLAMP_Runtime: [REST] Decommission Automation Composition Type Definition

alt Automation Composition Type Definition not primed on Participants
  CLAMP_Runtime -> ACM_Database: Delete Automation Composition Type Definition
  CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definition Decommissioned
else Automation Composition Type Definition is Commissioned on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Type Definition cannot be decommissioned\nit is primed on participants
end

@enduml

2.7 Reading Commissioned Automation Composition Type Definitions

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database ACM_Database  CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Type Definitions
CLAMP_Runtime -> ACM_Database: Read Automation Composition Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned

@enduml

3. Instantiation Dialogues

Instantiation dialogues are used to create, set parameters on, instantiate, update, and remove Automation Composition instances.

Assume a suitable Automation Composition Definition exists in the Commissioned Automation Composition Inventory. To get an Automation Composition instance running one would, for example, execute dialogues 2.1, 2.3, and 2.4.

3.1 Creating an Automation Composition Instance

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database ACM_Database database ACM_Database  CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Type Definitions
CLAMP_Runtime -> ACM_Database: Read Automation Composition Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Type Definition to use to create Automation Composition Instance
CLAMP_GUI -> CLAMP_Runtime: [REST] Fetch GUI fields for Instance Specific Parameter Definitions
CLAMP_Runtime -> ACM_Database: Read Automation Composition Type Definition
CLAMP_Runtime -> CLAMP_Runtime: Generate fields for Instance Specific Parameters for GUI
CLAMP_Runtime -> CLAMP_GUI: [REST] Return GUI fields Instance Specific Parameter Definitions
CLAMP_GUI -> CLAMP_GUI: Render UI for Instance Specific Parameters
CLAMP_GUI -> CLAMP_GUI: Get values for Instance Specific Parameters from user
CLAMP_GUI -> CLAMP_Runtime: [REST] Request Creation of Automation Composition Instance
CLAMP_Runtime -> CLAMP_Runtime: Create Automation Composition Instance
CLAMP_Runtime -> ACM_Database: Store First Version of Automation Composition Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Instance Updated

@enduml

Note that this dialogue creates the Automation Composition Instance in the Instantiated Automation Composition Inventory. The instance is sent to the participants using the process described in the dialogue in Section 2.3.

3.2 Updating Instance Specific Parameters on an Automation Composition Instance

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database ACM_Database  CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Instances
CLAMP_Runtime -> ACM_Database: Read Automation Composition Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Instances returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Instance on which to Update Parameters
CLAMP_GUI -> CLAMP_GUI: Step version of Automation Composition Instance as Major/Minor/Patch
CLAMP_GUI -> CLAMP_Runtime: [REST] Fetch GUI fields for Instance Specific Parameter Definitions
CLAMP_Runtime -> ACM_Database: Read Automation Composition Type Definition
CLAMP_Runtime -> CLAMP_Runtime: Generate fields for Instance Specific Parameters for GUI
CLAMP_Runtime -> CLAMP_GUI: [REST] Return GUI fields Instance Specific Parameter Definitions
CLAMP_GUI -> CLAMP_GUI: Render UI for Instance Specific Parameters
CLAMP_GUI -> CLAMP_GUI: Get values for Instance Specific Parameters from user
CLAMP_GUI -> CLAMP_Runtime: [REST] Request Update of Automation Composition Instance
CLAMP_Runtime -> CLAMP_Runtime: Update Automation Composition Instance
CLAMP_Runtime -> ACM_Database: Store New Version of Automation Composition Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Instance Updated

@enduml

3.3 Updating an Automation Composition Instance with a Configuration on Participants

ACM_Runtime -> ACM_Runtime: Mark all ACM Element Instances\nrunning on Participant as OFFLINE
activate ACM_Runtime
deactivate ACM_Runtime

@enduml

1.3 Supervise Participants

Participant Supervision is performed periodically between participants and the ACM runtime server to ensure that registered participants are available over time. Participants send a heartbeat message to the ACM runtime at a configured interval.

The heartbeat message contains updated status information for each AC Element Instance that has changed status since the last Heartbeat message sent by the participant


PlantUML Macro
@startuml

participant Participant
participant ACM_Runtime
database ACM_Database

loop Every Participant Supervision Interval
 Participant -> ACM_Runtime: [ASYNC] Heartbeat message including\nstatus and states of AC Element Instances on Participant
 ACM_Runtime -> ACM_Database: Update Participant Heartbeat data
 ACM_Runtime -> ACM_Database: Set Participant State as ONLINE

 loop Every AC Element Instance in Heartbeat Message
  ACM
PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database ACM_Database  CLAMP_GUI -> CLAMP_Runtime: [REST] Read all configuration versions of Automation Composition Instance
CLAMP_Runtime -> ACM_Database: Read all configuration versions of Automation Composition Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] All configuration versions of Automation Composition Instance returned
CLAMP_GUI -> CLAMP_GUI: Select configuration version of Automation Composition Instance for Instantiation Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] Instantiate selected configuration version of Automation Composition Instance on Participants

alt Selected configuration version of Automation Composition Instance not instantiated on Participants
  CLAMP_Runtime -> ACM_Database: Read configuration version of Automation Composition Instance
  CLAMP_Runtime -> Participants: [DMaaP] Update Participants with configuration version of Automation Composition Instance
  CLAMP_Runtime -> CLAMP_GUI: [REST] Instantiation of configuration version of Automation Composition Instance ordered on participants
else Selected configuration version of Automation Composition Instance instantiated on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] configuration version of Automation Composition Instance already instantiated on participants 
end

== Participant Responses ==
Participants -> CLAMP_Runtime: [DMaaP] Result of update of configuration version of Automation Composition Instance on participant
CLAMP_Runtime -> ACM_Database: StoreMark resultAC ofElement updateInstance ofas configurationONLINE\nand versionUpdate ofAC AutomationElement CompositionInstance Instance on participant

== Supervision ==
loop forever
  CLAMP_Runtime -> ACM_Database: Read Automation Composition Instancesstatus
 end
end

@enduml


The ACM runtime regularly checks the heartbeat reports from participants and takes action if participants time out. If a heartbeat message is not received for a participant in the Timeout Interval, the participant is marked as timed out and its ACM element instances are informed.


PlantUML Macro
@startuml

participant ACM_Runtime
database ACM_Database

loop Every ACM_Runtime Supervision Interval
  loop overOver each Automation Composition Instanceall Participants
    alt Automation Composition Instance configuration version update underway on participants
	  CLAMPACM_Runtime -> ACM_Database: read result of Automation Composition updates from participants Read Participant Heartbeat Information
    alt Participant altHeartbeat Updatesnot completedreceived onin allTimeout participantsInterval
	      CLAMPACM_Runtime -> ACM_Database: setSet configuration version of Automation Composition InstanceParticipant State as InstantiatedOFFLINE
 on Participants
	    CLAMPACM_Runtime -> ACM_DatabaseRuntime: setMark overallall configurationACM versionElement ofInstances\nrunning Automation Composition Instance stateon Participant as InstantiatedOFFLINE
      else Updates not completedactivate ACM_Runtime
        alt Instantiation of Automation Composition Instance on participants timed out
	      CLAMPdeactivate ACM_Runtime
    end
  end
end

@enduml

1.4 Get Participant Information

The information on participants is available over a REST endpoint.


PlantUML Macro
@startuml

participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Get Participant Information
ACM_Runtime -> ACM_Database: setRead configuration version Automation Composition Instance Instantiation as timed out on Participants
	      CLAMP_Runtime -> CLAMPParticipant Data
REST <- ACM_Runtime: LogReturn error
Participant Information including\nsupported AC Element Types,\nAC Element Instances elseand Waittheir forstates\nand updates to complete
        end
      end 
    else Automation Composition Instance configuration version update on participants not underway
    end
  end
end
@enduml

...

Heartbeat Information

@enduml

1.5 Order Full Participant Report

A user can order a full participant report. Each participant responds with a heartbeat report immediately. This preempts the normal heartbeat period reporting and refreshes the status of AC Element Instances immediately.


PlantUML Macro
@startuml

participant REST
participant ACM_Runtime
participant Participants

REST -> ACM_Runtime: Order Participant Information
ACM_Runtime -> Participants: Issue immediate Heartbeat Report\n(See §1.3) 
REST <- ACM_Runtime: Participant Information Ordered

@enduml

2 Dialogues on Automation Composition Types

Commissioning dialogues are used to commission and decommission Automation Composition Types and to set the values of Common Parameters. The values of common parameters are included in the TOSCA YAML file that defines the full Automation Composition Type.

2.1 Commission or Update an Automation Composition Type

Create on a POST and update on a PUT.


PlantUML Macro
@startuml
participant CLAMP_GUIREST
participant CLAMPACM_Runtime
participant Participant
database ACM_Database  CLAMP_GUI 

REST -> CLAMPACM_Runtime: [REST]Commission ReadAutomation allComposition InstantiatedType
alt Automation Composition Type exists and has Instances
CLAMP  ACM_Runtime -> ACM_Database: Read all Instantiated REST: Automation Composition Instances
CLAMPType Commissioning Failed
else
 ACM_Runtime -> CLAMPACM_GUIDatabase: [REST]Create Alland InstantiatedStore Automation Composition Instances returned
CLAMP_GUIType
 ACM_Runtime -> CLAMPACM_GUIDatabase: SelectSet Automation Composition InstanceType on whichState to change state and specify new state
CLAMP_GUICOMMISSIONED
 ACM_Runtime -> CLAMP_Runtime: [REST] Change state of selected REST: Automation Composition Instance on Participants

alt Selected Automation Composition Instance instantiated on Participants
  CLAMP_Runtime -> Participants: [DMaaP] Request change of state of Automation Composition Instance
  CLAMP_Runtime -> CLAMP_GUI: [REST] Change of state of Automation Composition Instance ordered on participants
else Selected Automation Composition Instance not instantiated on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Instance not instantiated on participants 
end

== Participant Responses ==
Participants -> CLAMP_Runtime: [DMaaP] Result of State Change of Automation Composition Instance on participant
CLAMPType Commissioned
end

@enduml

2.2 Commission an Automation Composition Type using SDC

PlantUML Macro
@startuml
participant SDC
participant Policy_Distribution
participant ACM_Runtime

SDC -> Policy_Distribution: [ASYNC] CSAR containing Automation Composition Type Definition
Policy_Distribution -> ACM_Runtime: Commission Automation Composition Type\n(See Commissioning Sequence Diagram)
Policy_Distribution <- ACM_Runtime: Result of Commissioning
Policy_Distribution -> SDC: [ASYNC] Return result of Deployment

@enduml

2.3 Decommission an Automation Composition Type

PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Decommission Automation Composition Type
alt Automation Composition Type is not in state COMMISSIONED
  ACM_Runtime -> REST: Automation Composition Type Decommissioning Failed
else
 ACM_Runtime -> ACM_Database: Delete StoreAutomation resultComposition of State Change ofType
 ACM_Runtime -> REST: Automation Composition InstanceType onDecommissioned 
end

@enduml

2.4 Prime an Automation Composition Type on Participants

The Priming operation sends Automation Composition Types and common property values to participants for each Automation Composition Element Type in the Automation Composition Type.


PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
participant Participant
database ACM_Database

participant

== Supervision ==
loop forever
  CLAMP_Runtime -> ACM_Database: Read Automation Composition Instances
  loop over each Automation Composition Instance
    alt Automation Composition InstanceType Statehas Change underway on participants
	  CLAMP_Runtime ->Deployed Instances
  REST <- ACM_DatabaseRuntime: readPriming result of Automation Composition StateType ChangeFailed, frominstances participants
      alt Updates completed on all participants
	    CLAMPdeployed
else Automation Composition Type is in state COMMISSIONED or PRIMED
 REST -> ACM_Runtime: Prime Automation Composition Type

 ACM_Runtime -> ACM_Database: setRead Automation Composition Instance state as changed onType
 ACM_Runtime -> ACM_Database: Read Participants
	    CLAMPACM_Runtime -> ACM_DatabaseRuntime: setSet suitable overallparticipant AutomationID Compositionon Instanceeach stateAC asElement changedType

 alt Was a sutable participant ID found for each AC Element elseType?
 Updates not completed
        altACM_Runtime -> Participant: [ASYNC] Send Priming Request to all Participants\nwith Automation Composition Instance State Change on participants timed out
	      CLAMPType Definition
  ACM_Runtime -> ACM_Database: setSet Automation Composition Type State Change as timed out on Participants
	      CLAMP_Runtime -> CLAMP to PRIMING

  REST <- ACM_Runtime: Priming of Automation Composition Type Ordered
 else
   REST <- ACM_Runtime: LogPriming error
of Automation Composition      else Wait for updates to complete
        end
      end 
    else Automation Composition Instance State Change on participants not underway
    end
  end
end
@enduml

3.5 De-instantiating an Automation Composition Instance from Participants

Type Faield, no sutiable participant found
 end
else 
 REST <- ACM_Runtime: Priming of Automation Composition Type Failed, invalid state
end

@enduml


A participant should respond for each Automation Composition Element Type, thus causing the full Automation Composition Type to become primed. Note that if more than one participant can support an Automation Composition Element Type the ACM Runtime uses the participant in the first response it receives for that Automation Composition Element Type.

PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant

ACM_Runtime -> Participant: [ASYNC] Prime AC Element Types for this AC Type 

loop over AC Element Types in AC Type
 alt Does the primed Participant ID on this AC Element Type\nmatch my Participant ID
  alt Does this AC Element Type already exist
   ACM_Runtime <- Participant: [ASYNC] WARN: AC Element Type already exists
  else
   Participant -> Participant: Create AC Element Type
   activate Participant
   deactivate Participant
   alt AC Element successfully created
    ACM_Runtime <- Participant: [ASYNC] INFO: AC Element successfully primed
   else
    ACM_Runtime <- Participant: [ASYNC] ERROR: AC Element priming failed
   end
  end
 else
  note left of participant
   ignore this AC Element Type as its for another participant 
  end note
 end
end

@enduml


The ACM Runtime updates the priming information in the database.


PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant
database ACM_Database

ACM_Runtime <- Participant: [ASYNC] Result of Priming of AC Element Type
ACM
PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database ACM_Database  CLAMP_GUI -> CLAMP_Runtime: [REST] Read all Instantiated Automation Composition Instances
CLAMP_Runtime -> ACM_Database: Read all Instantiated Automation Composition Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] All Instantiated Automation Composition Instances returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Instance to de-instantiate
CLAMP_GUI -> CLAMP_Runtime: [REST] De-instantiate selected Automation Composition Instance on Participants

alt Selected Automation Composition Instance instantiated on Participants
  CLAMP_Runtime -> Participants: [DMaaP] Update Participants to remove Automation Composition Instance
  CLAMP_Runtime -> CLAMP_GUI: [REST] De-instantiation of Automation Composition Instance ordered on participants
else Selected Automation Composition Instance not instantiated on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Instance not instantiated on participants 
end

== Participant Responses ==
Participants -> CLAMP_Runtime: [DMaaP] Result of update of Automation Composition Instance on participant
CLAMP_Runtime -> ACM_Database: StoreRecord result of updateAC ofElement Automation Composition Instance on participantType Priming

==alt Supervision ==
loop forever
  CLAMP_Runtime -> ACM_Database: Read Automation Composition Instances
  loop over each Automation Composition Instance
    alt Automation Composition Instance de-instantiation update underway on participants
	  CLAMPIs AC Element Type Primed?
 alt Have all the other AC Element Types in this AC Type been Primed?
  ACM_Runtime -> ACM_DatabaseRuntime: readSet resultAC ofType Automationstate Compositionas updatesPRIMED
 from participants
      alt Updates completed on all participants
	    CLAMP_Runtime -> ACM_Database: setend
end

@enduml

2.5 Deprime an Automation Composition Type on Participants

The Depriming operation removes Automation Composition Types and common property values on participants for each Automation Composition Element Type in the Automation Composition Type.


PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
participant Participant
database ACM_Database

alt Automation Composition InstanceType as de-instantiated on Participants
	has Instances
  REST  CLAMP_Runtime <-> ACM_DatabaseRuntime: setDepriming overallof Automation Composition Instance as de-instantiated
      else Updates not completed
        alt Automation Composition Instance de-instantiation Update timed out on participants
	      CLAMPType Failed
else AC Type State is PRIMED or PRIMING
 REST -> ACM_Runtime: Deprime Automation Composition Type

 ACM_Runtime -> ACM_Database: setRead Automation Composition Instance de-instantiation as timed out on Participants
	      CLAMP Type
 ACM_Runtime -> Participant: [ASYNC] Send Depriming Request to all Participants\nwith Automation Composition Type Definition
 ACM_Runtime -> CLAMPACM_RuntimeDatabase: LogSet error
Automation Composition Type State to DEPRIMING

 REST <- ACM_Runtime: Depriming elseof WaitAutomation forComposition updatesType toOrdered
else complete
 REST <- ACM_Runtime: Depriming of Automation Composition end
Type Failed, invalid state
end

@enduml


A participant should respond for each Automation Composition Element Type, thus causing the full Automation Composition Type to become deprimed.


PlantUML Macro
@startuml
participant ACM_Runtime
participant  end 
    else Automation Composition Instance de-instantiation update on participants not underway
    end
  end
@enduml

3.6 Deleting an Automation Composition Instance

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime

database ACM_Database  CLAMP_GUI -> CLAMP_Runtime: [REST] Read all Automation Composition Instances
CLAMP_Runtime -> ACM_Database: Read all Automation Composition Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] All Automation Composition Instances returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Instance to delete
CLAMP_GUI -> CLAMP_Runtime: [REST] Delete selected Automation Composition Instance

alt Selected Automation Composition Instance exists
  CLAMP_Runtime -> ACM_Database: Delete Automation Composition instance
  CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Instance deleted
else Selected Automation Composition Instance does not exist
  CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Instance does not exist 
end

@enduml

3.7 Reading Automation Composition Instances

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database ACM_Database  CLAMP_GUI -> CLAMP_Runtime: [REST] Read all Automation Composition Instances
CLAMP_Runtime -> ACM_Database: Read all Automation Composition Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] All Automation Composition Instances returned

@enduml

3. Monitoring Dialogues

Monitoring dialogues are used to monitor and read statistics on Automation Composition Instances.

3.1 Reporting of Monitoring Information and Statistics by Participants

Participant

ACM_Runtime -> Participant: [ASYNC] Deprime AC Element Types for this AC Type 

loop over AC Element Types in AC Type
 alt Does the deprimed Participant ID on this AC Element Type\nmatch my Participant ID
  alt Does this AC Element Type Exist
   Participant -> Participant: Delete AC Element Type
   activate Participant
   deactivate Participant
   note left of Participant
    Deletion of an AC Element Type always returns success
   end note
   ACM_Runtime <- Participant: [ASYNC] INFO: AC Element successfully primed
  else
    ACM_Runtime <- Participant: [ASYNC] WARN: AC Element Type is already deprimed
  end
 else
  note left of Participant
   ignore this AC Element Type as its for another participant 
  end note
 end
end

@enduml


The ACM Runtime updates the priming information in the database.


PlantUML Macro
@startuml
participant ACM
PlantUML Macro
@startuml
participant CLAMP_Runtime
participant Participant
database ACM_Database  Participant -> CLAMP_Runtime

ACM_Runtime <- Participant: [DMaaPASYNC] Result Participantof andDepriming Automationof CompositionAC Element Monitoring and Statistics report
CLAMPType
ACM_Runtime -> ACM_Database: Store Participant and Automation Composition Element Monitoring and Statistics report

alt Fault reported on Participant
  CLAMP_Runtime -> CLAMP_Runtime: log fault on Participant
  CLAMPRecord result of AC Element Type Depriming

alt Is AC Element Type Deprimed?
 alt Have all the other AC Element Types in this AC Type been Deprimed?
  ACM_Runtime -> ACM_DatabaseRuntime: Record fault on ParticipantSet AC Type state as COMMISSIONED
 end
end

loop Over all Automation Composition Elements in Participant Report
  alt Fault reported on Automation Composition Element
    CLAMP@enduml

2.6 Get Automation Composition Types

This dialogue allows an Automation Composition Type  to be read.


PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Get Automation Composition Type Information 
ACM_Runtime -> CLAMPACM_RuntimeDatabase: log fault onRead Automation Composition Element and Automation Composition     CLAMPType Information
ACM_Runtime -> ACM_DatabaseREST: RecordRespond fault onwith Automation Composition Type information\nincluding ACM Element andType Automationinformation Compositionand  Priming endStatus
end
@enduml


3.

...

Instantiation Dialogues

Instantiation dialogues are used to create, set parameters on, instantiate, update, and remove Automation Composition instances.

3.1 Create an Automation Composition Instance


PlantUML Macro
@startuml
participant CLAMP_GUIREST
participant CLAMPACM_Runtime
database ACM_Database  == Overview of all Automation Composition Instances ==
CLAMP_GUI

REST -> CLAMPACM_Runtime: [REST] Read all Create Automation Composition Instance for\nspecified Automation Composition Instances
CLAMP_Runtime -> ACM_Database: Read allType with\nspecified parameter values

alt Automation Composition Instance Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] Allexists
 alt Automation Composition Instances returned
CLAMP_GUI -> CLAMP_GUI: Display overview of status of allInstance is not in state UNDEPLOYED
  ACM_Runtime -> REST: Automation Composition Instances

== Details of a Automation Composition Instance ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Elements for Automation Composition Instance
CLAMP_Runtime -> ACM_Database: Read Automation Composition Elements for Automation Composition Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Elements returned
CLAMP_GUI -> CLAMP_GUI: Display status of Automation Composition Elements in Automation Composition Instance

== Overview of all Participants ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read all participants
CLAMPinstance exists and is already deployed
 else
  note right of REST
   Updates on "Not In Service" Automation Composition Instances are allowed
  end note
 end
end
 
alt Specified Automation Composition Type Exists
 alt Specified Automation Composition Type is in state PRIMED
  ACM_Runtime -> ACM_Database: Store Automation Composition Instance
  ACM_Runtime -> ACM_Database: ReadSet all participants
CLAMP_Runtime -> CLAMP_GUI: [REST] All participants returned
CLAMP_GUIAutomation Composition Instance State to UNDEPLOYED
  ACM_Runtime -> CLAMP_GUIREST: DisplayAutomation overviewComposition ofInstance status of all participants

== Details of a Participant ==
CLAMP_GUICreated
 else
  ACM_Runtime -> CLAMP_Runtime: [REST] Read Automation Composition Elements for Participant
CLAMPREST: Automation Composition Type is not in state PRIMED
 end
else
  ACM_Runtime -> ACM_DatabaseREST: Read Automation Composition Type Elementsis for Participant
CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Elements returned
CLAMP_GUI -> CLAMP_GUI: Display status of Automation Composition Elements in Participant

== Filtered Monitoring ==
CLAMP_GUI -> CLAMP_GUI: Set filter for Automation Composition Instances, Automation Composition Elements, and Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Elements that match filter
CLAMP_Runtime -> ACM_Database: Read Automation Composition Elements that match filter
CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Elements that match filter returned
CLAMP_GUI -> CLAMP_GUI: Display status of Automation Composition Elements that match filter

@enduml

...

not found
end

@enduml

Note that this dialogue creates the Automation Composition Instance in the ACM database. The instance is sent to the participants using the process described in the dialogue in Section 3.3.

3.2 Delete an Automation Composition Instance

PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Delete Automation Composition Instance

alt Automation Composition Instance exists
 alt Automation Composition Instance is not in state UNDEPLOYED
  ACM_Runtime -> REST: Automation Composition instance exists and is deployed
 else
  ACM_Runtime -> REST: Automation Composition instance does not exist
 end
else
 ACM_Runtime -> ACM_Database: Delete Automation Composition Instance
 ACM_Runtime -> REST: Automation Composition Instance Deleted
end

@enduml

3.3 Deploy Automation Composition Instance

The user requests the AC Instance to be deployed using a REST endpoint. The ACM Runtime orders the AC Instance to be deployed to Participants.


PlantUML Macro
@startuml
participant CLAMP_GUIREST
participant CLAMPACM_Runtime
participant Participants
database ACM_Database  == Statistics of all Automation Composition Instances ==
CLAMP_GUI

REST -> CLAMPACM_Runtime: [REST] Read summary statistics for all Deploy Automation Composition InstancesInstance
CLAMPACM_Runtime -> ACM_Database: Compile summary statistics for all Read Automation Composition Instance Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] Summary statistics for allInformation

alt Automation Composition Instance exists
 alt Automation Composition InstancesInstance is returneddeployed
CLAMP  ACM_GUIRuntime -> CLAMP_GUI: Display summary statistics for allREST: Automation Composition Instances

== Statistics of a Automation Composition Instance ==
CLAMP_GUIinstance is already deployed
 else
  ACM_Runtime -> CLAMP_RuntimeParticipants: [RESTASYNC] ReadDeploy statisticsAC for Automation Composition ElementsElement Instances for Automationthis CompositionAC Instance
CLAMP  ACM_Runtime -> ACM_Database: Compile statistics for Automation Composition Elements for Automation Composition Instance
CLAMP Set AC Instance and its AC Element Instances to state DEPLOYING
  ACM_Runtime -> CLAMP_GUIREST: [REST] Statistics forDeployment of Automation Composition Elements returned
CLAMP_GUI Instance has been requested
 end
else
  ACM_Runtime -> CLAMP_GUIREST: Display statistics for Automation Composition Elementsinstance indoes Automation Composition Instance

== Statistics of all Participants ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read summary statistics for all Automation Composition Instances
CLAMP_Runtime -> ACM_Database: Compile summary statistics for all Automation Composition Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] Summary statistics for all Automation Composition Instances returned
CLAMP_GUI -> CLAMP_GUI: Display summary statistics for all Automation Composition Instances

== Statistics of a Participant ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read statistics for Automation Composition Elements for Participant
CLAMP_Runtime -> ACM_Database: Read statistics for Automation Composition Elements for Participant
CLAMP_Runtime -> CLAMP_GUI: [REST] Statistics for Automation Composition Elements returned
CLAMP_GUI -> CLAMP_GUI: Display statistics for Automation Composition Elements in Participant

== Filtered Statistics ==
CLAMP_GUI -> CLAMP_GUI: Set filter for Automation Composition Instances, Automation Composition Elements, and Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] Read statistics for Automation Composition Elements that match filter
CLAMP_Runtime -> ACM_Database: Read statistics for Automation Composition Elements that match filter
CLAMP_Runtime -> CLAMP_GUI: [REST] Statistics for Automation Composition Elements that match filter returned
CLAMP_GUI -> CLAMP_GUI: Display statistics for Automation Composition Elements that match filter

@enduml

3.3 Statistics Housekeeping

not exist
end

@enduml


Each participant deploys its AC Element Instances from the AC Instance.


PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant
participant Participant_API

ACM_Runtime -> Participant: [ASYNC] Deploy AC Element Instances for this AC Instance 

loop over AC Element Instances in AC Instance
 alt Does the primed Participant ID on this AC Element Instance\nmatch my Participant ID?
  alt Is this AC Element Instance already deployed
   ACM_Runtime <- Participant: [ASYNC] WARN: AC Element is already deployed
  else
   Participant -> Participant_API: Deploy AC Element Instance
   activate Participant_API
   Participant <- Participant_API: AC Element Instance Deploy Response
   deactivate Participant_API
   alt AC Element deployed successfully
    Participant -> Participant: Set AC Element Instance administrative state to LOCKED
    ACM_Runtime <- Participant: [ASYNC] INFO: AC Element has been deployed
   else
    ACM_Runtime <- Participant: [ASYNC] ERROR: AC Element was not deployed
   end
  end
 else
  note left of Participant
   Ignore this AC Element instance as its for another participant 
  end note
 end
end

@enduml


The ACM Runtime receives and stores the responses.


PlantUML Macro
@startuml

participant ACM_Runtime
participant Participant
database ACM_Database 

ACM_Runtime <- Participant: [ASYNC] Deploy Automation Composition Element Instance Response
ACM
PlantUML Macro
@startuml
participant CLAMP_Runtime
database ACM_Database  == Automation Composition Instance Statistics ==

loop forever
  CLAMP_Runtime -> ACM_Database: Read Automation Composition Instance Statistics
  CLAMP_Runtime -> CLAMP_Runtime: Summarise Automation Composition Instance Statistics
  CLAMP_Runtime -> ACM_Database: Store summarised Automation Composition Element Instance Response Statistics
  CLAMPInformation

alt Is AC Element Instance Deployed?
 ACM_Runtime -> ACM_Database: DeleteSet AutomationAC CompositionElement Instance Statistics on which retention period has expired
end

== Participant Statistics ==

loop forever
  CLAMP State as DEPLOYED
 alt Are all the other AC Element Instances in this AC Instance in state DEPLOYED?
  ACM_Runtime -> ACM_DatabaseRuntime: Read Participant Statistics
  CLAMP_Runtime -> CLAMP_Runtime: Summarise Participant Statistics
  CLAMP_RuntimeSet AC Instance state as DEPLOYED
 end
end

@enduml

3.4 Undeploy Automation Composition Instance

The user requests the AC Instance to be undeployed using a REST endpoint. The ACM Runtime orders the AC Instance to be undeployed.


PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
participant Participants
database ACM_Database 

REST -> ACM_DatabaseRuntime: StoreUndeploy summarisedAutomation ParticipantComposition StatisticsInstance
  CLAMPACM_Runtime -> ACM_Database: DeleteRead ParticipantAutomation StatisticsComposition on which retention period has expired
end

@enduml

4. Supervision Dialogues

Supervision dialogues are used to check the state of Automation Composition Instances and Participants.

4.1 Supervise Participants

PlantUML Macro
@startuml
participant CLAMP_Runtime
database ACM_Database  loop forever
  CLAMPInstance Information

alt Automation Composition Instance exists
 alt Automation Composition Instance administrative state is not LOCKED
  ACM_Runtime -> REST: Automation Composition instance exists and is not LOCKED
 else
  ACM_Runtime -> REST: Automation Composition instance does not exist
 end
else
 ACM_Runtime -> ACM_DatabaseParticipants: Read Participants
  loop Over each Participant
    alt Participant has not reported in last reporting window
       CLAMP[ASYNC] Undeploy AC Element Instances for this AC Instance
 ACM_Runtime -> ACM_Database: Mark this AC Instance and its AC Element Instances as UNDEPLOYING
 ACM_Runtime -> CLAMP_RuntimeREST: LogUndeployment of ParticipantAutomation asComposition havingInstance missedhas been requested
end

@enduml


Each participant undeploys its AC Element Instances from the AC Instance


PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant
participant Participant_API

ACMa report
       CLAMP_Runtime -> ACM_Database: Increment missed report counter on Participant
       alt Participant has exceeded alarm threshold on missed report counter
          CLAMP_Runtime -> CLAMP_Runtime: Raise a Participant Offline alarm on participant
          CLAMP_Runtime -> ACM_Database: Mark participant as being offline
       end
    else Participant has reported in last reporting window
       CLAMP_Runtime -> ACM_Database: Clear missed report counter on Participant
       alt Participant marked as being offline
          CLAMP_Runtime -> CLAMP_Runtime: Clear Participant Offline alarm on participant
          CLAMP_Runtime -> ACM_Database: Mark participant as being online
       end
    end
  end
end

@enduml

4.2 Supervise Automation Compositions

Participant: [ASYNC] Undeploy AC Element Instances for this AC Instance

loop over AC Element Instances in AC Instance
 alt Does the primed Participant ID on this AC Element Instance\nmatch my Participant ID?
  alt Does this AC Element Instance exist?
   ACM_Runtime <- Participant: [ASYNC] WARN: AC Element does not exist
  else Is this administrative state of this AC Element Instance LOCKED
   Participant -> Participant_API: Undeploy AC Element Instance
   activate Participant_API
   Participant <- Participant_API: Undeploy AC Element Instance Response
   deactivate Participant_API
   ACM_Runtime <- Participant: [ASYNC] INFO: AC Element undeployed successfully
   note left of Participant
    Undeploy always returns success
   end note
  else
    ACM_Runtime <- Participant: [ASYNC] WARN: AC Element is already undeployed
  end
 else
  note left of Participant
   Ignore this AC Element instance as its for another participant 
  end note
 end
end

@enduml


The ACM Runtime receives and stores the responses.


PlantUML Macro
@startuml

participant ACM_Runtime
participant Participant
database ACM_Database 

ACM_Runtime <- Participant: [ASYNC] Undeploy Automation Composition Element Instance Response
ACM
PlantUML Macro
@startuml
participant CLAMP_Runtime
database ACM_Database  loop forever
  CLAMP_Runtime -> ACM_Database: ReadStore Automation Composition Instances
Element Instance loop Over each Automation Composition Instance
    loop Over each Automation Composition Element
      alt Automation Composition Element has not reported in last reporting window
         CLAMPResponse Information

alt Is AC Element Instance undeployed?
 ACM_Runtime -> ACM_Database: Mark AC Element Instance as UNDEPLOYED
  alt Are all the other AC Element Instances in this AC Instance in state UNDEPLOYED?
   ACM_Runtime -> CLAMPACM_Runtime: LogSet AutomationAC CompositionInstance Elementstate as having missed a report
         CLAMPUNDEPLOYED
  end
end

@enduml

3.5 Read Automation Composition Instances

PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Get Automation Composition Instance Information 
ACM_Runtime -> ACM_Database: Increment missed report counter on Read Automation Composition Instance Information
ACM_Runtime -> REST: Respond with Automation Composition Instance information\nincluding ACM Element
 Instance information\nand admin, operational, and usage state

@enduml

3.6 Unlock Automation Composition Instance

The user requests the AC Instance to be unlocked using a REST endpoint. The ACM Runtime orders the AC Instance to be unlocked on Participants.


PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
participant Participants
database ACM_Database 

REST -> ACM_Runtime: Unlock Automation Composition Instance
ACMelse Automation Composition Element has reported in last reporting window
         CLAMP_Runtime -> ACM_Database: ClearRead missedAutomation reportComposition counter onInstance Information

alt Automation Composition Element
      end
      Instance exists
 alt Automation Composition ElementInstance in incorrectadministrative state in last reporting windowis LOCKED
        CLAMPACM_Runtime -> CLAMP_RuntimeParticipants: Log[ASYNC] AutomationUnlock CompositionAC Element asInstances beingfor inthis incorrectAC stateInstance
        CLAMPACM_Runtime -> ACM_Database: Mark RecordAC AutomationInstance Compositionand Elementits asAC beingElement inInstances incorrectas stateUnlocking
  ACM_Runtime -> REST: Unlocking elseof Automation Composition ElementInstance nothas inbeen incorrect state in last reporting windowrequested
 else
  ACM_Runtime      alt-> REST: Automation Composition instance Elementis wasnot in incorrect state on previous report
          CLAMPlocked
 end
else
  ACM_Runtime -> REST: Automation Composition instance does not exist
end

@enduml


Each participant unlocks its AC Element Instances from the AC Instance.


PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant
participant Participant_API

ACM_Runtime -> CLAMP_RuntimeParticipant: Log[ASYNC] AutomationUnlock CompositionAC Element Instances asfor beingthis inAC correctInstance state

loop          CLAMP_Runtime -> ACM_Database: Record Automation Composition Element as beingover AC Element Instances in correctAC stateInstance
 alt Does the primed Participant ID on end
this AC     end
    Element Instance\nmatch my Participant ID?
  alt AutomationIs this CompositionAC Element reportedInstance faultadministrative instate lastnot reporting windowLOCKED
        CLAMPACM_Runtime <-> CLAMP_RuntimeParticipant: Log Automation Composition[ASYNC] WARN: AC Element asis beingnot faultyLOCKED
  else
   Participant   CLAMP_Runtime -> ACMParticipant_DatabaseAPI: Unlock RecordAC AutomationElement CompositionInstance
 Element as beingactivate faultyParticipant_API
   Participant <- Participant_API: elseUnlock Automation CompositionAC Element did not reportInstance faultResponse
 in last reportingdeactivate windowParticipant_API
   alt AC Element unlocked successfully
 alt Automation Composition ElementParticipant reported-> faultParticipant: onSet previousAC report
Element Instance administrative state to UNLOCKED
     CLAMPACM_Runtime <-> CLAMP_RuntimeParticipant: Log Automation Composition[ASYNC] INFO: AC Element faulthas asbeen clearedunlocked
   else
       CLAMPACM_Runtime <-> ACM_DatabaseParticipant: Mark fault Automation Composition Element as being cleared
      [ASYNC] ERROR: AC Element was not unlocked
   end
  end
 else
  note left of endparticipant
   Ignore this end
AC Element instance as altits Automationfor Compositionanother Elementparticipant in
 Automation Compositionend Instance has exceeded alarm threshold on missed report counter
      CLAMPnote
 end
end

@enduml


The ACM Runtime receives and stores the responses.


PlantUML Macro
@startuml

participant ACM_Runtime
participant Participant
database ACM_Database 

ACM_Runtime <- Participant: [ASYNC] Unlock Automation Composition Element Instance Response
ACM_Runtime -> CLAMPACM_RuntimeDatabase: RaiseStore a Automation Composition OfflineElement alarmInstance on Automation Composition Instance
      CLAMPResponse Information

alt Is AC Element Instance Unlocked?
 ACM_Runtime -> ACM_Database: MarkSet AutomationAC CompositionElement Instance administrative state as being offlineUNLOCKED
 alt Have all elsethe Noother AutomationAC CompositionElement ElementInstances in Automationthis CompositionAC Instance has exceeded alarm threshold on missed report counterbeen UNLOCKED?
  ACM_Runtime     alt Automation Composition-> ACM_Runtime: Set AC Instance markedadministrative state as being offlineUNLOCKED
  end
end

@enduml

3.7 Lock Automation Composition Instance

The user requests the AC Instance to be locked using a REST endpoint. The ACM Runtime orders the AC Instance to be locked on Participants.


PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
participant Participants
database     CLAMP_RuntimeACM_Database 

REST -> CLAMPACM_Runtime: Clear Automation Composition Instance Offline alarm on Lock Automation Composition           CLAMPInstance
ACM_Runtime -> ACM_Database: MarkRead Automation Composition Instance as being online
       end
    end
    alt Automation Composition Element in Automation Composition Instance in incorrect state in last reporting window
      CLAMP Information

alt Automation Composition Instance exists
 alt Automation Composition Instance administrative state is UNLOCKED
  ACM_Runtime -> Participants: [ASYNC] Lock AC Element Instances for this AC Instance
  ACM_Runtime -> ACM_Database: Mark AC Instance and its AC Element Instances as Locking
  ACM_Runtime -> CLAMP_RuntimeREST: LogLocking of Automation Composition Instance ashas beingbeen in incorrect staterequested
 else
      CLAMPACM_Runtime -> ACM_DatabaseREST: Record Automation Composition Instanceinstance asis beingnot in incorrect stateunlocked
 end
else
  ACM_Runtime -> REST:  alt Automation Composition Elementinstance indoes Automation Composition Instance has exceeded alarm threshold on incorrect not exist
end

@enduml


Each participant locks its AC Element Instances from the AC Instance.


PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant
participant Participant_API

ACMstate reports
        CLAMP_Runtime -> CLAMP_Runtime: Raise a Automation Composition Instance in Incorrect State alarm on Automation CompositionParticipant: [ASYNC] Lock AC Element Instances for this AC Instance 

loop over AC Element Instances in AC Instance
 alt Does the primed Participant ID on CLAMP_Runtime -> ACM_Database: Mark Automation Composition Instance as being in an incorrect state
      end
    else No Automation Composition Element in incorrect state in last reporting window
      alt Automation Composition Element in Automation Composition Instance was in incorrect state on previous report
        CLAMP_Runtime -> CLAMP_Runtime: Log Automation Composition Instance as being in correct state
        CLAMP_Runtime -> ACM_Database: Record Automation Composition Instance as being in correct state
        alt Automation Composition Instance in Incorrect State alarm raised on Automation Composition Instance
          CLAMP_Runtime -> CLAMP_Runtime: Clear Automation Composition Instance in Incorrect State alarm on Automation Composition Instance
        end
      end
    end
    alt Automation Composition Element in Automation Composition Instance reported a fault in last reporting window
      CLAMP_Runtime -> CLAMP_Runtime: Log Automation Composition Instance as being faulty
      CLAMPthis AC Element Instance\nmatch my Participant ID?
  alt Is this AC Element Instance administrative state not UNLOCKED
   ACM_Runtime <- Participant: [ASYNC] WARN: AC Element is not UNLOCKED
  else
   Participant -> Participant: Set AC Element Instance administrative state to SHUTTING_DOWN
   Participant -> Participant_API: Lock AC Element Instance
   activate Participant_API
   Participant <- Participant_API: Lock AC Element Instance Response
   deactivate Participant_API
   alt AC Element locked successfully
    Participant -> Participant: Set AC Element Instance administrative state to LOCKED
    ACM_Runtime <- Participant: [ASYNC] INFO: AC Element has been locked
   else
    ACM_Runtime <- Participant: [ASYNC] ERROR: AC Element was not locked
   end
  end
 else
  note left of participant
   Ignore this AC Element instance as its for another participant 
  end note
 end
end

@enduml


The ACM Runtime receives and stores the responses.


PlantUML Macro
@startuml

participant ACM_Runtime
participant Participant
database ACM_Database 

ACM_Runtime <- Participant: [ASYNC] Lock Automation Composition Element Instance Response
ACM_Runtime -> ACM_Database: RecordStore Automation Composition Instance as being faulty
      alt Automation Composition Element in Automation Composition Instance has exceeded alarm threshold on faulty reports
        CLAMP Response Information

alt Is AC Element Instance Locked?
 ACM_Runtime -> CLAMPACM_RuntimeDatabase: RaiseSet aAC AutomationElement Composition Instance Faultyadministrative alarmstate on Automation Composition Instanceas LOCKED
 alt Have all the other end
AC Element Instances in elsethis NoAC AutomationInstance Compositionbeen ElementLOCKED?
 faulty in last reporting window
      alt Automation Composition Element in Automation Composition Instance was faulty on previous report
        CLAMP_Runtime -> CLAMP_Runtime: Log Automation Composition Instance as being fault free
        CLAMP_RuntimeACM_Runtime -> ACM_Runtime: Set AC Instance administrative state as LOCKED
  end
end

@enduml

3.8 Update Operational State on Automation Composition Instance

PlantUML Macro
@startuml
participant Participant_API
participant Participant
participant ACM_Runtime

Participant_API -> Participant_API: Perform Operation that Updates Operational State
activate Participant_API
deactivate Participant_API

Participant_API -> Participant: Operational State has been updated
Participant -> Participant: Update Operational State in ACM Element Instance

== Periodically with Heartbeat ==
Participant -> ACM_DatabaseRuntime: Record[ASYNC] AutomationHeartbeat Compositionmessage Instanceincluding\nstatus asand beingstates faultof free
AC Element Instances on Participant 

@enduml

3.9 Update Usage State on Automation Composition Instance

PlantUML Macro
@startuml
participant Participant_API
participant  alt Automation Composition Instance Faulty alarm raised on Automation Composition Instance
          CLAMP_Runtime -> CLAMP_Runtime: Clear Automation Composition Instance Faulty alarm on Automation Composition Instance
        end
      end
    end
  end
endParticipant
participant ACM_Runtime

Participant_API -> Participant_API: Perform Operation that Updates Usage State
activate Participant_API
deactivate Participant_API

Participant_API -> Participant: Usage State has been updated
Participant -> Participant: Update Usage State in ACM Element Instance

== Periodically with Heartbeat ==
Participant -> ACM_Runtime: [ASYNC] Heartbeat message including\nstatus and states of AC Element Instances on Participant 

@enduml