com.amazonaws.services.simpleworkflow.flow.common

## クラス WorkflowExecutionUtils

- java.lang.Object
- - com.amazonaws.services.simpleworkflow.flow.common.WorkflowExecutionUtils

-     public class WorkflowExecutionUtils
      extends java.lang.Object

  Convenience methods to be used by unit tests and during development.
  作成者:
    fateev

- - ### コンストラクタの概要

    コンストラクタ
    コンストラクタと説明
    `WorkflowExecutionUtils()`

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `static WorkflowExecutionInfo` | `describeWorkflowInstance(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)`
    `static java.lang.String` | `getFailureCause(HistoryEvent historyEvent)`
    `static java.util.List<HistoryEvent>` | `getHistory(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)`
    `static History` | `getHistoryPage(java.lang.String nextPageToken, AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)`
    `static java.lang.String` | `getId(HistoryEvent historyEvent)`
    `static HistoryEvent` | `getInstanceCloseEvent(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)`
    `static WorkflowExecutionCompletedEventAttributes` | `getWorkflowExecutionResult(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)` Returns result of workflow instance execution. result of `AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)`
    `static WorkflowExecution` | `getWorkflowIdFromExternalWorkflowCompletedEvent(HistoryEvent event)`
    `static boolean` | `isActivityTaskClosedEvent(HistoryEvent event)`
    `static boolean` | `isExternalWorkflowClosedEvent(HistoryEvent event)`
    `static boolean` | `isWorkflowExecutionCompletedEvent(HistoryEvent event)`
    `static java.lang.String` | `prettyPrintDecision(Decision decision)` Returns single decision in a human readable format
    `static java.lang.String` | `prettyPrintDecisions(java.lang.Iterable<Decision> decisions)`
    `static java.lang.String` | `prettyPrintHistory(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)` Returns workflow instance history in a human readable format.
    `static java.lang.String` | `prettyPrintHistory(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution, boolean showWorkflowTasks)` Returns workflow instance history in a human readable format.
    `static java.lang.String` | `prettyPrintHistory(History history, boolean showWorkflowTasks)` Returns workflow instance history in a human readable format.
    `static java.lang.String` | `prettyPrintHistory(java.lang.Iterable<HistoryEvent> events, boolean showWorkflowTasks)`
    `static java.lang.String` | `prettyPrintHistoryEvent(HistoryEvent event)` Returns single event in a human readable format
    `static java.lang.String` | `printDetails(java.lang.String details)`
    `static java.lang.String` | `truncateDetails(java.lang.String details)`
    `static java.lang.String` | `truncateReason(java.lang.String reason)` Simple Workflow limits length of the reason field.
    `static WorkflowExecutionCompletedEventAttributes` | `waitForWorkflowExecutionResult(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)` Blocks until workflow instance completes and returns its result.
    `static WorkflowExecutionCompletedEventAttributes` | `waitForWorkflowExecutionResult(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution, long timeoutSeconds)` Waits up to specified timeout until workflow instance completes and returns its result.
    `static java.lang.String` | `waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)` Blocks until workflow instance completes.
    `static java.lang.String` | `waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution, long timeoutSeconds)` Waits up to specified timeout for workflow instance completion.
    `static java.lang.String` | `waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)` Like `waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow, String, WorkflowExecution, long)` , but with no timeout.
    `static java.lang.String` | `waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution, long timeoutSeconds)` Like `waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow, String, WorkflowExecution, long)` , except will wait for continued generations of the original workflow execution too.

    - ### クラスから継承されたメソッド java.lang.Object

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

- - ### コンストラクタの詳細

    - #### WorkflowExecutionUtils

          public WorkflowExecutionUtils()

  - ### メソッドの詳細

    - #### waitForWorkflowExecutionResult

          public static WorkflowExecutionCompletedEventAttributes waitForWorkflowExecutionResult(AmazonSimpleWorkflow service,
                                                                                 java.lang.String domain,
                                                                                 WorkflowExecution workflowExecution)
                                                                                          throws java.lang.InterruptedException

      Blocks until workflow instance completes and returns its result. Useful for unit tests and during development. Never use in production setting as polling for worklow instance status is an expensive operation.
      パラメータ:
        `workflowExecution` - result of `AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)`
      戻り値:
        workflow instance result.
      例外:
        `java.lang.InterruptedException` - if thread is interrupted
        `java.lang.RuntimeException` - if workflow instance ended up in any state but completed

    - #### waitForWorkflowExecutionResult

          public static WorkflowExecutionCompletedEventAttributes waitForWorkflowExecutionResult(AmazonSimpleWorkflow service,
                                                                                 java.lang.String domain,
                                                                                 WorkflowExecution workflowExecution,
                                                                                 long timeoutSeconds)
                                                                                          throws java.lang.InterruptedException,
                                                                                                 java.util.concurrent.TimeoutException

      Waits up to specified timeout until workflow instance completes and returns its result. Useful for unit tests and during development. Never use in production setting as polling for worklow instance status is an expensive operation.
      パラメータ:
        `workflowExecution` - result of `AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)`
      戻り値:
        workflow instance result.
      例外:
        `java.lang.InterruptedException` - if thread is interrupted
        `java.util.concurrent.TimeoutException` - if instance is not complete after specified timeout
        `java.lang.RuntimeException` - if workflow instance ended up in any state but completed

    - #### getWorkflowExecutionResult

          public static WorkflowExecutionCompletedEventAttributes getWorkflowExecutionResult(AmazonSimpleWorkflow service,
                                                                             java.lang.String domain,
                                                                             WorkflowExecution workflowExecution)

      Returns result of workflow instance execution. result of `AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)`
      例外:
        `java.lang.IllegalStateException` - if workflow is still running
        `java.lang.RuntimeException` - if workflow instance ended up in any state but completed

    - #### getInstanceCloseEvent

          public static HistoryEvent getInstanceCloseEvent(AmazonSimpleWorkflow service,
                                           java.lang.String domain,
                                           WorkflowExecution workflowExecution)

    - #### isWorkflowExecutionCompletedEvent

          public static boolean isWorkflowExecutionCompletedEvent(HistoryEvent event)

    - #### isActivityTaskClosedEvent

          public static boolean isActivityTaskClosedEvent(HistoryEvent event)

    - #### isExternalWorkflowClosedEvent

          public static boolean isExternalWorkflowClosedEvent(HistoryEvent event)

    - #### getWorkflowIdFromExternalWorkflowCompletedEvent

          public static WorkflowExecution getWorkflowIdFromExternalWorkflowCompletedEvent(HistoryEvent event)

    - #### getId

          public static java.lang.String getId(HistoryEvent historyEvent)

    - #### getFailureCause

          public static java.lang.String getFailureCause(HistoryEvent historyEvent)

    - #### waitForWorkflowInstanceCompletion

          public static java.lang.String waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service,
                                                           java.lang.String domain,
                                                           WorkflowExecution workflowExecution)
                                                                    throws java.lang.InterruptedException

      Blocks until workflow instance completes. Never use in production setting as polling for worklow instance status is an expensive operation.
      パラメータ:
        `workflowExecution` - result of `AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)`
      戻り値:
        instance close status
      例外:
        `java.lang.InterruptedException`

    - #### waitForWorkflowInstanceCompletion

          public static java.lang.String waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service,
                                                           java.lang.String domain,
                                                           WorkflowExecution workflowExecution,
                                                           long timeoutSeconds)
                                                                    throws java.lang.InterruptedException,
                                                                           java.util.concurrent.TimeoutException

      Waits up to specified timeout for workflow instance completion. Never use in production setting as polling for worklow instance status is an expensive operation.
      パラメータ:
        `workflowExecution` - result of `AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)`
        `timeoutSeconds` - maximum time to wait for completion. 0 means wait forever.
      戻り値:
        instance close status
      例外:
        `java.util.concurrent.TimeoutException`
        `java.lang.InterruptedException`

    - #### waitForWorkflowInstanceCompletionAcrossGenerations

          public static java.lang.String waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service,
                                                                            java.lang.String domain,
                                                                            WorkflowExecution workflowExecution,
                                                                            long timeoutSeconds)
                                                                                     throws java.lang.InterruptedException,
                                                                                            java.util.concurrent.TimeoutException

      Like `waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow, String, WorkflowExecution, long)` , except will wait for continued generations of the original workflow execution too.
      パラメータ:
        `service` -
        `domain` -
        `workflowExecution` -
        `timeoutSeconds` -
      戻り値:
      例外:
        `java.lang.InterruptedException`
        `java.util.concurrent.TimeoutException`
      関連項目:
        `waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow, String, WorkflowExecution, long)`

    - #### waitForWorkflowInstanceCompletionAcrossGenerations

          public static java.lang.String waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service,
                                                                            java.lang.String domain,
                                                                            WorkflowExecution workflowExecution)
                                                                                     throws java.lang.InterruptedException

      Like `waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow, String, WorkflowExecution, long)` , but with no timeout.
      パラメータ:
        `service` -
        `domain` -
        `workflowExecution` -
      戻り値:
      例外:
        `java.lang.InterruptedException`

    - #### describeWorkflowInstance

          public static WorkflowExecutionInfo describeWorkflowInstance(AmazonSimpleWorkflow service,
                                                       java.lang.String domain,
                                                       WorkflowExecution workflowExecution)

    - #### prettyPrintHistory

          public static java.lang.String prettyPrintHistory(AmazonSimpleWorkflow service,
                                            java.lang.String domain,
                                            WorkflowExecution workflowExecution)

      Returns workflow instance history in a human readable format.
      パラメータ:
        `workflowExecution` - result of `AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)`

    - #### prettyPrintHistory

          public static java.lang.String prettyPrintHistory(AmazonSimpleWorkflow service,
                                            java.lang.String domain,
                                            WorkflowExecution workflowExecution,
                                            boolean showWorkflowTasks)

      Returns workflow instance history in a human readable format.
      パラメータ:
        `workflowExecution` - result of `AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)`
        `showWorkflowTasks` - when set to false workflow task events (decider events) are not included

    - #### getHistory

          public static java.util.List<HistoryEvent> getHistory(AmazonSimpleWorkflow service,
                                                java.lang.String domain,
                                                WorkflowExecution workflowExecution)

    - #### getHistoryPage

          public static History getHistoryPage(java.lang.String nextPageToken,
                               AmazonSimpleWorkflow service,
                               java.lang.String domain,
                               WorkflowExecution workflowExecution)

    - #### prettyPrintHistory

          public static java.lang.String prettyPrintHistory(History history,
                                            boolean showWorkflowTasks)

      Returns workflow instance history in a human readable format.
      パラメータ:
        `showWorkflowTasks` - when set to false workflow task events (decider events) are not included

    - #### prettyPrintHistory

          public static java.lang.String prettyPrintHistory(java.lang.Iterable<HistoryEvent> events,
                                            boolean showWorkflowTasks)

    - #### prettyPrintDecisions

          public static java.lang.String prettyPrintDecisions(java.lang.Iterable<Decision> decisions)

    - #### prettyPrintHistoryEvent

          public static java.lang.String prettyPrintHistoryEvent(HistoryEvent event)

      Returns single event in a human readable format
      パラメータ:
        `event` - event to pretty print

    - #### prettyPrintDecision

          public static java.lang.String prettyPrintDecision(Decision decision)

      Returns single decision in a human readable format
      パラメータ:
        `event` - event to pretty print

    - #### printDetails

          public static java.lang.String printDetails(java.lang.String details)

    - #### truncateReason

          public static java.lang.String truncateReason(java.lang.String reason)

      Simple Workflow limits length of the reason field. This method truncates the passed argument to the maximum length.
      パラメータ:
        `reason` - string value to truncate
      戻り値:
        truncated value

    - #### truncateDetails

          public static java.lang.String truncateDetails(java.lang.String details)