AAS Operations#

In industrial environments, Asset Administration Shells need to represent not only static data and properties but also dynamic behaviors and functions. Operations in AAS provide a standardized way to expose callable functions that are relevant in the context of a specific asset or its Digital Twin. These operations enable interaction with assets, execution of commands, and implementation of business logic that goes beyond simple data access.

While the Asset Administration Shell itself is primarily a data structure, it can reference operations that trigger actual functionality. BaSyx addresses this challenge through operation delegation, where operations defined in AAS Submodels can be delegated to external services that provide the actual implementation. This approach enables distributed, service-oriented architectures while maintaining the standardized AAS interface.

Operation delegation is particularly valuable in scenarios where different services or systems are responsible for different aspects of an asset’s functionality. Using qualifiers, the AAS can specify endpoints to external operation executors, creating a flexible and scalable architecture for Digital Twin implementations.

Note

A comprehensive example demonstrating AAS operation delegation is available in the Examples on GitHub. Feel free to try it out yourself!

Operation Delegation Architecture#

The following diagram illustrates how operation delegation works in the BaSyx ecosystem:

@startuml
rectangle "Client Application" as client

package "BaSyx" {
    rectangle "AAS Environment" as aasenv
    rectangle "Submodel Service" as smservice
}

rectangle "External Operation Service" as opservice

client -down-> aasenv : Call Operation
aasenv -down-> smservice : Invoke Operation

smservice -right-> opservice : HTTP Request\n(Delegated Execution)
smservice -up-> aasenv : Return Result
aasenv -up-> client : Operation Response

note bottom of opservice
  External Service:
  • Implements actual logic
  • Processes operation parameters
  • Executes business logic
  • Returns structured results
end note

note right of aasenv
  AAS Operation Definition:
  • Input/Output variables
  • Delegation qualifiers
  • Endpoint configuration
  • Security settings
end note
@enduml

Operation Execution Flow#

The sequence diagram below shows the detailed process of how operations are delegated and executed:

@startuml
participant "Client Application" as client
participant "AAS Environment" as aasenv
participant "Submodel Service" as smservice
participant "External Operation Service" as opservice

client -> aasenv : POST /invoke
activate aasenv

aasenv -> smservice : Invoke Operation
activate smservice

smservice -> smservice : Parse Operation Definition
smservice -> smservice : Extract Delegation Qualifier

smservice -> opservice : POST /calculate-efficiency
activate opservice

opservice -> opservice : Execute Business Logic
opservice -> opservice : Process Input Parameters
opservice -> opservice : Calculate Results

opservice -> smservice : Return Operation Results
deactivate opservice

smservice -> aasenv : Return Response
deactivate smservice

aasenv -> client : HTTP 200 OK\n(Operation Results)
deactivate aasenv

note over smservice
  Delegation Process:
  1. Parse operation qualifiers
  2. Extract endpoint URL
  3. Transform parameters
  4. Forward HTTP request
  5. Handle response
end note

note over opservice
  External Service Logic:
  • Receives standard HTTP request
  • Processes operation parameters
  • Executes domain-specific logic
  • Returns standardized response
end note

note over client
  Operation Invocation:
  • Standard AAS API call
  • Transparent delegation
  • Consistent response format
  • Error handling
end note
@enduml

Operation Types and Use Cases#

Here are some possible Operations and their use cases:

Simple Operations#

  • Simple Calculations: Mathematical operations on AAS properties

  • Data Validation: Verify data integrity and constraints

  • State Transitions: Change asset states based on predefined rules

  • Configuration Updates: Modify asset configuration parameters

Complex Operations#

  • Asset Control: Send commands to physical assets or control systems

  • Complex Analytics: Perform computationally intensive analysis

  • External System Integration: Interact with ERP, MES, or other enterprise systems

  • Machine Learning Inference: Execute AI models for predictive analytics

Operation Delegation Mechanism#

Qualifier-based Endpoint Configuration#

BaSyx uses qualifiers to specify how and where operations should be executed:

{
  "modelType": "Operation",
  "idShort": "CalculateEfficiency",
  "qualifiers": [
    {
      "kind": "ConceptQualifier",
      "type": "invocationDelegation",
      "valueType": "xs:string",
      "value": "http://localhost:8087/operations/calculate-efficiency"
    }
  ],
  "inputVariables": [
    {
      "modelType": "OperationVariable",
      "value": {
        "modelType": "Property",
        "idShort": "ProductionRate",
        "valueType": "xs:double"
      }
    }
  ],
  "outputVariables": [
    {
      "modelType": "OperationVariable", 
      "value": {
        "modelType": "Property",
        "idShort": "EfficiencyScore",
        "valueType": "xs:double"
      }
    }
  ]
}

Delegation Process#

  1. Operation Invocation: Client calls operation through standard AAS API

  2. Qualifier Resolution: BaSyx extracts delegation endpoint from qualifiers

  3. Request Forwarding: Operation request is forwarded to external service

  4. Execution: External service performs the actual operation logic

  5. Response Handling: Results are returned through the standard AAS interface

Industrial Use Cases#

Manufacturing Process Control#

Operations enable direct control of manufacturing processes:

  • Production Line Control: Start, stop, and configure production lines

  • Quality Checks: Trigger inspection procedures and validation routines

  • Maintenance Operations: Schedule and execute maintenance procedures

  • Recipe Management: Load and execute production recipes

Asset Monitoring and Diagnostics#

Operations can trigger monitoring and diagnostic functions:

  • Health Checks: Assess asset condition and performance

  • Diagnostic Routines: Run specialized diagnostic procedures

  • Calibration: Execute sensor and actuator calibration sequences

  • Performance Analysis: Calculate efficiency and performance metrics

Integration with External Systems#

Delegated operations enable seamless integration:

  • ERP Integration: Trigger business processes in enterprise systems

  • Workflow Orchestration: Initiate complex multi-step workflows

  • Data Synchronization: Synchronize data with external databases

  • Notification Services: Send alerts and notifications to external systems

Service-Oriented Architecture Benefits#

Distributed Functionality#

  • Separation of Concerns: Different services handle different aspects of functionality

  • Independent Scaling: Scale operation services independently based on demand

  • Technology Diversity: Use different technologies for different operation types

  • Service Reusability: Share operation implementations across multiple AAS instances

Fault Tolerance and Resilience#

  • Service Isolation: Failures in one service don’t affect others

  • Redundancy: Deploy multiple instances of critical operation services

  • Circuit Breakers: Protect against cascading failures

  • Graceful Degradation: Continue operating with reduced functionality when services are unavailable

Development and Deployment Flexibility#

  • Independent Development: Teams can develop operation services independently

  • Continuous Deployment: Update operation logic without affecting AAS structure

  • Testing Isolation: Test operation services in isolation

  • Version Management: Manage different versions of operation implementations

Getting Started with AAS Operations#

Basic Operation Implementation#

Start with simple operations to understand the concept:

  • Define operations in AAS Submodels

  • Implement basic operation logic

  • Test operation invocation through AAS API

  • Understand input/output parameter handling

Operation Delegation Setup#

Explore delegation capabilities:

  • Configure delegation qualifiers

  • Implement external operation services

  • Set up service discovery and routing

  • Handle error scenarios and timeouts

BaSyx Operation Delegation Example Setup#

To run the example containers, you need to have Docker installed on your device.

How to start the example containers#

  1. Open a terminal in this folder

  2. Run the following command to start the BaSyx containers:

docker-compose up -d

Access the BaSyx containers#

How to use#

  1. Open the AAS Web GUI Screenshot of the AAS Web GUI showcasing the Operation

  2. Open the Operation

  3. Enter a value and execute

Advanced Operation Patterns#

Asynchronous Operations#

  • Long-running Processes: Handle operations that take significant time to complete

  • Status Polling: Provide status updates for ongoing operations

  • Callback Mechanisms: Notify clients when operations complete

  • Queue Management: Manage operation queues for high-load scenarios

Composite Operations#

  • Workflow Orchestration: Combine multiple operations into complex workflows

  • Transaction Management: Ensure consistency across multiple operation calls

  • Parallel Execution: Execute multiple operations concurrently

  • Conditional Logic: Implement branching and conditional operation execution

Security and Access Control#

  • Operation Authorization: Control who can execute specific operations

  • Parameter Validation: Validate operation inputs for security and consistency

  • Audit Logging: Track operation executions for compliance and debugging

  • Rate Limiting: Prevent abuse and ensure fair resource usage

Additional Resources#

For more information about AAS operations and delegation in BaSyx: