|
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,
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. |
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, String domain, WorkflowExecution workflowExecution) throws InterruptedException
workflowExecution
- result of
AmazonSimpleWorkflow#startWorkflowInstance(com.amazonaws.services.simpleworkflow.model.StartWorkflowInstanceRequest)
InterruptedException
- if thread is interrupted
RuntimeException
- 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 interrupted
TimeoutException
- if instance is not complete after specified timeout
RuntimeException
- 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 running
RuntimeException
- 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 prettyPrintDecisions(Iterable<Decision> decisions)
public static String prettyPrintHistoryEvent(HistoryEvent event)
event
- event to pretty printpublic static String prettyPrintDecision(Decision decision)
event
- event to pretty printpublic static String printDetails(String details)
public static String truncateReason(String reason)
reason
- string value to truncate
public static String truncateDetails(String details)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |