smia.logic.services_utils module

This class contains methods related to service management. It contains all type of services proposed in the Functional View of RAMI 4.0.

class smia.logic.services_utils.AgentServiceUtils[source]

Bases: object

This class contains utility methods related to the Agent Services.

async static get_agent_service_parameters(service_method)[source]

This method gets the required information about the parameters of the agent service: the names and types of service method parameters.

Parameters:

service_method (method) – method of the agent service.

Returns:

dictionary with all information about the parameters of the agent service.

Return type:

dict

async static get_adapted_service_parameters(service_method, **kwargs)[source]

This method adapts the received parameters values to the required types of the service method, in order to be correctly executed.

Parameters:
  • service_method (method) – method of the agent service.

  • **kwargs – received parameters with the values.

Returns:

parameters correctly adapted to the method.

Return type:

dict

async static safe_execute_agent_service(service_method, **kwargs)[source]

This method executes the agent service securely, regardless of the execution method, synchronous or asynchronous.

Parameters:
  • service_method – executable method of the agent service.

  • **kwargs – in case the execution method has parameters, they are passed as kwargs.

Returns:

result of the execution of the agent service.

class smia.logic.services_utils.SubmodelServicesUtils[source]

Bases: object