public class WorkflowExecutionUtils extends Object
Constructor and Description |
---|
WorkflowExecutionUtils() |
Modifier and Type | Method and Description |
---|---|
static WorkflowExecutionInfo |
describeWorkflowInstance(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution) |
static String |
getFailureCause(HistoryEvent historyEvent) |
static List<HistoryEvent> |
getHistory(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution) |
static History |
getHistoryPage(String nextPageToken,
AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution) |
static String |
getId(HistoryEvent historyEvent) |
static HistoryEvent |
getInstanceCloseEvent(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution) |
static WorkflowExecutionCompletedEventAttributes |
getWorkflowExecutionResult(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution)
Returns result of workflow instance execution.
|
static WorkflowExecution |
getWorkflowIdFromExternalWorkflowCompletedEvent(HistoryEvent event) |
static boolean |
isActivityTaskClosedEvent(HistoryEvent event) |
static boolean |
isExternalWorkflowClosedEvent(HistoryEvent event) |
static boolean |
isWorkflowExecutionCompletedEvent(HistoryEvent event) |
static String |
prettyPrintDecision(Decision decision)
Returns single decision in a human readable format
|
static String |
prettyPrintDecisions(Iterable<Decision> decisions) |
static String |
prettyPrintHistory(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution)
Returns workflow instance history in a human readable format.
|
static String |
prettyPrintHistory(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution,
boolean showWorkflowTasks)
Returns workflow instance history in a human readable format.
|
static String |
prettyPrintHistory(History history,
boolean showWorkflowTasks)
Returns workflow instance history in a human readable format.
|
static String |
prettyPrintHistory(Iterable<HistoryEvent> events,
boolean showWorkflowTasks) |
static String |
prettyPrintHistoryEvent(HistoryEvent event)
Returns single event in a human readable format
|
static String |
printDetails(String details) |
static String |
truncateDetails(String details) |
static String |
truncateReason(String reason)
Simple Workflow limits length of the reason field.
|
static WorkflowExecutionCompletedEventAttributes |
waitForWorkflowExecutionResult(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution)
Blocks until workflow instance completes and returns its result.
|
static WorkflowExecutionCompletedEventAttributes |
waitForWorkflowExecutionResult(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution,
long timeoutSeconds)
Waits up to specified timeout until workflow instance completes and
returns its result.
|
static String |
waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution)
Blocks until workflow instance completes.
|
static String |
waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution,
long timeoutSeconds)
Waits up to specified timeout for workflow instance completion.
|
static String |
waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution)
Like
waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow, String, WorkflowExecution, long)
, but with no timeout. |
static String |
waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service,
String domain,
WorkflowExecution workflowExecution,
long timeoutSeconds)
Like
waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow, String, WorkflowExecution, long)
, except will wait for continued generations of the original workflow
execution too. |
public static WorkflowExecutionCompletedEventAttributes waitForWorkflowExecutionResult(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution) throws InterruptedException
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
InterruptedException
- if thread is interruptedRuntimeException
- if workflow instance ended up in any state but completedpublic static WorkflowExecutionCompletedEventAttributes waitForWorkflowExecutionResult(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution, long timeoutSeconds) throws InterruptedException, TimeoutException
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
InterruptedException
- if thread is interruptedTimeoutException
- if instance is not complete after specified timeoutRuntimeException
- if workflow instance ended up in any state but completedpublic static WorkflowExecutionCompletedEventAttributes getWorkflowExecutionResult(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution)
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
IllegalStateException
- if workflow is still runningRuntimeException
- if workflow instance ended up in any state but completedpublic static HistoryEvent getInstanceCloseEvent(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution)
public static boolean isWorkflowExecutionCompletedEvent(HistoryEvent event)
public static boolean isActivityTaskClosedEvent(HistoryEvent event)
public static boolean isExternalWorkflowClosedEvent(HistoryEvent event)
public static WorkflowExecution getWorkflowIdFromExternalWorkflowCompletedEvent(HistoryEvent event)
public static String getId(HistoryEvent historyEvent)
public static String getFailureCause(HistoryEvent historyEvent)
public static String waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution) throws InterruptedException
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
InterruptedException
public static String waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution, long timeoutSeconds) throws InterruptedException, TimeoutException
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
timeoutSeconds
- maximum time to wait for completion. 0 means wait forever.TimeoutException
InterruptedException
public static String waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution, long timeoutSeconds) throws InterruptedException, TimeoutException
waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow, String, WorkflowExecution, long)
, except will wait for continued generations of the original workflow
execution too.service
- domain
- workflowExecution
- timeoutSeconds
- InterruptedException
TimeoutException
waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow, String,
WorkflowExecution, long)
public static String waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution) throws InterruptedException
waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow, String, WorkflowExecution, long)
, but with no timeout.service
- domain
- workflowExecution
- InterruptedException
public static WorkflowExecutionInfo describeWorkflowInstance(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution)
public static String prettyPrintHistory(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution)
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
public static String prettyPrintHistory(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution, boolean showWorkflowTasks)
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
showWorkflowTasks
- when set to false workflow task events (decider events) are
not includedpublic static List<HistoryEvent> getHistory(AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution)
public static History getHistoryPage(String nextPageToken, AmazonSimpleWorkflow service, String domain, WorkflowExecution workflowExecution)
public static String prettyPrintHistory(History history, boolean showWorkflowTasks)
showWorkflowTasks
- when set to false workflow task events (decider events) are
not includedpublic static String prettyPrintHistory(Iterable<HistoryEvent> events, boolean showWorkflowTasks)
public static String prettyPrintHistoryEvent(HistoryEvent event)
event
- event to pretty printpublic static String prettyPrintDecision(Decision decision)
event
- event to pretty printpublic static String truncateReason(String reason)
reason
- string value to truncateCopyright © 2013 Amazon Web Services, Inc. All Rights Reserved.