|
Did this page help you?Yes No Tell us about it... |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.services.simpleworkflow.flow.common.WorkflowExecutionUtils
public class WorkflowExecutionUtils
Convenience methods to be used by unit tests and during development.
Constructor Summary | |
---|---|
WorkflowExecutionUtils()
|
Method Summary | |
---|---|
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. |
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkflowExecutionUtils()
Method Detail |
---|
public static WorkflowExecutionCompletedEventAttributes waitForWorkflowExecutionResult(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution) throws java.lang.InterruptedException
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
java.lang.InterruptedException
- if thread is interrupted
java.lang.RuntimeException
- if workflow instance ended up in any state but completedpublic static WorkflowExecutionCompletedEventAttributes waitForWorkflowExecutionResult(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution, long timeoutSeconds) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
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 completedpublic static WorkflowExecutionCompletedEventAttributes getWorkflowExecutionResult(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)
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 completedpublic static HistoryEvent getInstanceCloseEvent(AmazonSimpleWorkflow service, java.lang.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 java.lang.String getId(HistoryEvent historyEvent)
public static java.lang.String getFailureCause(HistoryEvent historyEvent)
public static java.lang.String waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution) throws java.lang.InterruptedException
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
java.lang.InterruptedException
public static java.lang.String waitForWorkflowInstanceCompletion(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution, long timeoutSeconds) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
timeoutSeconds
- maximum time to wait for completion. 0 means wait forever.
java.util.concurrent.TimeoutException
java.lang.InterruptedException
public static java.lang.String waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution, long timeoutSeconds) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
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)
public static java.lang.String waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution) throws java.lang.InterruptedException
waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow, String, WorkflowExecution, long)
, but with no timeout.
service
- domain
- workflowExecution
-
java.lang.InterruptedException
public static WorkflowExecutionInfo describeWorkflowInstance(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)
public static java.lang.String prettyPrintHistory(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
public static java.lang.String prettyPrintHistory(AmazonSimpleWorkflow service, java.lang.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 java.util.List<HistoryEvent> getHistory(AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)
public static History getHistoryPage(java.lang.String nextPageToken, AmazonSimpleWorkflow service, java.lang.String domain, WorkflowExecution workflowExecution)
public static java.lang.String prettyPrintHistory(History history, boolean showWorkflowTasks)
showWorkflowTasks
- when set to false workflow task events (decider events) are
not includedpublic static java.lang.String prettyPrintHistory(java.lang.Iterable<HistoryEvent> events, boolean showWorkflowTasks)
public static java.lang.String prettyPrintDecisions(java.lang.Iterable<Decision> decisions)
public static java.lang.String prettyPrintHistoryEvent(HistoryEvent event)
event
- event to pretty printpublic static java.lang.String prettyPrintDecision(Decision decision)
event
- event to pretty printpublic static java.lang.String printDetails(java.lang.String details)
public static java.lang.String truncateReason(java.lang.String reason)
reason
- string value to truncate
public static java.lang.String truncateDetails(java.lang.String details)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |