Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.simpleworkflow.flow.pojo
Class POJOWorkflowDefinition

java.lang.Object
  extended by com.amazonaws.services.simpleworkflow.flow.generic.WorkflowDefinition
      extended by com.amazonaws.services.simpleworkflow.flow.pojo.POJOWorkflowDefinition

public class POJOWorkflowDefinition
extends WorkflowDefinition


Constructor Summary
POJOWorkflowDefinition(Object workflowImplmentationInstance, com.amazonaws.services.simpleworkflow.flow.pojo.MethodConverterPair workflowImplementationMethod, Map<String,com.amazonaws.services.simpleworkflow.flow.pojo.MethodConverterPair> signals, com.amazonaws.services.simpleworkflow.flow.pojo.MethodConverterPair getStateMethod, DataConverter converter, DecisionContext context)
           
 
Method Summary
 Promise<String> execute(String input)
          Asynchronous method that implements workflow business logic.
 Object getImplementationInstance()
           
 String getWorkflowState()
          Return state that is inserted decision completion through RespondDecisionTaskCompletedRequest.setExecutionContext(String) and later can be retrieved through AmazonSimpleWorkflow.describeWorkflowExecution(com.amazonaws.services.simpleworkflow.model.DescribeWorkflowExecutionRequest) visibility call.
 void signalRecieved(String signalName, String details)
          Asynchronous method that implements signals handling logic.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POJOWorkflowDefinition

public POJOWorkflowDefinition(Object workflowImplmentationInstance,
                              com.amazonaws.services.simpleworkflow.flow.pojo.MethodConverterPair workflowImplementationMethod,
                              Map<String,com.amazonaws.services.simpleworkflow.flow.pojo.MethodConverterPair> signals,
                              com.amazonaws.services.simpleworkflow.flow.pojo.MethodConverterPair getStateMethod,
                              DataConverter converter,
                              DecisionContext context)
                       throws ClassNotFoundException,
                              SecurityException,
                              NoSuchMethodException,
                              NoSuchFieldException
Throws:
ClassNotFoundException
SecurityException
NoSuchMethodException
NoSuchFieldException
Method Detail

execute

public Promise<String> execute(String input)
                        throws WorkflowException
Description copied from class: WorkflowDefinition
Asynchronous method that implements workflow business logic. This method invocation is surrounded by TryCatchFinally. Workflow is completed when TryCatchFinally.doFinally() is executed. So even if return Promise of the method is ready but there is some asynchronous task or activity still not completed workflow is not going to complete.

Specified by:
execute in class WorkflowDefinition
Parameters:
input - Data passed to the worklfow instance during start instance call.
Returns:
Throws:
WorkflowException - Prefer throwing WorkflowException.

signalRecieved

public void signalRecieved(String signalName,
                           String details)
                    throws WorkflowException
Description copied from class: WorkflowDefinition
Asynchronous method that implements signals handling logic. This method invocation is surrounded by the same doTry of TryCatchFinally that is used to execute workflow. It means that non handled failure inside this method causes workflow execution failure.

Specified by:
signalRecieved in class WorkflowDefinition
Throws:
WorkflowException

getWorkflowState

public String getWorkflowState()
                        throws WorkflowException
Description copied from class: WorkflowDefinition
Return state that is inserted decision completion through RespondDecisionTaskCompletedRequest.setExecutionContext(String) and later can be retrieved through AmazonSimpleWorkflow.describeWorkflowExecution(com.amazonaws.services.simpleworkflow.model.DescribeWorkflowExecutionRequest) visibility call. Implementation of this call is expected to be synchronous and is not allowed to invoke any asynchronous operations like creation of new Task or calling methods marked with Asynchronous annotation. It is also expected to be read only operation which is not allowed to modify state of workflow in any way.

Specified by:
getWorkflowState in class WorkflowDefinition
Returns:
current state of the workflow execution.
Throws:
WorkflowException

getImplementationInstance

public Object getImplementationInstance()


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.