Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License").
  * You may not use this file except in compliance with the License.
  * A copy of the License is located at
  *
  *  http://aws.amazon.com/apache2.0
  *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazonaws.services.simpleworkflow.flow.generic;
Base class for all workflow definitions. Implementation should use com.amazonaws.services.simpleworkflow.flow.annotations.Execute to specify workflow name different from implementation class name, different workflow version and other workflow instance registration and execution parameters.

public abstract class WorkflowDefinition {

    
Asynchronous method that implements workflow business logic. This method invocation is surrounded by com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally. Workflow is completed when com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally.doFinally() is executed. So even if return com.amazonaws.services.simpleworkflow.flow.core.Promise of the method is ready but there is some asynchronous task or activity still not completed workflow is not going to complete.

Parameters:
input Data passed to the worklfow instance during start instance call.
Returns:
Throws:
com.amazonaws.services.simpleworkflow.flow.WorkflowException Prefer throwing com.amazonaws.services.simpleworkflow.flow.WorkflowException.
    public abstract Promise<Stringexecute(String inputthrows WorkflowException;

    
Asynchronous method that implements signals handling logic. This method invocation is surrounded by the same doTry of com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally that is used to execute workflow. It means that non handled failure inside this method causes workflow execution failure.

    public abstract void signalRecieved(String signalNameString inputthrows WorkflowException;

    
Return state that is inserted decision completion through com.amazonaws.services.simpleworkflow.model.RespondDecisionTaskCompletedRequest.setExecutionContext(java.lang.String) and later can be retrieved through com.amazonaws.services.simpleworkflow.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 com.amazonaws.services.simpleworkflow.flow.core.Task or calling methods marked with com.amazonaws.services.simpleworkflow.flow.annotations.Asynchronous annotation. It is also expected to be read only operation which is not allowed to modify state of workflow in any way.

Returns:
current state of the workflow execution.
Throws:
com.amazonaws.services.simpleworkflow.flow.WorkflowException
    public abstract String getWorkflowState() throws WorkflowException;
New to GrepCode? Check out our FAQ X