Versions Compared

Key

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

...

PlantUML Macro
@startuml

participant Participant
participant ACM_Runtime
database ACM_Database

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

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

@enduml

1.2 Deregister a Participant

...

PlantUML Macro
@startuml

participant Participant
participant ACM_Runtime
database ACM_Database

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

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

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

...

PlantUML Macro
@startuml

participant Participant
participant ACM_Runtime
database ACM_Database

loop Every Participant Supervision Interval
 Participant -> ACM_Runtime: [ASYNC] Heartbeat message including\nstatus ofand 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_Runtime -> ACM_Database: Mark AC Element Instance as ONLINE\nand Update AC Element Instance status
 end
end

@enduml

...

The ACM runtime regularly checks the heartbeat reports from participants and takes action of 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 Over all Participants
    ACM_Runtime -> Database: Read Participant Heartbeat Information
    alt Participant Heartbeat not received in Timeout Interval
      ACM_Runtime -> ACM_Database: Set Participant State as OFFLINE
      ACM_Runtime -> ACM_Runtime: Mark all ACM Element Instances\nrunning on Participant as OfflineOFFLINE
      activate ACM_Runtime
      deactivate ACM_Runtime
    end
  end
end

@enduml

...

PlantUML Macro
@startuml

participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Get Participant Information
ACM_Runtime -> ACM_Database: Read Participant Data
REST <- ACM_Runtime: Return Participant Information including\nsupported ACMAC Element Types,\nAC Element Instances and Heartbeat their states\nand Heartbeat Information

@enduml

1.5 Order Full Participant Report

...

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 -> ACM_Database: Set Automation Composition Type State to COMMISSIONED
 ACM_Runtime -> REST: Automation Composition Type Commissioned
end

@enduml

...

PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Decommission Automation Composition Type
alt Automation Composition Type has Instances is not in state COMMISSIONED
  ACM_Runtime -> REST: Automation Composition Type Decommissioning Failed
else
 ACM_Runtime -> ACM_Database: Delete Automation Composition Type
 ACM_Runtime -> REST: Automation Composition Type Decommissioned 
end

@enduml

...

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

== Priming REST Request ==

REST ->alt Automation Composition Type has Deployed Instances
  REST <- ACM_Runtime: Priming Primeof Automation Composition Type

ACM_Runtime -> ACM_Database: Read Failed, instances deployed
else Automation Composition Type
ACM_Runtime is in state COMMISSIONED or PRIMED
 REST -> ParticipantACM_Runtime: Prime [ASYNC]Automation SendComposition Priming Request to all Participants\nwithType

 ACM_Runtime -> ACM_Database: Read Automation Composition Type Definition

REST <-
 ACM_Runtime -> ACM_Database: Read Participants
 ACM_Runtime -> ACM_Runtime: PrimingSet ofsuitable Automationparticipant Composition Type Ordered

@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] Bring AC Element Instances for this AC Instance into Service 

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 in service
   ACM_Runtime <- Participant: [ASYNC] WARN: AC Element is already in service
  else
   Participant -> Participant: Bring AC Element Instance into Service
   activate Participant
   deactivate Participant
   alt AC Element came into service successfully
    ACM_Runtime <- Participant: [ASYNC] INFO: AC Element brought into service
   else
    ACM_Runtime <- Participant: [ASYNC] ERROR: AC Element was not brought into service
   end
  end
 else
  note left of participant
   ignore this AC Element instance as its for another participant 
  end note
 end
end

@enduml

2.5 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 -> ACM_Database: Read Automation Composition Type Information
ACM_Runtime -> REST: Respond with Automation Composition Type information\nincluding ACM Element Type information and Priming Status

@enduml

3. Instantiation Dialogues

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

3.1 Create or Update an Automation Composition Instance

Create on a POST and update on a PUT.

ID on each AC Element Type

 alt Was a sutable participant ID found for each AC Element Type?
  ACM_Runtime -> Participant: [ASYNC] Send Priming Request to all Participants\nwith Automation Composition Type Definition
  ACM_Runtime -> ACM_Database: Set Automation Composition Type State to PRIMING

  REST <- ACM_Runtime: Priming of Automation Composition Type Ordered
 else
   REST <- ACM_Runtime: Priming of Automation Composition 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_Runtime -> ACM_Database: Record result of AC Element Type Priming

alt Is AC Element Type Primed?
 alt Have all the other AC Element Types in this AC Type been Primed?
  ACM_Runtime -> ACM_Runtime: Set AC Type state as PRIMED
  end
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 Type has Instances
  REST <- ACM_Runtime: Depriming of Automation Composition Type Failed
else AC Type State is PRIMED or PRIMING
 REST -> ACM_Runtime: Deprime Automation Composition Type

 ACM_Runtime -> ACM_Database: Read Automation Composition Type
 ACM_Runtime -> Participant: [ASYNC] Send Depriming Request to all Participants\nwith Automation Composition Type Definition
 ACM_Runtime -> ACM_Database: Set Automation Composition Type State to DEPRIMING

 REST <- ACM_Runtime: Depriming of Automation Composition Type Ordered
else 
 REST <- ACM_Runtime: Depriming 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 deprimed.


PlantUML Macro
@startuml
participant ACM_Runtime
participant 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_Runtime
participant Participant
database ACM_Database

ACM_Runtime <- Participant: [ASYNC] Result of Depriming of AC Element Type
ACM_Runtime -> ACM_Database: Record 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_Runtime: Set AC Type state as COMMISSIONED
 end
end

@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 -> ACM_Database: Read Automation Composition Type Information
ACM_Runtime -> REST: Respond with Automation Composition Type information\nincluding ACM Element Type information and Priming Status

@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 REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Create Automation Composition Instance for\nspecified Automation Composition Type with\nspecified parameter values

alt Automation Composition Instance exists
 alt Automation Composition Instance is not in state UNDEPLOYED
  ACM_Runtime -> REST: Automation Composition instance 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: Set Automation Composition Instance State to UNDEPLOYED
  ACM_Runtime -> REST: Automation Composition Instance Created
 else
  ACM_Runtime -> REST: Automation Composition Type is not in state PRIMED
 end
else
PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
database ACM_Database

REST -> ACM_Runtime: Create Automation Composition Instance for\nspecified Automation Composition Type with\nspecified parameter values

alt Automation Composition Instance exists
 alt Automation Composition Instance is already deployed
  ACM_Runtime -> REST: Automation Composition instanceType existsis 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 Type Composition Exists
 alt Specified Automation Composition Type is Primednot 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 -> ACM_DatabaseREST: Store Automation Composition Instanceinstance exists and is deployed
 else
  ACM_Runtime -> REST: Automation Composition instance does Instancenot Createdexist
 end
else
  ACM_Runtime -> RESTACM_Database: Delete Automation Composition Type is not primedInstance
 end
else
  ACM_Runtime -> REST: Automation Composition Type is not foundInstance 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 REST
participant ACM_Runtime
participant Participants
database ACM_Database 

REST -> ACM_Runtime: Deploy Automation Composition Instance
ACM_Runtime -> ACM_Database: DeleteRead Automation Composition Instance Information

alt Automation Composition Instance exists
 alt Automation Composition Instance is deployed
  ACM_Runtime -> REST: Automation Composition instance existsis andalready is deployed
 else
  ACM_Runtime -> Participants: [ASYNC] Deploy AC Element Instances for this AC Instance
  ACM_Runtime -> RESTACM_Database: Automation Composition instance does not exist
 end
else
Set AC Instance and its AC Element Instances to state DEPLOYING
  ACM_Runtime -> ACM_DatabaseREST: DeleteDeployment of Automation Composition Instance has been requested
 end
else
  ACM_Runtime -> REST: Automation Composition Instance Deletedinstance does not exist
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 ParticipantsEach participant deploys its AC Element Instances from the AC Instance.


PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
participant ParticipantsParticipant
databaseparticipant ACMParticipant_Database API

RESTACM_Runtime -> ACM_Runtime: Deploy Automation Composition Instance
ACM_Runtime -> ACM_Database: Read Automation Composition Instance Information

alt Automation Composition Instance exists
 alt Automation Composition Instance is deployed
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 <-> RESTParticipant: Automation Composition instance [ASYNC] WARN: AC Element is already deployed
  else
   Participant -> Participant_API: Deploy AC Element Instance
  ACM_Runtime -> REST: Automation Composition instance does not exist
 end
else
 ACM_Runtime -> Participants: [ASYNC] Deploy activate Participant_API
   Participant <- Participant_API: AC Element Instance Deploy Response
   deactivate Participant_API
   alt AC Element Instancesdeployed forsuccessfully
 this AC Instance
 ACM_RuntimeParticipant -> ACM_DatabaseParticipant: MarkSet AC Element Instance andadministrative itsstate ACto ElementLOCKED
 Instances as Deploying
 ACM_Runtime <-> RESTParticipant: Deployment of Automation Composition Instance[ASYNC] INFO: AC Element has been requested
end

@enduml

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

PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant
participant Participant_API

deployed
   else
    ACM_Runtime <-> Participant: [ASYNC] DeployERROR: AC Element Instanceswas fornot thisdeployed
 AC Instance 
end
loop over AC Element Instances in AC Instanceend
 else
 alt Doesnote theleft primedof Participant
 ID  onIgnore this AC Element Instance\nmatchinstance myas Participantits ID?
for another altparticipant Is
 this ACend Element Instance already deployed
   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] WARN: AC Element is already deployed
  else
   ParticipantDeploy Automation Composition Element Instance Response
ACM_Runtime -> ParticipantACM_APIDatabase: DeployStore Automation ACComposition Element Instance Response Information

alt Is AC activate Participant_API
   Participant <- Participant_API: Element Instance Deployed?
 ACM_Runtime -> ACM_Database: Set AC Element Instance DeployState as Response
   deactivate Participant_API
   alt AC Element deployed successfully
    Participant -> ParticipantDEPLOYED
 alt Are all the other AC Element Instances in this AC Instance in state DEPLOYED?
  ACM_Runtime -> ACM_Runtime: Set AC ElementInstance Instancestate administrativeas state to LOCKED
   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_Runtime <- Participant: [ASYNC] INFO: AC Element has been deployed
   else
    Undeploy Automation Composition Instance
ACM_Runtime <-> ParticipantACM_Database: [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
Read Automation Composition Instance 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: Store[ASYNC] AutomationUndeploy CompositionAC Element InstanceInstances Response Information

alt Is for this AC Element Instance Deployed?
 ACM_Runtime -> ACM_Database: SetMark this AC Element Instance administrative state as LOCKED
 alt Have all the otherand its AC Element Instances in this AC Instance been deployed?as UNDEPLOYING
  ACM_Runtime -> ACM_RuntimeREST: Set ACUndeployment Instanceof administrativeAutomation stateComposition asInstance LOCKED
has been endrequested
end

@enduml

3.4 Undeploy Automation Composition Instance


Each participant undeploys its AC Element Instances from the AC InstanceThe 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 ParticipantsParticipant
databaseparticipant ACMParticipant_Database API

RESTACM_Runtime -> ACM_Runtime: Undeploy Automation Composition Instance
ACM_Runtime -> ACM_Database: Read Automation Composition Instance 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
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 <-> RESTParticipant: Automation Composition instance[ASYNC] WARN: AC Element does not exist
  end
else
 ACM_Runtime -> Participants: [ASYNC] Undeploy Is this administrative state of this AC Element InstancesInstance forLOCKED
 this AC Instance
 ACM_Runtime Participant -> ACMParticipant_DatabaseAPI: Mark thisUndeploy AC Instance and its AC Element Instances as UndeployingInstance
 ACM_Runtime -> REST: Undeployment of Automation Composition Instance has been requested
end

@enduml

Each participant undeploys its AC Element Instances from the AC Instance

PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant
participantactivate Participant_API
   Participant <- Participant_API: Undeploy AC Element Instance Response
   deactivate Participant_API

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

loop overINFO: AC Element Instancesundeployed insuccessfully
 AC Instance
 altnote Doesleft the primedof Participant
 ID on this ACUndeploy Elementalways Instance\nmatch my Participant ID?returns success
  alt Does this AC Element Instance exist?
end note
  else
    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 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_Runtime -> ACM_Database: Store Automation Composition Element Instance Response Information

alt Is AC Element Instance deactivateundeployed?
 ParticipantACM_API
Runtime -> ACM_Database: altMark AC Element Instance undeployedas successfullyUNDEPLOYED
  alt  ACM_Runtime <- Participant: [ASYNC] INFO: AC Element undeployed successfully
   else
 Are all the other AC Element Instances in this AC Instance in state UNDEPLOYED?
   ACM_Runtime <-> ParticipantACM_Runtime: [ASYNC] ERROR: Set AC ElementInstance wasstate notas undeployedUNDEPLOYED
   end
end

@enduml

3.5 Read Automation Composition Instances

PlantUML Macro
@startuml
participant  else
    REST
participant ACM_Runtime
database ACM_Database

REST -> 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

@endumlGet Automation Composition Instance Information 
ACM_Runtime -> ACM_Database: 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 ParticipantsThe ACM Runtime receives and stores the responses.


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

REST -> ACM_Runtime <- Participant: [ASYNC] Undeploy: Unlock Automation Composition Instance
ACM_Runtime -> ACM_Database: Read Automation Composition Instance Information

alt Automation Composition Element Instance exists
 alt Automation Composition Instance Response
administrative state is LOCKED
  ACM_Runtime -> ACM_DatabaseParticipants: Store[ASYNC] AutomationUnlock CompositionAC Element InstanceInstances Response Information

alt Is AC Elementfor this AC Instance
 undeployed?
 ACM_Runtime -> ACM_Database: Mark AC Instance and its AC Element InstanceInstances as Undeployed
end

@enduml

3.5 Read Automation Composition Instances

PlantUML Macro
@startuml
participant REST
participantUnlocking
  ACM_Runtime
database ACM_Database

REST -> ACM_RuntimeREST: GetUnlocking of Automation Composition Instance Information 
 Composition Instance has been requested
 else
  ACM_Runtime -> ACM_DatabaseREST: Read Automation Composition Instance Information
 instance is not locked
 end
else
  ACM_Runtime -> REST: Respond with Automation Composition Instanceinstance information\nincludingdoes ACM Element Instance information\nand admin, operational, and usage state

@enduml

3.6 Unlock Automation Composition Instance

not exist
end

@enduml


Each participant unlocks its AC Element Instances from the AC InstanceThe 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 ParticipantsParticipant
databaseparticipant ACMParticipant_Database API

RESTACM_Runtime -> ACM_Runtime: Unlock Automation Composition Instance
ACM_Runtime -> ACM_Database: Read Automation Composition Instance Information

alt Automation Composition Instance exists
 alt Automation CompositionParticipant: [ASYNC] Unlock 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 administrative state isnot LOCKED
   ACM_Runtime <-> ParticipantsParticipant: [ASYNC] UnlockWARN: AC Element Instances for thisis not LOCKED
  else
   Participant -> Participant_API: Unlock AC Element Instance
   activate Participant_API
   ACM_RuntimeParticipant <-> ACMParticipant_DatabaseAPI: Mark AC Instance and its Unlock AC Element InstancesInstance as UnlockingResponse
  ACM_Runtime -> REST: Unlocking of Automation Composition Instance has been requested
 else
  ACM_Runtimedeactivate Participant_API
   alt AC Element unlocked successfully
    Participant -> RESTParticipant: Set AC AutomationElement CompositionInstance instanceadministrative isstate notto lockedUNLOCKED
 end
else
   ACM_Runtime <-> RESTParticipant: 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

 [ASYNC] INFO: AC Element has been unlocked
   else
    ACM_Runtime <-> Participant: [ASYNC] UnlockERROR: AC Element Instanceswas fornot thisunlocked
 AC Instance 

loop over AC Element Instances in AC Instance
 alt Does the primed Participant ID onend
  end
 else
  note left of participant
   Ignore this AC Element Instance\nmatchinstance myas Participantits ID?
for another altparticipant Is
 this ACend Element Instance administrative state not LOCKED
   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] WARN: ACUnlock Automation Composition Element isInstance not LOCKED
  else
   Participant Response
ACM_Runtime -> ParticipantACM_APIDatabase: UnlockStore Automation ACComposition Element Instance Response Information

alt Is AC Element activate Participant_APIInstance Unlocked?
   Participant <- Participant_API: UnlockACM_Runtime -> ACM_Database: Set AC Element Instance Response
   deactivate Participant_API
   alt AC Element unlocked successfully
    Participant -> Participantadministrative state as UNLOCKED
 alt Have all the other AC Element Instances in this AC Instance been UNLOCKED?
  ACM_Runtime -> ACM_Runtime: Set AC Element Instance administrative state to UNLOCKED
    ACM_Runtime <- Participant: [ASYNC] INFO: AC Element has been unlocked
   else
    ACM_Runtime <- Participant: [ASYNC] ERROR: AC Element was not unlocked
   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.

 as UNLOCKED
  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 ACM_Database 

REST -> ACM_Runtime: Lock Automation Composition Instance
ACM_Runtime -> ACM_Database: Read Automation Composition Instance 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
  
PlantUML Macro
@startuml

participant ACM_Runtime
participant Participant
database ACM_Database 

ACM_Runtime <- Participant: [ASYNC] Unlock Automation Composition Element Instance Response
ACM_Runtime -> ACM_Database: StoreMark AutomationAC Composition Element Instance Response Information

alt Is and its AC Element Instances Instanceas Unlocked?Locking
  ACM_Runtime -> ACM_DatabaseREST: SetLocking of ACAutomation ElementComposition Instance administrativehas statebeen asrequested
 UNLOCKEDelse
 alt Have all the other AC Element Instances in this AC Instance been UNLOCKED?ACM_Runtime -> REST: Automation Composition instance is not unlocked
 end
else
  ACM_Runtime -> ACM_RuntimeREST: SetAutomation ACComposition Instanceinstance administrativedoes state as UNLOCKED
  endnot exist
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 ParticipantsEach participant locks its AC Element Instances from the AC Instance.


PlantUML Macro
@startuml
participant REST
participant ACM_Runtime
participant ParticipantsParticipant
databaseparticipant ACMParticipant_Database API

RESTACM_Runtime -> ACM_Runtime:Participant: [ASYNC] Lock AutomationAC Composition Instance
ACM_Runtime -> ACM_Database: Read Automation CompositionElement Instances for this AC Instance Information

altloop Automationover CompositionAC InstanceElement exists
Instances altin Automation CompositionAC Instance administrative state is UNLOCKED
  ACM_Runtime -> Participants: [ASYNC] Lock AC Element Instances foralt Does the primed Participant ID on this AC Element Instance
\nmatch my ACM_Runtime -> ACM_Database: Mark AC Instance and its AC Element Instances as Locking
  Participant ID?
  alt Is this AC Element Instance administrative state not UNLOCKED
   ACM_Runtime <-> RESTParticipant: Locking of Automation Composition Instance has been requested
[ASYNC] WARN: AC Element is not UNLOCKED
  else
  ACM_Runtime Participant -> REST: Automation Composition instance is not unlocked
 end
else
  ACM_Runtime Participant: Set AC Element Instance administrative state to SHUTTING_DOWN
   Participant -> RESTParticipant_API: AutomationLock CompositionAC instance does not exist
end

@enduml

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

PlantUML Macro
@startuml
participant ACM_Runtime
participant Participant
participantElement Instance
   activate Participant_API

ACM_Runtime ->   Participant <- Participant_API: [ASYNC] Lock AC Element InstancesInstance forResponse
 this AC Instancedeactivate 

loop overParticipant_API
   alt AC Element Instances in AC Instancelocked successfully
 alt Does the primed Participant ID-> onParticipant: thisSet AC Element Instance\nmatch administrative mystate Participantto ID?
  alt Is thisLOCKED
    ACM_Runtime <- Participant: [ASYNC] INFO: AC Element Instance administrative state not UNLOCKED
has been locked
   else
    ACM_Runtime <- Participant: [ASYNC] WARNERROR: AC Element iswas not UNLOCKEDlocked
   end
  end
 else
  note left of participant
 Participant -> Participant:Ignore Setthis AC Element Instanceinstance administrativeas stateits to SHUTTING_DOWN
   Participant -> Participant_API: Lock AC Element Instance
   activate Participant_API
   Participantfor 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_API: [ASYNC] Lock ACAutomation Composition Element Instance Response
ACM_Runtime -> ACM_Database: Store Automation deactivate Participant_API
   alt Composition Element Instance Response Information

alt Is AC Element lockedInstance successfullyLocked?
    Participant ACM_Runtime -> ParticipantACM_Database: Set AC Element Instance administrative state toas LOCKED
    ACM_Runtime <- Participant: [ASYNC] INFO:alt Have all the other AC Element Instances hasin beenthis locked
AC Instance been elseLOCKED?
    ACM_Runtime <-> ParticipantACM_Runtime: [ASYNC] ERROR: AC Element was not lockedSet AC Instance administrative state as 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.



@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_Runtime: [ASYNC] Heartbeat message including\nstatus and states of AC Element Instances on Participant 

@enduml

3.9 Update Usage State on Automation Composition Instance

PlantUML Macro
@startuml
participant Participant_API
participant Participant
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
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: Store Automation Composition Element Instance Response Information

alt Is AC Element Instance Locked?
 ACM_Runtime -> ACM_Database: Set AC Element Instance administrative state as LOCKED
 alt Have all the other AC Element Instances in this AC Instance been LOCKED?
  ACM_Runtime -> ACM_Runtime: Set AC Instance administrative state as LOCKED
  end
end [ASYNC] Heartbeat message including\nstatus and states of AC Element Instances on Participant 

@enduml