Versions Compared

Key

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

The CLAMP Control Loop 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.

Table of Contents

1 Commissioning Dialogues

Commissioning dialogues are used to commission and decommission Control Loop Automation Composition Type definitions and to set the values of Common Parameters.

1.1 Commissioning a Control Loop Type Definition using the CLAMP GUI

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Database

CLAMP_GUI -> CLAMP_Runtime: [REST] Commission Control Loop Type Definition
CLAMP_Runtime -> Database: Store Control Loop Type Definition
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definition Commissioned
@enduml

1.2 Commissioning a Control Loop Type Definition using SDC

PlantUML Macro
@startuml
participant SDC
participant Policy_Distribution
participant CLAMP_Runtime
database Database

SDC -> Policy_Distribution: [DMaaP] CSAR containing Control Loop Type Definition
Policy_Distribution -> CLAMP_Runtime: [REST] Commission Control Loop Type Definition
CLAMP_Runtime -> Database: Store Control Loop Type Definition
CLAMP_Runtime -> Policy_Distribution: [REST] Type Definition Commissioned
Policy_Distribution -> SDC: [DMaaP] Deployment Completed
@enduml

1.3 Setting Common Parameters for a Control Loop Type Definition

Commissioning an Automation Composition Type is a three-step process

  1. The Automation Composition Type must be created, that is the Automation Composition Type definition must be loaded and stored in the database. This step may be carried out over the REST interface or using SDC distribution.
  2. The Common Properties of the Automation Composition type must be assigned values and those values must be stored in the database. This step is optional only if all mandatory common properties have default values. The Common Property values may be set and amended over and over again in multiple sessions until the Automation Composition Type is primed.
  3. The Automation Composition Type Definition and the Common Property values must be primed, which is sent to the concerned participants. Once an Automation Composition Type is primed, its Common Property values can no longer be changed. To change Common Properties on a primed Automation Composition Type, all instances of the Automation Composition Type must be removed and the Automation Composition Type must be de-primed.

1.1 Commissioning an Automation Composition Type Definition using the CLAMP GUI

This dialogue corresponds to a "File→Import" menu on the CLAMP GUI. The documentation of future releases of the system will describe how the Design Time functionality interacts with the Runtime commissioning API.

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Commissioned_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Commission Automation Composition Type Definition
CLAMP_Runtime -> Commissioned_ACM_Inventory: Store Automation Composition Type Definition
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definition Commissioned
@enduml

1.2 Commissioning an Automation Composition Type Definition using SDC

PlantUML Macro
@startuml
participant SDC
participant Policy_Distribution
participant CLAMP_Runtime
database Commissioned_ACM_Inventory

SDC -> Policy_Distribution: [DMaaP] CSAR containing Automation Composition Type Definition
Policy_Distribution -> CLAMP_Runtime: [REST] Commission Automation Composition Type Definition
CLAMP_Runtime -> Commissioned_ACM_Inventory: Store Automation Composition Type Definition
CLAMP_Runtime -> Policy_Distribution: [REST] Type Definition Commissioned
Policy_Distribution -> SDC: [DMaaP] Deployment Completed
@enduml

1.3 Setting Common Properties for an Automation Composition Type Definition

This dialogue sets the values of common properties. The values of the common properties may be set, updated, or deleted at will, as this dialogue saves the properties to the database but does not send the definitions or properties to the participants. However, once an Automation Composition Type Definition and its properties are primed (See Section 1.4), the properties cannot be changed until the Automation Composition type definition is de-primed (See Section 1.5).

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database Commissioned_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Type Definitions
CLAMP_Runtime -> Commissioned_ACM_Inventory: Read Automation Composition Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Type Definition for Parameterization
CLAMP_GUI -> CLAMP_Runtime: [REST] Fetch GUI fields for Common Parameter Definitions

alt Automation Composition Type Definition not Commissioned on Participants
  CLAMP_Runtime -> Commissioned_ACM_Inventory: Read Automation Composition Type Definition
  CLAMP_Runtime -> CLAMP_Runtime: Generate fields for Common Parameters for GUI
  CLAMP_Runtime -> CLAMP_GUI: [REST] Return GUI fields Common Parameter Definitions
  CLAMP_GUI -> CLAMP_GUI: Render UI for Common Parameters
  CLAMP_GUI -> CLAMP_GUI: Get values for Common Parameters from user
  CLAMP_GUI -> CLAMP_Runtime: [REST] Set values for Common Parameters
  CLAMP_Runtime -> Commissioned_ACM_Inventory: Store values for Common Parameters
  CLAMP_Runtime -> CLAMP_GUI: [REST] Common Parameter values stored
else Automation Composition Type Definition already Commissioned on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Cannot set Common Parameters on\nAutomation Composition Type Definition that has\nbeen commissioned on participants
end

@enduml

1.4 Priming an Automation Composition Type Definition on Participants

The Priming operation sends Automation Composition Type definitions and common property values to participants. Once an Automation Composition Type definition is primed, its property values can on longer be changed until it is de-primed.

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database Commissioned_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Type Definitions
CLAMP_Runtime -> Commissioned_ACM_Inventory: Read Automation Composition Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Type Definition for Priming on Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] Prime Automation Composition Type Definition on Participants

alt Automation Composition Type Definition not Primed on Participants
  CLAMP_Runtime -> Commissioned_ACM_Inventory: Read Automation Composition Type Definition
  CLAMP_Runtime -> Commissioned_ACM_Inventory: Read Common Parameter Values for Automation Composition Type Definition
  alt Common Parameter values set for Automation Composition Type Definition
    CLAMP_Runtime -> Participants: [DMaaP] Update Participants with Automation Composition Type Definition and values for Common Parameters
    CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Type Definition priming ordered on participants
  else Automation Composition Type Definition already primed on Participants
    CLAMP_Runtime -> CLAMP_GUI: [REST] Common Parameters not set\non Automation Composition Type Definition
  end
else Automation Composition Type Definition already primed on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Cannot set Common Parameters on\nAutomation Composition Type Definition that has\nbeen primed on participants
end

== Participant Responses ==
Participants
PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database Database

CLAMP_GUI -> CLAMP_Runtime: [REST] Read Control Loop Type DefinitionsDMaaP] Result of Update with Automation Composition Type Definition and values for Common Parameters
CLAMP_Runtime -> Database: Read Control Loop Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned
CLAMP_GUI -> CLAMP_GUI: Select Control Loop Type Definition for Parameterization
CLAMP_GUI -> CLAMP_Runtime: [REST] Fetch GUI fields for Common Parameter Definitions

alt Control Loop Type Definition not Commissioned on Participants
Commissioned_ACM_Inventory: Store result of Automation Composition Type Definition Update on Participant

== Supervision ==
loop forever
  CLAMP_Runtime -> Commissioned_ACM_Inventory: Read Automation Composition Type Definitions
  loop over each Automation Composition Type Definition
    alt Automation Composition Type Definition Participant priming underway
	  CLAMP_Runtime -> DatabaseCommissioned_ACM_Inventory: Read Control Loopread result of Automation Composition Type Definition Updates from participants
  CLAMP_Runtime -> CLAMP_Runtime: Generate fieldsalt forUpdates Commoncompleted Parameterson forall GUIparticipants
	    CLAMP_Runtime -> CLAMPCommissioned_ACM_GUIInventory: [REST] Return GUI fields Common Parameter Definitions
  CLAMP_GUI -> CLAMP_GUI: Render UI for Common Parameters
  CLAMP_GUI -> CLAMP_GUI: Get values for Common Parameters from user
  CLAMP_GUI -> CLAMP_Runtime: [REST] Set values for Common Parameters
  CLAMP_Runtime -> Database: Store values for Common Parameters
 set Automation Composition Type Definition as primed on Participants
      else Updates not completed
        alt Priming of Automation Composition Type Definition on participants timed out
	      CLAMP_Runtime -> Commissioned_ACM_Inventory: set Automation Composition Type Definition priming as timed out on Participants
	      CLAMP_Runtime -> CLAMP_GUI: [REST] Common Parameter values stored
else Control Loop Type Definition already Commissioned on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Cannot set Common Parameters on\nControl Loop Type Definition that has\nbeen commissioned on participants
end

@enduml

...

Runtime: Log error
        else Wait for updates to complete
        end
      end 
    else Automation Composition Type Definition Participant priming not underway
    end
  end
end
@enduml

1.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 DatabaseCommissioned_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Read ControlAutomation LoopComposition Type Definitions
CLAMP_Runtime -> DatabaseCommissioned_ACM_Inventory: Read ControlAutomation LoopComposition Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned
CLAMP_GUI -> CLAMP_GUI: Select ControlAutomation LoopComposition Type Definition for Commissioning on Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] Commission Control Loop Type Definition on Participants

alt Control Loop Type Definition not Commissioned on Participants
  CLAMP_Runtime -> Database: Read Control Loop Type Definition
 de-priming on Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] De->prime Database:Automation ReadComposition CommonType ParameterDefinition Values for Control Loopon Participants

alt Automation Composition Type Definition primed on Participants
  alt Automation Composition CommonInstances Parameterdo valuesnot setexist for ControlAutomation LoopComposition Type Definition
    CLAMP_Runtime -> Participants: [DMaaP] Update Participants, withremoving ControlAutomation LoopComposition Type Definition and values for Common Parameters
    CLAMP_Runtime -> CLAMP_GUI: [REST] ControlAutomation LoopComposition Type Definition commissioningde-priming ordered on participants
  else ControlAutomation Composition LoopInstances Typeexist Definitionfor alreadyAutomation CommissionedComposition onType ParticipantsDefinition
    CLAMP_Runtime -> CLAMP_GUI: [REST] Common Parameters not set\non Control Loop Type Definition [REST] Automation Composition Type Definition cannot be\n de-primed on participants\nit is in use on Automation Compositions
  end
else ControlAutomation LoopComposition Type Definition alreadynot Commissionedprimed on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] CannotAutomation set Common Parameters on\nControl Loop Composition Type Definition thathas hasnot\nbeen commissionedprimed on participants
end

== Participant Responses ==
Participants -> CLAMP_Runtime: [DMaaP] Result of Update withto remove ControlAutomation LoopComposition Type Definition and values for Common Parameters
CLAMP_Runtime -> DatabaseCommissioned_ACM_Inventory: Store result of ControlAutomation LoopComposition Type Definition Update on Participant

== Supervision ==
loop forever
  CLAMP_Runtime -> DatabaseCommissioned_ACM_Inventory: Read ControlAutomation LoopComposition Type Definitions
  loop over each ControlAutomation LoopComposition Type Definition
    alt ControlAutomation LoopComposition Type Definition Participant Commissionde-prime underway
	  CLAMP_Runtime -> DatabaseCommissioned_ACM_Inventory: read result of ControlAutomation LoopComposition Type Definition Updates from participants
      alt Updates completed on all participants
	    CLAMP_Runtime -> DatabaseCommissioned_ACM_Inventory: set ControlAutomation LoopComposition Type Definition as Commissionedde-primeed on Participants
      else Updates not completed
        alt CommissioningDe-priming of ControlAutomation LoopComposition Type Definition on participants timed out
	      CLAMP_Runtime -> DatabaseCommissioned_ACM_Inventory: set ControlAutomation LoopComposition Type Definition commissioningde-priming as timed out on Participants
	      CLAMP_Runtime -> CLAMP_Runtime: Log error
        else Wait for updates to complete
        end
      end 
    else ControlAutomation LoopComposition Type Definition Participant Commissionde-prime not underway
    end
  end
end
@enduml

1.

...

6 Decommissioning an Automation Composition Type Definition in CLAMP

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database DatabaseCommissioned_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Read ControlAutomation LoopComposition Type Definitions
CLAMP_Runtime -> Database> Commissioned_ACM_Inventory: Read ControlAutomation LoopComposition Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned
CLAMP_GUI -> CLAMP_GUI: Select ControlAutomation LoopComposition Type Definition for Decommissioning on Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] Decommission Control Loop Automation Composition Type Definition

alt Automation Composition Type Definition not primed on Participants
  CLAMP_Runtime -> Commissioned_ACM_Inventory: Delete Automation Composition Type Definition

alt Control Loop  CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definition Decommissioned
else Automation Composition Type Definition is Commissioned on Participants
  alt Control Loop Instances do not exist for Control Loop Type Definition
    CLAMP_Runtime -> Participants: [DMaaP] Update Participants, removing Control Loop Type Definition and values for Common Parameters
     on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Automation Composition Type Definition cannot be decommissioned\nit is primed on participants
end

@enduml

1.7 Reading Commissioned Automation Composition Type Definitions

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Commissioned_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Read Automation Composition Type Definitions
CLAMP_Runtime -> Commissioned_ACM_Inventory: Read Automation Composition Type Definitions
CLAMP_Runtime -> CLAMP_GUI: [REST] Control Loop Type Definition decommissioning ordered on participants
  else Control Loop Instances exist for Control Loop Type Definition
    CLAMP_Runtime -> CLAMP_GUI: [REST] Control Loop Type Definition cannot be\n decommissioned on participants\nit is in use on control loops
  end
else Control Loop Type Definition not Commissioned on Participants
  CLAMPDefinitions returned

@enduml

2. 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.

2.1 Creating an Automation Composition Instance

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Commissioned_ACM_Inventory
database Instantiated_ACM_Inventory

CLAMP_GUI_Runtime -> CLAMP_GUIRuntime: [REST] ControlRead Automation LoopComposition Type Definition has not\nbeen commissioned on participants
end

== Participant Responses ==
ParticipantsDefinitions
CLAMP_Runtime -> Commissioned_ACM_Inventory: Read Automation Composition Type Definitions
CLAMP_Runtime -> CLAMP_RuntimeGUI: [DMaaPREST] Result of Update to remove Control LoopType Definitions returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Type Definition and values for Common Parametersto use to create Automation Composition Instance
CLAMP_RuntimeGUI -> DatabaseCLAMP_Runtime: Store[REST] resultFetch ofGUI Controlfields Loopfor TypeInstance DefinitionSpecific Update on Participant

== Supervision ==
loop forever
  Parameter Definitions
CLAMP_Runtime -> DatabaseCommissioned_ACM_Inventory: Read ControlAutomation LoopComposition Type Definitions
  loop over each Control Loop Type Definition
    alt Control Loop Type Definition Participant decommission underway
	  CLAMP_Runtime -> Database: read result of Control Loop Type Definition Updates from participants
      alt Updates completed on all participants
	    CLAMP_Runtime -> Database: set Control Loop Type Definition as decommissioned on Participants
      else Updates not completed
        alt Commissioning of Control Loop Type Definition on participants timed out
	      CLAMP_Runtime -> Database: set Control Loop Type Definition decommissioning asDefinition
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 -> Instantiated_ACM_Inventory: 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.

2.2 Updating Instance Specific Parameters on an Automation Composition Instance

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Instantiated_ACM_Inventory

CLAMP_GUI timed out on Participants
	      CLAMP_Runtime -> CLAMP_Runtime: Log error
        else Wait for updates to complete
        end
      end 
    else Control Loop Type Definition Participant decommission not underway
    end
  end
end
@enduml

1.6 Decommissioning a Control Loop Type Definition in CLAMP

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Database

[REST] Read Automation Composition Instances
CLAMP_Runtime -> Instantiated_ACM_Inventory: 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] Read Control Loop Type Fetch GUI fields for Instance Specific Parameter Definitions
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read ControlAutomation LoopComposition Type DefinitionsDefinition
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returnedRuntime: Generate fields for Instance Specific Parameters for GUI
CLAMP_GUIRuntime -> CLAMP_GUI: Select Control Loop Type Definition for Decommissioning[REST] Return GUI fields Instance Specific Parameter Definitions
CLAMP_GUI -> CLAMP_RuntimeGUI: [REST]Render DecommissionUI Controlfor LoopInstance TypeSpecific Definition

alt Control Loop Type Definition not Commissioned on Participants
  CLAMP_Runtime -> Database: Delete Control Loop Type Definition
  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_GUIRuntime: [REST]Update TypeAutomation DefinitionComposition Decommissioned
else Control Loop Type Definition not Commissioned on Participants
  Instance
CLAMP_Runtime -> Instantiated_ACM_Inventory: Store New Version of Automation Composition Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] ControlAutomation Loop Type Definition cannot be decommissioned\nit is commissioned on participants
endComposition Instance Updated

@enduml

...

2.3 Updating an Automation Composition Instance with a Configuration on Participants

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database DatabaseInstantiated_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Read Control Loop Type Definitionsall configuration versions of Automation Composition Instance
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read Control Loop Type Definitions all configuration versions of Automation Composition Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] Type Definitions returned

@enduml

2. Instantiation Dialogues

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

2.1 Creating a Control Loop Instance

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Database

] 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] Read Control Loop Type Definitions
CLAMP_Runtime -> Database: Read Control Loop Type Definitions
 Instantiate selected configuration version of Automation Composition Instance on Participants

alt Selected configuration version of Automation Composition Instance not instantiated on Participants
  CLAMP_Runtime -> CLAMPInstantiated_ACM_GUIInventory: [REST] Type Definitions returned
CLAMP_GUI Read configuration version of Automation Composition Instance
  CLAMP_Runtime -> CLAMP_GUIParticipants: Select[DMaaP] ControlUpdate LoopParticipants Typewith Definitionconfiguration toversion useof toAutomation createComposition ControlInstance
 Loop Instance
CLAMP_GUIRuntime -> CLAMP_RuntimeGUI: [REST] FetchInstantiation GUIof fieldsconfiguration forversion Instanceof SpecificAutomation Parameter Definitions
CLAMP_Runtime -> Database: Read Control Loop Type Definition
CLAMP_Runtime -> CLAMP_Runtime: Generate fields for Instance Specific Parameters for GUI
Composition Instance ordered on participants
else Selected configuration version of Automation Composition Instance instantiated on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Return GUI fields Instance Specific Parameter Definitions
CLAMP_GUIconfiguration version of Automation Composition Instance already instantiated on participants 
end

== Participant Responses ==
Participants -> CLAMP_GUIRuntime: Render[DMaaP] UIResult forof Instanceupdate Specific Parameters
CLAMP_GUI -> CLAMP_GUI: Get values for Instance Specific Parameters from user
CLAMP_GUIof configuration version of Automation Composition Instance on participant
CLAMP_Runtime -> CLAMPInstantiated_ACM_RuntimeInventory: [REST] Request Creation Store result of update of configuration version of ControlAutomation LoopComposition Instance on participant

== Supervision ==
loop forever
  CLAMP_Runtime -> CLAMPInstantiated_ACM_RuntimeInventory: CreateRead ControlAutomation LoopComposition Instance
CLAMP_Runtime -> Database: Store First Version of Control Loop Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] Control Loop Instance Updated

@enduml

2.2 Updating Instance Specific Parameters on a Control Loop Instance

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Database

CLAMP_GUI -> CLAMP_Runtime: [REST] Read Control Loop Instances
CLAMP_Runtime -> Database: Read Control Loop Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] Control Loop Instances returned
CLAMP_GUI -> CLAMP_GUI: Select Control Loop Instance on which to Update Parameters
CLAMP_GUI -> CLAMP_GUI: Step version of Control Loop Instance as Major/Minor/Patch
CLAMP_GUI -> CLAMP_Runtime: [REST] Fetch GUI fields for Instance Specific Parameter Definitions
CLAMP_Runtime -> Database: Read Control Loop Type Definition
Instances
  loop over each Automation Composition Instance
    alt Automation Composition Instance configuration version update underway on participants
	  CLAMP_Runtime -> Instantiated_ACM_Inventory: read result of Automation Composition updates from participants
      alt Updates completed on all participants
	    CLAMP_Runtime -> Instantiated_ACM_Inventory: set configuration version of Automation Composition Instance as Instantiated on Participants
	    CLAMP_Runtime -> Instantiated_ACM_Inventory: set overall configuration version of Automation Composition Instance state as Instantiated
      else Updates not completed
        alt Instantiation of Automation Composition Instance on participants timed out
	      CLAMP_Runtime -> CLAMPInstantiated_ACM_RuntimeInventory: Generateset fieldsconfiguration forversion InstanceAutomation SpecificComposition ParametersInstance for GUI
CLAMP_Runtime -> CLAMP_GUI: [REST] Return GUI fields Instance Specific Parameter Definitions
CLAMP_GUIInstantiation as timed out on Participants
	      CLAMP_Runtime -> CLAMP_GUIRuntime: 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 Control Loop Instance
CLAMP_Runtime -> CLAMP_Runtime: Update Control Loop Instance
CLAMP_Runtime -> Database: Store New Version of Control Loop Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] Control Loop Instance Updated

@enduml

...

 Log error
        else Wait for updates to complete
        end
      end 
    else Automation Composition Instance configuration version update on participants not underway
    end
  end
end
@enduml

2.4 Changing the state of an Automation Composition Instance on Participants

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database DatabaseInstantiated_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Read all versionsInstantiated ofAutomation ControlComposition Loop InstanceInstances
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read all versionsInstantiated ofAutomation ControlComposition Loop InstanceInstances
CLAMP_Runtime -> CLAMP_GUI: [REST] All versionsInstantiated ofAutomation ControlComposition LoopInstances Instance returned
CLAMP_GUI -> CLAMP_GUI: Select version of Control Loop Instance for Instantiation Participants Automation Composition Instance on which to change state and specify new state
CLAMP_GUI -> CLAMP_Runtime: [REST] InstantiateChange selected versionstate of Controlselected Loop Instance on Participants

alt Selected version of Control Loop Instance not instantiatedAutomation Composition Instance on Participants

alt Selected CLAMP_Runtime -> Database: Read version of Control Loop InstanceAutomation Composition Instance instantiated on Participants
  CLAMP_Runtime -> Participants: [DMaaP] UpdateRequest Participantschange withof versionstate of ControlAutomation LoopComposition Instance
  CLAMP_Runtime -> CLAMP_GUI: [REST] InstantiationChange of Versionstate of ControlAutomation LoopComposition Instance ordered on participants
else Selected versionAutomation ofComposition ControlInstance Loop Instancenot instantiated on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] Version of Control LoopAutomation Composition Instance alreadynot instantiated on participants 
end

== Participant Responses ==
Participants -> CLAMP_Runtime: [DMaaP] Result of updateState ofChange version of ControlAutomation LoopComposition Instance on participant
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Store result of updateState of versionChange of ControlAutomation LoopComposition Instance on participant

== Supervision ==
loop forever
  CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read ControlAutomation LoopComposition Instances
  loop over each ControlAutomation LoopComposition Instance
    alt ControlAutomation LoopComposition Instance InstantiationState updateChange underway on participants
	  CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: read result of ControlAutomation Composition LoopState updatesChange from participants
      alt Updates completed on all participants
	    CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: set versionAutomation ofComposition ControlInstance Loop Instancestate as Instantiatedchanged on Participants
	    CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: set overall version of Control LoopAutomation Composition Instance state as Instantiatedchanged
      else Updates not completed
        alt InstantiationAutomation ofComposition ControlInstance LoopState InstanceChange on participants timed out
	      CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: set versionAutomation ControlComposition LoopState InstanceChange Instantiation as timed out on Participants
	      CLAMP_Runtime -> CLAMP_Runtime: Log error
        else Wait for updates to complete
        end
      end 
    else ControlAutomation LoopComposition Instance InstantiationState updateChange on participants not underway
    end
  end
end
@enduml

2.5

...

De-instantiating an Automation Composition Instance from Participants

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database DatabaseInstantiated_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Read all Instantiated ControlAutomation LoopComposition Instances
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read all Instantiated ControlAutomation LoopComposition Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] All Instantiated ControlAutomation LoopComposition Instances returned
CLAMP_GUI -> CLAMP_GUI: Select ControlAutomation LoopComposition Instance on which to change state and specify new stateto de-instantiate
CLAMP_GUI -> CLAMP_Runtime: [REST] Change state of De-instantiate selected ControlAutomation LoopComposition Instance on Participants

alt Selected ControlAutomation LoopComposition Instance instantiated on Participants
  CLAMP_Runtime -> Participants: [DMaaP] RequestUpdate changeParticipants ofto stateremove ofAutomation Control LoopComposition Instance
  CLAMP_Runtime -> CLAMP_GUI: [REST] ChangeDe-instantiation of state of Control LoopAutomation Composition Instance ordered on participants
else Selected ControlAutomation LoopComposition Instance not instantiated on Participants
  CLAMP_Runtime -> CLAMP_GUI: [REST] ControlAutomation LoopComposition Instance not instantiated on participants 
end

== Participant Responses ==
Participants -> CLAMP_Runtime: [DMaaP] Result of State Changeupdate of ControlAutomation LoopComposition Instance on participant
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Store result of State Changeupdate of ControlAutomation LoopComposition Instance on participant

== Supervision ==
loop forever
  CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read ControlAutomation LoopComposition Instances
  loop over each Control Loop Instance
    alt Control Loop Instance State Change underway on participants
	  CLAMP_Runtime -> Database: read result of Control Loop State Change from participants
      alt Updates completed on all participants
	    CLAMP_Runtime -> Database: set Control Loop Instance state as changed on Participants
	     each Automation Composition Instance
    alt Automation Composition Instance de-instantiation update underway on participants
	  CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: setread overallresult Controlof LoopAutomation InstanceComposition stateupdates asfrom changedparticipants
      elsealt Updates not completed
        alt Control Loop Instance State Change on participants timed outon all participants
	      CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: set ControlAutomation LoopComposition State ChangeInstance as timed outde-instantiated on Participants
	      CLAMP_Runtime -> CLAMPInstantiated_ACM_RuntimeInventory: set Logoverall error
Automation Composition Instance as de-instantiated
    else Wait forelse updatesUpdates tonot completecompleted
        end
alt Automation Composition Instance de-instantiation Update endtimed 
out on participants
	  else Control Loop Instance State Change on participants not underway
    end
  end
end
@enduml

2.6 De-instantiating a Control Loop Instance from Participants

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
participant Participant
database Database

CLAMP_GUICLAMP_Runtime -> Instantiated_ACM_Inventory: set Automation Composition Instance de-instantiation as timed out on Participants
	      CLAMP_Runtime -> CLAMP_Runtime: [REST] Read all Instantiated Control Loop Instances
CLAMP_Runtime -> Database: Read all Instantiated Control Loop Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] All Instantiated Control Loop Instances returned
CLAMP_GUI -> CLAMP_GUI: Log error
        else Wait for updates to complete
        end
      end 
    else Automation Composition Instance de-instantiation update on participants not underway
    end
  end
@enduml

2.6 Deleting an Automation Composition Instance

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime

database Instantiated_ACM_Inventory
 Select Control Loop Instance to de-instantiate
CLAMP_GUI -> CLAMP_Runtime: [REST] De-instantiateRead selectedall ControlAutomation Loop Instance on Participants

alt Selected Control Loop Instance instantiated on Participants
  Composition Instances
CLAMP_Runtime -> Instantiated_ACM_Inventory: Read all Automation Composition Instances
CLAMP_Runtime -> ParticipantsCLAMP_GUI: [DMaaP] Update Participants to remove Control Loop Instance
  CLAMP_RuntimeREST] All Automation Composition Instances returned
CLAMP_GUI -> CLAMP_GUI: Select Automation Composition Instance to delete
CLAMP_GUI -> CLAMP_GUIRuntime: [REST] De-instantiationDelete ofselected ControlAutomation LoopComposition Instance ordered on participants
else

alt Selected ControlAutomation LoopComposition Instance not instantiated on Participantsexists
  CLAMP_Runtime -> CLAMPInstantiated_ACM_GUI: [REST] Control Loop Instance not instantiated on participants 
end

== Participant Responses ==
ParticipantsInventory: Delete Automation Composition instance
  CLAMP_Runtime -> CLAMP_RuntimeGUI: [DMaaPREST] ResultAutomation Composition ofInstance updatedeleted
else ofSelected ControlAutomation LoopComposition Instance does onnot participantexist
  CLAMP_Runtime -> DatabaseCLAMP_GUI: Store[REST] resultAutomation ofComposition updateInstance ofdoes Controlnot Loop Instance on participant

== Supervision ==
loop forever
  CLAMP_Runtime -> Database: Read Control Loop Instances
  loop over each Control Loop Instance
    alt Control Loop Instance de-instantiation update underway on participants
	  CLAMP_Runtime -> Database: read result of Control Loop updates from participants
      alt Updates completed on all participants
	    exist 
end

@enduml

2.7 Reading Automation Composition Instances

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Instantiated_ACM_Inventory

CLAMP_GUI -> CLAMP_Runtime: [REST] Read all Automation Composition Instances
CLAMP_Runtime -> Instantiated_ACM_Inventory: 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

PlantUML Macro
@startuml
participant CLAMP_Runtime
participant Participant
database Instantiated_ACM_Inventory

Participant -> CLAMP_Runtime: [DMaaP] Participant and Automation Composition Element Monitoring and Statistics report
CLAMP_Runtime -> Database: set Control Loop Instance as de-instantiated on Participants
	  Instantiated_ACM_Inventory: Store Participant and Automation Composition Element Monitoring and Statistics report

alt Fault reported on Participant
  CLAMP_Runtime -> DatabaseCLAMP_Runtime: setlog overallfault Controlon LoopParticipant
 Instance asCLAMP_Runtime de-instantiated
      else Updates not completed
      > Instantiated_ACM_Inventory: Record fault on Participant
end

loop Over all Automation Composition Elements in Participant Report
  alt ControlFault Loopreported Instanceon de-instantiationAutomation Update timed out on participants
	Composition Element
      CLAMP_Runtime -> DatabaseCLAMP_Runtime: set Control Loop Instance de-instantiation as timed out on Participants
	     log fault on Automation Composition Element and Automation Composition     CLAMP_Runtime -> CLAMPInstantiated_ACM_Runtime: Log error
        else Wait for updates to complete
        end
      end 
    else Control Loop Instance de-instantiation update on participants not underway
    end
  end
@enduml

2.7 Deleting a Control Loop Instance

Inventory: Record fault on Automation Composition Element and Automation Composition   end
end
@enduml

3.2 Viewing of Monitoring Information

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Instantiated_ACM_Inventory

== Overview of all Automation Composition Instances ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read all Automation Composition Instances
CLAMP_Runtime -> Instantiated_ACM_Inventory: Read all Automation Composition Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] All Automation Composition Instances returned
CLAMP_GUI -> CLAMP_GUI: Display overview of status of all Automation Composition Instances

== Details of a Automation Composition Instance ==
PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime

database Database

CLAMP_GUI -> CLAMP_Runtime: [REST] Read all Control Loop Instances Automation Composition Elements for Automation Composition Instance
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read all Control Loop Instances Automation Composition Elements for Automation Composition Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] AllAutomation ControlComposition Loop InstancesElements returned
CLAMP_GUI -> CLAMP_GUI: Select Control Loop Instance to delete
CLAMP_GUI -> CLAMP_Runtime: [REST] Delete selected Control Loop Instance

alt Selected Control Loop Instance exists
  Display status of Automation Composition Elements in Automation Composition Instance

== Overview of all Participants ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read all participants
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: DeleteRead controlall loop instanceparticipants
  CLAMP_Runtime -> CLAMP_GUI: [REST] ControlAll Loop Instance deleted
else Selected Control Loop Instance does not exist
  CLAMP_Runtimeparticipants returned
CLAMP_GUI -> CLAMP_GUI: [REST]Display Controloverview Loopof Instancestatus doesof notall exist participants
end

@enduml

2.8 Reading Control Loop Instances

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database Database


== Details of a Participant ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read allAutomation Composition ControlElements Loopfor InstancesParticipant
CLAMP_Runtime -> Database: Read all Control Loop Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] All Control Loop Instances returned

@enduml

3. Monitoring Dialogues

Monitoring dialogues are used to monitor and to read statistics on Control Loop Instances.

3.1 Reporting of Monitoring Information and Statistics by Participants

PlantUML Macro
@startuml
participant CLAMP_Runtime
participant Participant
database Database

Participant Instantiated_ACM_Inventory: Read Automation Composition Elements for Participant
CLAMP_Runtime -> CLAMP_RuntimeGUI: [DMaaPREST] ParticipantAutomation andComposition Control Loop Element Monitoring and Statistics reportElements returned
CLAMP_RuntimeGUI -> DatabaseCLAMP_GUI: StoreDisplay Participantstatus andof ControlAutomation LoopComposition ElementElements Monitoring and Statistics reportin Participant

alt== FaultFiltered reported on Participant
  Monitoring ==
CLAMP_RuntimeGUI -> CLAMP_Runtime: log fault on Participant
  CLAMP_RuntimeGUI: Set filter for Automation Composition Instances, Automation Composition Elements, and Participants
CLAMP_GUI -> DatabaseCLAMP_Runtime: Record[REST] faultRead on Participant
end

loop Over all Control Loop Elements in Participant Report
  alt Fault reported on Control Loop Element
    Automation Composition Elements that match filter
CLAMP_Runtime -> Instantiated_ACM_Inventory: Read Automation Composition Elements that match filter
CLAMP_Runtime -> CLAMP_RuntimeGUI: log[REST] faultAutomation onComposition ControlElements Loopthat Elementmatch andfilter Control Loop
    returned
CLAMP_RuntimeGUI -> Database: Record fault on Control Loop Element and Control Loop
  end
endCLAMP_GUI: Display status of Automation Composition Elements that match filter

@enduml

3.2 Viewing of

...

Statistics

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database DatabaseInstantiated_ACM_Inventory

== OverviewStatistics of all ControlAutomation LoopComposition Instances ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read summary statistics for all ControlAutomation LoopComposition Instances
CLAMP_Runtime -> Database: ReadInstantiated_ACM_Inventory: Compile summary statistics for all ControlAutomation LoopComposition Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] All Control Loop Summary statistics for all Automation Composition Instances returned
CLAMP_GUI -> CLAMP_GUI: Display overviewsummary ofstatistics statusfor of all ControlAutomation LoopComposition Instances

== DetailsStatistics of a ControlAutomation LoopComposition Instance ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read statistics Controlfor Automation LoopComposition Elements for ControlAutomation LoopComposition Instance
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read Control LoopCompile statistics for Automation Composition Elements for ControlAutomation LoopComposition Instance
CLAMP_Runtime -> CLAMP_GUI: [REST] Statistics for ControlAutomation LoopComposition Elements returned
CLAMP_GUI -> CLAMP_GUI: Display statusstatistics offor ControlAutomation LoopComposition Elements in ControlAutomation LoopComposition Instance

== OverviewStatistics of all Participants ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read summary statistics for all Automation Composition participantsInstances
CLAMP_Runtime -> Database: ReadInstantiated_ACM_Inventory: Compile summary statistics for all participantsAutomation Composition Instances
CLAMP_Runtime -> CLAMP_GUI: [REST] All participants Summary statistics for all Automation Composition Instances returned
CLAMP_GUI -> CLAMP_GUI: Display summary overviewstatistics offor statusall ofAutomation allComposition participantsInstances

== DetailsStatistics of a Participant ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read statistics Controlfor Automation LoopComposition Elements for Participant
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read statistics Controlfor Automation LoopComposition Elements for Participant
CLAMP_Runtime -> CLAMP_GUI: [REST] Statistics for ControlAutomation LoopComposition Elements returned
CLAMP_GUI -> CLAMP_GUI: Display statusstatistics offor ControlAutomation LoopComposition Elements in Participant

== Filtered MonitoringStatistics ==
CLAMP_GUI -> CLAMP_GUI: Set filter for ControlAutomation LoopComposition Instances, ControlAutomation LoopComposition Elements, and Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] Read statistics for ControlAutomation LoopComposition Elements that match filter
CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Read statistics for ControlAutomation LoopComposition Elements that match filter
CLAMP_Runtime -> CLAMP_GUI: [REST] Control LoopStatistics for Automation Composition Elements that match filter returned
CLAMP_GUI -> CLAMP_GUI: Display statusstatistics offor ControlAutomation LoopComposition Elements that match filter

@enduml

3.

...

3 Statistics Housekeeping

PlantUML Macro
@startuml
participant CLAMP_GUI
participant CLAMP_Runtime
database DatabaseInstantiated_ACM_Inventory

== StatisticsAutomation ofComposition all Control Loop InstancesInstance Statistics ==

loop forever
  CLAMP_GUIRuntime -> CLAMPInstantiated_ACM_RuntimeInventory: [REST] Read summaryAutomation statisticsComposition for all Control Loop Instances
Instance Statistics
  CLAMP_Runtime -> DatabaseCLAMP_Runtime: CompileSummarise summaryAutomation statisticsComposition for all Control Loop Instances
Instance Statistics
  CLAMP_Runtime -> CLAMPInstantiated_ACM_GUIInventory: [REST]Store Summarysummarised statisticsAutomation forComposition all Control Loop Instances returned
CLAMP_GUIInstance Statistics
  CLAMP_Runtime -> CLAMP_GUI: Display summary statistics for all Control Loop InstancesInstantiated_ACM_Inventory: Delete Automation Composition Instance Statistics on which retention period has expired
end

== Participant Statistics of a Control Loop Instance ==
CLAMP_GUI==

loop forever
  CLAMP_Runtime -> CLAMPInstantiated_ACM_RuntimeInventory: [REST] Read statistics for Control Loop Elements for Control Loop Instance
Participant Statistics
  CLAMP_Runtime -> DatabaseCLAMP_Runtime: CompileSummarise statistics for Control Loop Elements for Control Loop Instance
Participant Statistics
  CLAMP_Runtime -> CLAMP_GUI: [REST] Statistics for Control Loop Elements returned
CLAMP_GUIInstantiated_ACM_Inventory: Store summarised Participant Statistics
  CLAMP_Runtime -> CLAMPInstantiated_ACM_GUIInventory: DisplayDelete statisticsParticipant forStatistics Controlon Loopwhich Elementsretention inperiod Control Loop Instance

== Statistics of all Participants ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read summary statistics for all Control Loop Instances
CLAMP_Runtime -> Database: Compile summary statistics for all Control Loop Instances
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 Instantiated_ACM_Inventory

loop forever
  CLAMP_Runtime -> Instantiated_ACM_Inventory: Read Participants
  loop Over each Participant
    alt Participant has not reported in last reporting window
       CLAMP_Runtime -> CLAMP_GUI: [REST] Summary statistics for all Control Loop Instances returned
CLAMP_GUIRuntime: Log Participant as having missed a report
       CLAMP_Runtime -> CLAMPInstantiated_ACM_GUIInventory: DisplayIncrement summarymissed statistics for all Control Loop Instances

== Statistics of a Participant ==
CLAMP_GUI -> CLAMP_Runtime: [REST] Read statistics for Control Loop Elements for Participant
CLAMP_Runtime -> Database: Read statistics for Control Loop Elements for Participant
report counter on Participant
       alt Participant has exceeded alarm threshold on missed report counter
          CLAMP_Runtime -> CLAMP_GUIRuntime: [REST]Raise Statisticsa forParticipant ControlOffline Loopalarm Elementson returned
CLAMP_GUI -> CLAMP_GUI: Display statistics for Control Loop Elements in Participant

== Filtered Statistics ==
CLAMP_GUIparticipant
          CLAMP_Runtime -> CLAMPInstantiated_ACM_GUIInventory: Mark Setparticipant filteras forbeing Controloffline
 Loop Instances, Control Loop Elements, and Participants
CLAMP_GUI -> CLAMP_Runtime: [REST] Read statistics for Control Loop Elements that match filter
end
    else Participant has reported in last reporting window
       CLAMP_Runtime -> Database: Read statistics for Control Loop Elements that match filter
CLAMP_Runtime -> CLAMP_GUI: [REST] Statistics for Control Loop Elements that match filter returned
CLAMP_GUIInstantiated_ACM_Inventory: Clear missed report counter on Participant
       alt Participant marked as being offline
          CLAMP_Runtime -> CLAMP_GUIRuntime: DisplayClear statisticsParticipant forOffline Controlalarm Loop Elements that match filter

@enduml

3.3 Statistics Housekeeping

PlantUML Macro
@startuml
participant CLAMP_Runtime
database Database

== Control Loop Instance Statistics ==

loop forever
on participant
          CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: ReadMark Controlparticipant Loopas Instancebeing Statisticsonline
  CLAMP_Runtime -> CLAMP_Runtime: Summarise Control Loop Instance Statisticsend
  CLAMP_Runtime -> Database:end
 Store summarised Control Loop Instance Statistics end
end

@enduml

4.2 Supervise Automation Compositions

PlantUML Macro
@startuml
participant CLAMP_Runtime
database Instantiated_ACM_Inventory

loop forever
  CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: DeleteRead ControlAutomation LoopComposition InstanceInstances
 Statistics onloop whichOver retentioneach period has expired
end

== Participant Statistics ==

loop foreverAutomation Composition Instance
  CLAMP_Runtime -> Database:loop ReadOver Participanteach Statistics
Automation Composition CLAMP_Runtime -> CLAMP_Runtime: Summarise Participant Statistics
  CLAMP_Runtime -> Database: Store summarised Participant Statistics
  CLAMP_Runtime -> Database: Delete Participant Statistics on which retention period has expired
end

@enduml

4. Supervision Dialogues

Supervision dialogues are used to check the state of Control Loop Instances and Participants.

4.1 Supervise Participants

PlantUML Macro
@startuml
participant CLAMP_Runtime
database Database

loop forever
Element
      alt Automation Composition Element has not reported in last reporting window
         CLAMP_Runtime -> CLAMP_Runtime: Log Automation Composition Element as having missed a report
         CLAMP_Runtime -> Database: Read Participants
  loop Over each Participant
Instantiated_ACM_Inventory: Increment missed report counter on Automation Composition Element
      alt Participantelse Automation Composition Element has not reported in last reporting window
         CLAMP_Runtime -> CLAMPInstantiated_ACM_Runtime: Log Participant as having missed a reportInventory: Clear missed report counter on Automation Composition Element
      end
       CLAMP_Runtime -> Database: Increment missed report counter on Participantalt Automation Composition Element in incorrect state in last reporting window
       alt Participant has exceeded alarm threshold on missed report counter
   CLAMP_Runtime -> CLAMP_Runtime: Log Automation Composition Element as being in incorrect state
        CLAMP_Runtime -> CLAMPInstantiated_ACM_RuntimeInventory: Raise a Participant Offline alarm on participantRecord Automation Composition Element as being in incorrect state
      else Automation Composition Element CLAMP_Runtime -> Database: Mark participant as being offlinenot in incorrect state in last reporting window
       end
 alt Automation Composition elseElement Participantwas hasin reportedincorrect instate laston reportingprevious windowreport
          CLAMP_Runtime -> DatabaseCLAMP_Runtime: ClearLog missedAutomation reportComposition counterElement onas Participant
being in      alt Participant marked as being offlinecorrect state
          CLAMP_Runtime -> CLAMPInstantiated_ACM_RuntimeInventory: Clear Participant Offline alarm on participantRecord Automation Composition Element as being in correct state
        end
   CLAMP_Runtime -> Database: Markend
 participant as being online
  alt Automation Composition Element reported end
fault in last reporting endwindow
  end
end

@enduml

4.2 Supervise Control Loops

PlantUML Macro
@startuml
participant CLAMP_Runtime
database Database

loop forever
      CLAMP_Runtime -> Database: Read Control Loop Instances
  loop Over each Control Loop Instance
    loop Over each Control Loop ElementCLAMP_Runtime: Log Automation Composition Element as being faulty
        CLAMP_Runtime -> Instantiated_ACM_Inventory: Record Automation Composition Element as being faulty
      altelse ControlAutomation LoopComposition Element hasdid not report reportedfault in last reporting window
        alt CLAMP_Runtime -> CLAMP_Runtime: Log Control Loop Element as having missed aAutomation Composition Element reported fault on previous report
          CLAMP_Runtime -> DatabaseCLAMP_Runtime: IncrementLog missedAutomation reportComposition counterElement onfault Controlas Loop Elementcleared
      else Control Loop Element has reported in last reporting window
         CLAMP_Runtime -> Database: Clear missed report counter on Control Loop ElementCLAMP_Runtime -> Instantiated_ACM_Inventory: Mark fault Automation Composition Element as being cleared
        end
      end
    end
    alt ControlAutomation LoopComposition Element in incorrect state in last reporting window
   Automation Composition Instance has exceeded alarm threshold on missed report counter
      CLAMP_Runtime -> CLAMP_Runtime: LogRaise a ControlAutomation LoopComposition ElementOffline asalarm beingon inAutomation incorrectComposition stateInstance
        CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: RecordMark ControlAutomation LoopComposition ElementInstance as being in incorrect stateoffline
    else No elseAutomation Control LoopComposition Element notin inAutomation incorrectComposition stateInstance inhas lastexceeded reportingalarm window
threshold on missed report counter
    alt Control Loop Elementalt wasAutomation inComposition incorrectInstance statemarked onas previousbeing reportoffline
          CLAMP_Runtime -> CLAMP_Runtime: LogClear ControlAutomation LoopComposition ElementInstance asOffline beingalarm inon correctAutomation state
Composition               CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: RecordMark ControlAutomation LoopComposition ElementInstance as being in correct stateonline
        end
    end
  end
  alt Automation Composition Element in altAutomation ControlComposition LoopInstance Elementin reportedincorrect faultstate in last reporting window
        CLAMP_Runtime -> CLAMP_Runtime: Log ControlAutomation LoopComposition ElementInstance as being faulty
  in incorrect state
      CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Record ControlAutomation LoopComposition ElementInstance as being in faultyincorrect state
      elsealt ControlAutomation LoopComposition Element did not report fault in lastAutomation reportingComposition window
Instance has exceeded alarm threshold on incorrect  alt Control Loop Element reported fault on previous report
  state reports
        CLAMP_Runtime -> CLAMP_Runtime: Log Control Loop Element fault as cleared
  Raise a Automation Composition Instance in Incorrect State alarm on Automation Composition Instance
        CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Mark fault ControlAutomation LoopComposition ElementInstance as being cleared
in an incorrect state
      end
    else No  end
    endAutomation Composition Element in incorrect state in last reporting window
      alt ControlAutomation LoopComposition Element in ControlAutomation LoopComposition Instance haswas exceededin alarmincorrect thresholdstate on missedprevious report
  counter
      CLAMP_Runtime -> CLAMP_Runtime: RaiseLog Automation aComposition ControlInstance Loopas Offlinebeing alarmin oncorrect Controlstate
 Loop Instance
      CLAMP_Runtime -> Database: Mark Control Loop Instance as being offline
    else No Control Loop Element in Control Loop Instance has exceeded alarm threshold on missed report counter
       alt Control Loop Instance marked as being offlineInstantiated_ACM_Inventory: 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 ControlAutomation LoopComposition Instance in OfflineIncorrect State alarm on ControlAutomation Composition LoopInstance
          CLAMP_Runtime -> Database: Mark Control Loop Instance as being online
 end
      end
    end
    alt ControlAutomation LoopComposition Element in ControlAutomation LoopComposition Instance inreported incorrecta statefault in last reporting window
      CLAMP_Runtime -> CLAMP_Runtime: Log ControlAutomation LoopComposition Instance as being in incorrect statefaulty
      CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Record ControlAutomation LoopComposition Instance as being in incorrect statefaulty
      alt ControlAutomation LoopComposition Element in ControlAutomation LoopComposition Instance has exceeded alarm threshold on incorrect statefaulty reports
        CLAMP_Runtime -> CLAMP_Runtime: Raise a ControlAutomation LoopComposition Instance inFaulty Incorrect State alarm on Control Loop Instance
        CLAMP_Runtime -> Database: Mark Control Loop Instance as being in an incorrect stateAutomation Composition Instance
      end
    else No ControlAutomation LoopComposition Element infaulty incorrect state in last reporting window
      alt ControlAutomation LoopComposition Element in ControlAutomation LoopComposition Instance was in incorrect statefaulty on previous report
        CLAMP_Runtime -> CLAMP_Runtime: Log ControlAutomation LoopComposition Instance as being infault correct statefree
        CLAMP_Runtime -> DatabaseInstantiated_ACM_Inventory: Record ControlAutomation LoopComposition Instance as being infault correct statefree
        alt ControlAutomation LoopComposition Instance inFaulty Incorrect State alarm raised on ControlAutomation LoopComposition Instance
          CLAMP_Runtime -> CLAMP_Runtime: Clear ControlAutomation LoopComposition Instance inFaulty Incorrect State alarm on Control Loop Instance
          CLAMP_Runtime -> Database: Mark Control Loop Instance as being in correct stateAutomation Composition Instance
        end
      end
    end
  end
end

@enduml

...