Class Chain<InputType>

java.lang.Object
org.chenile.owiz.impl.CommandBase<InputType>
org.chenile.owiz.impl.Chain<InputType>
All Implemented Interfaces:
AttachableCommand<InputType>, BypassableCommand<InputType>, Command<InputType>, OrchestrationAware<InputType>
Direct Known Subclasses:
FilterChain, ForLoop, ParallelChain

public class Chain<InputType> extends CommandBase<InputType> implements Command<InputType>, AttachableCommand<InputType>
A chain is a command that executes a chain of other commands.
  • Field Details

  • Constructor Details

    • Chain

      public Chain()
  • Method Details

    • doExecute

      protected void doExecute(InputType context) throws Exception
      Specified by:
      doExecute in class CommandBase<InputType>
      Throws:
      Exception
    • shouldStopChain

      protected boolean shouldStopChain(InputType context) throws Exception
      AN extension point to allow sub classes to stop a chain if a condition is satisfied.
      Parameters:
      context - containing the data required.
      Returns:
      false by default.
      Throws:
      Exception - .
    • attachCommand

      public void attachCommand(AttachmentDescriptor<InputType> attachmentDescriptor, CommandDescriptor<InputType> command)
      Allow a command to attach itself to this chain. If the index is not specified then the attachment order defines the execution order. Else if index is explicitly specified then the execution order would be the ascending order of the index.
      Specified by:
      attachCommand in interface AttachableCommand<InputType>
    • obtainExecutionCommands

      protected List<Command<InputType>> obtainExecutionCommands(InputType context)
      Obtain the list of commands that needs to be actually executed. Considers InterpolationCommand - these commands are supposed to emit out the actual commands that need to be executed.
      Parameters:
      context - - the context that was passed
      Returns:
      - the set of commands applicable for that context