Package org.eclipse.viatra.transformation.evm.api

## Class ScheduledExecution

- java.lang.Object
- - org.eclipse.viatra.transformation.evm.api.ScheduledExecution

-     public class ScheduledExecution
      extends java.lang.Object

  The Scheduled Execution is responsible for firing enabled activations of its `RuleBase`, when its `Scheduler` notifies it.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ScheduledExecution​(EventRealm eventRealm)` | Creates an execution for the given `EventRealm`.
    `ScheduledExecution​(EventRealm eventRealm, Agenda agenda, IExecutor executor)` | Creates an execution for the given `EventRealm`, `Executor` and `Agenda`.
    `ScheduledExecution​(RuleBase ruleBase, IExecutor executor)` | Creates an execution for the given `Executor` and `RuleBase`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `dispose()` | Disposes of the execution by disposing its ruleBase.
    `protected void` | `endScheduling()` | This method is called by schedule() to indicate that the firing strategy is finished its execution.
    `IExecutor` | `getExecutor()` |
    `RuleBase` | `getRuleBase()` |
    `protected void` | `schedule()` |
    `protected boolean` | `startScheduling()` | This method is called from schedule() to indicate that a new call was received.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ScheduledExecution

          public ScheduledExecution​(EventRealm eventRealm,
                                    Agenda agenda,
                                    IExecutor executor)

      Creates an execution for the given `EventRealm`, `Executor` and `Agenda`. Executions are usually created as part of an ExecutionSchema through the EventDrivenVM.createExecutionSchema methods.
      Parameters:
        `eventRealm` -
        `executor` -
        `agenda` -

    - #### ScheduledExecution

          public ScheduledExecution​(EventRealm eventRealm)

      Creates an execution for the given `EventRealm`. Executions are usually created as part of an ExecutionSchema through the EventDrivenVM.createExecutionSchema methods.
      Parameters:
        `eventRealm` -
        `executor` -
        `agenda` -

    - #### ScheduledExecution

          public ScheduledExecution​(RuleBase ruleBase,
                                    IExecutor executor)

      Creates an execution for the given `Executor` and `RuleBase`. Executions are usually created as part of an ExecutionSchema through the EventDrivenVM.createExecutionSchema methods.
      Parameters:
        `eventRealm` -
        `executor` -
        `ruleBase` -

  - ### Method Detail

    - #### getRuleBase

          public RuleBase getRuleBase()

    - #### getExecutor

          public IExecutor getExecutor()

    - #### schedule

          protected void schedule()

    - #### startScheduling

          protected boolean startScheduling()

      This method is called from schedule() to indicate that a new call was received. If there is already scheduling in progress, that is logged and false is returned. Otherwise, a new scheduling starts, which is logged and stored.
      Returns:
        true, if the firing strategy can start, false otherwise

    - #### endScheduling

          protected void endScheduling()

      This method is called by schedule() to indicate that the firing strategy is finished its execution. This is logged and the scheduling state is set to false.

    - #### dispose

          protected void dispose()

      Disposes of the execution by disposing its ruleBase.