IExecutable

Interface that allows you to create a component that can be called to execute work.

Description

The IExecutable interface allows you to create a component that can be called to execute work.

Instance methods

execute

Executes a component with arguments and receives the execution result.

execute(context: IContext, args: Parameters)

  • context: IContext - (optional) a context to trace execution through a call chain.
  • args: Parameters - execution arguments.

Examples

class EchoComponent(IExecutable):
    ...
    def execute(self, context: Optional[IContext], args: Parameters): 
        result = args.get_as_object("message")
        return result
    
echo = new EchoComponent()
message = "Test";
result = echo.execute("123", Parameters.from_tuples("message", message))
print("Request: " + message + " Response: " + result)

See also