Introduction

We will introduce you how does the Engine Executor is handling InBounds, Services and OutBounds.

There are two type of executions :

  • Fixed methods
  • Dynamic methods

Fixed Methods

They are methods that are called on precise events. For example, a service execution is considered has a fixed method. (IService.serviceRun). If you endorse a class, you will have to implement these fixed methods.

Dynamic Methods

These are more ready to serve methods. If you are intrested with being hooked in the engine at one step, we can do it with JAVA annotations and so. We are calling these elements Listeners.

Listeners are organized so that they cover all the execution cycle.

Listener

Process

  • Prepare : IServicePrepare (Listener)
  • Creation : IServiceCreate (Listener) - The result will be set into created
  • Configuration : IServiceConfigure (Listener) - The result will be set into configured
  • Initialization : IServiceInitialize (Listener) - The result will be set into initialized
  • Begin Engine : IServiceEngineSetup (Listener)
    • Begin Inbound : IServiceSetupInBound (Listener)
      • ? Handle InBound => COND-INBOUND ? : IServiceExecuteInBoundProcess (Listener)
        • Pre InBound : IServicePreInBound (Listener)
        • Initiate InBoundContexts : inbound.initiateContext (Fixed)
        • Post InBound : IServicePostInBound (Listener)
    • End Inbound : IServiceDoneInBound (Listener)
    • § For each InBoundContext §
      • Create Execution Context : IServiceCreateExecutionContext (Listener)
      • Begin Main : IServiceSetupMain (Listener)
        • ? Handle Main => COND-MAIN ? IServiceExecuteRunProcess (Listener)
          • Pre Main : IServicePreMain (Listener)
          • Run Main : service.serviceRun (Fixed)
          • Post Main : IServicePostMain (Listener)
      • End Main : IServiceDoneMain (Listener)
      • ? NOT COND-MAIN ?
        • Evicting of Execution Context : IServiceEviced (Listener)
          • ? If OK Evicted ?
            • InBound Finish State OK : IServiceFinishRejectedInBound (Listener)
          • ? IF KO Evicted ?
            • InBound Finish State KO : IServiceFinishRejectedInBound (Listener)
      • ? COND-MAIN ?
        • Begin OutBound : IServiceSetupOutBound (Listener)
          • ? Handle OutBound ? IServiceExecuteOutBoundProcess (Listener)
            • § For each OutBoundContext §
              • Pre Outbound : IServicePreOutBound (Listener)
              • Run Outbound : outbound.serviceRun (Fixed)
              • Post Outbound : IServicePostOutBound (Listener)
              • OutBound Finish State XXXX : IServiceFinishXXXXOutBound (Listener)
              • OutBound Finish State : IServiceFinishOutBound (Listener)
        • End OutBound : IServiceDoneOutBound (Listener)
        • InBound Finish State YYYY : IServiceFinishYYYYInBound (Listener)
      • InBound Finish State : IServiceFinishInBound (Listener)
      • Destroy Execution Context : IServiceDestroyExecutionContext (Listener)
  • End of Engine : IServiceEngineDone (Listener)

Error Management

We will present you here 4 types of Errors Management, handled by 4 Listeners

An Errors can be represented by :

  • A Normal Exception : A simple Java Exception. They represent a expectable fault or error in the process.
  • A Runtime Exception : A simple Throwable extended from RuntimeException (Java Type). They represent not expected errors, sometime unrecoverable.

General Error Management

For each type of Error, and before going into each error management process, the Engine will execute these commands :

  • ? errorCompoment.isFatalError => COND-FATAL-ERROR ?
    • Stop Execution of Engine and go Directly to Critical Error Management
  • ? Not COND-FATAL-ERROR ?
    • Continue Execution by going to the right Error Management

Engine Error Management

These can happen during Begin and End of Engine or whatever process that is not related to Inbound/Main/OutBound

  • ? If Normal Exception ?
    • ? Handle Engine Error => COND-ERROR-ENGINE ?
      • Continuing normal execution
    • ? Not COND-ERROR-ENGINE ?
      • Refer to Critical Error Management
  • ? If Runtime Exception ?
    • Refer to Panic Critical Management

InBound Error Management

Here is the process concerning Errors that are occurring during InBound Process, that is to say InBound Implementation execution.

So During Run InBound

  • ? If Normal Exception ?
    • ? Handle InBound Error => COND-ERROR-INBOUND ?
      • Continuing normal execution with no InBoundContexts
    • ? Not COND-ERROR-INBOUND ?
      • Refer to Panic Error Management
  • ? If Runtime Exception ?
    • Refer to Panic Error Management

Main Error Management

Here is the process concerning Errors that are occurring during Main Process, that is to say Service Implementation execution.

So During Run Main

  • ? If Normal Exception ?
    • ? Handle Main Error => COND-ERROR-MAIN ?
      • Continuing normal execution
    • ? Not COND-ERROR-MAIN ?
      • Continuing normal execution with No OutBound Context and YYYY=KO
  • ? If Runtime Exception ?
    • Continuing normal execution with No OutBound Context and YYYY=Fatal

OutBount Error Management

Here is the process concerning Errors that are occurring during Outbound Process, that is to say OutBound Implementation execution.

So During OutBound Main

  • ? If Normal Exception ?
    • ? Handle OutBound Error => COND-ERROR-OUTBOUND ?
      • Continuing normal execution
    • ? Not COND-ERROR-OUTBOUND ?
      • Continuing normal execution with No OutBound Context and XXXX=KO
  • ? If Runtime Exception ?
    • Continuing normal execution with No OutBound Context and XXXX=Fatal

Critic Error Management

This is the Critical Error management, where an error is really important that it interrupt the normal process of the Engine Executor.

  • ? Not errorComponent.handleCritic ?
    • Critical report
    • Stop All InBounds
    • ? If Error ?
      • ? Not errorComponent.handlePanic ?
        • Emergency Stop All InBounds

Details

Phases Content
Fetus Phase
The Fetus phase correspondent to a non execution process. It is not done by the Engine Executor, but it has to be done to make the ServiceContainer ready.
Preparation Before calling Create, we prepare a ServiceContainer.
Creation We Create a Service Container and we initialize to default any of its data.
Configuration After Filling in configuration, we configure the ServiceContainer so that It can adjust its self. At the same time, we do validate its configuration.
Initialization Here, we prepare the ServiceContainer to be Executed.
Engine Phase
Begin Engine Beginning of the Executor Engine.
End Of Engine Ending of the Executor Engine.
InBound Phase
Begin InBound Beginning of the InBound phase.
Handle InBound Here, we are listening to the Listener return Value to decide to continue or not.
Pre InBound Called before Initiate InBoundContexts.
Initiate InBoundContexts Here, the Inbound Implementation will retrieve all the InboundContexts that need to be run.
Post InBound Called after Initiate InBoundContexts, if no error had occurred.
End InBound Ending of InBoudn phase.
Main Phase
For each InBoundContext For each InBoundContexts retrieved from Initiate InBoundContexts.
Create Execution Context Considering an InBoundContext, we create a ExecutionContext.
Begin Main Beginning of Main Phase.
Handle Main Here, we are listening to the Listener return Value to decide to continue or not.
Pre Main Called before Running Main.
Run Main Running Main with the Execution Context.
Post Main Called after Running Main if no error had occurred.
Evicting of Execution Context Called when Handle Main returned false, that is to say that we should refuse the received InBound.
InBound Finish State YYYY Considering the state of Finish, we call the right Fixed and Listener Method
InBound Finish State Saying that we are ending Finish Main
End Main Ending Main Phase
OutBound Phase
Begin OutBound Beginning of OutBound Phase.
Handle OutBound Here, we are listening to the Listener return Value to decide to continue or not.
For each OutBoundContext A Service can create as many OutBoundContext as it want. So for each one, we should call OubBound Execution.
Pre Outbound Called before OutBound Run.
Run Outbound Running the OutBound with the OutBound Context.
Post Outbound Called After OutBound Run if no error occurred.
OutBound Finish State XXXX The state of Finish of the execution of OutBound.
OutBound Finish State Finish the State Finish.
End OutBound Ending of OutBound Phase.