org.eclipse.viatra.integration.mwe2.mwe2impl

## Class Conditional

- java.lang.Object
- - org.eclipse.viatra.integration.mwe2.mwe2impl.Conditional

- All Implemented Interfaces:
    ITransformationStep

      public class Conditional
      extends java.lang.Object
      implements ITransformationStep

  Composite transformation step that implements an IF style conditional construction. The condition is specified by an IConditionProvider which enables the specification of dynamically evaluated conditions. If the condition evaluation returns true, the ifTrue step is executed, if otherwise, the ifFalse step is executed. Note: As the condition is evaluated runtime, both of the steps is initialized.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected IConditionProvider` | `condition`
    `protected org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext` | `ctx`
    `protected ITransformationStep` | `ifFalse`
    `protected ITransformationStep` | `ifTrue`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Conditional()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dispose()` If the transformation step contains any resources that need to be disposed of, it can be done here.
    `void` | `execute()` Defines the added functionality of the ITransformationStep object
    `void` | `initialize(org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext ctx)` In this method the transformation step can be initialized.
    `void` | `setCondition(IConditionProvider condition)`
    `ITransformationStep` | `setIfFalse(ITransformationStep ifFalse)`
    `ITransformationStep` | `setIfTrue(ITransformationStep ifTrue)`

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

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

- - ### Field Detail

    - #### ctx

          protected org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext ctx

    - #### condition

          protected IConditionProvider condition

    - #### ifTrue

          protected ITransformationStep ifTrue

    - #### ifFalse

          protected ITransformationStep ifFalse

  - ### Constructor Detail

    - #### Conditional

          public Conditional()

  - ### Method Detail

    - #### setIfTrue

          public ITransformationStep setIfTrue(ITransformationStep ifTrue)

    - #### setIfFalse

          public ITransformationStep setIfFalse(ITransformationStep ifFalse)

    - #### setCondition

          public void setCondition(IConditionProvider condition)

    - #### initialize

          public void initialize(org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext ctx)

      Description copied from interface: `ITransformationStep`
      In this method the transformation step can be initialized. The workflow context is handed to the transformation step
      Specified by:
        `initialize` in interface `ITransformationStep`
      Parameters:
        `ctx` - The context of the workflow, which can contain various workflow-specific resources.

    - #### execute

          public void execute()

      Description copied from interface: `ITransformationStep`
      Defines the added functionality of the ITransformationStep object
      Specified by:
        `execute` in interface `ITransformationStep`

    - #### dispose

          public void dispose()

      Description copied from interface: `ITransformationStep`
      If the transformation step contains any resources that need to be disposed of, it can be done here.
      Specified by:
        `dispose` in interface `ITransformationStep`