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;
 
 
 
     protected DataConverter dataConverter;
 
 
 
     protected WorkflowExecution workflowExecution;
 
     protected WorkflowType workflowType;
 
     public DynamicWorkflowClientExternalImpl(String workflowIdWorkflowType workflowType) {
         this(new WorkflowExecution().withWorkflowId(workflowId), workflowTypenullnull);
     }
 
     public DynamicWorkflowClientExternalImpl(WorkflowExecution workflowExecution) {
         this(workflowExecutionnullnullnull);
     }
 
     public DynamicWorkflowClientExternalImpl(String workflowIdWorkflowType workflowTypeStartWorkflowOptions options) {
         this(new WorkflowExecution().withWorkflowId(workflowId), workflowTypeoptionsnullnull);
     }
 
     public DynamicWorkflowClientExternalImpl(WorkflowExecution workflowExecutionWorkflowType workflowType,
             StartWorkflowOptions options) {
         this(workflowExecutionworkflowTypeoptionsnullnull);
     }
 
     public DynamicWorkflowClientExternalImpl(WorkflowExecution workflowExecutionWorkflowType workflowType,
             StartWorkflowOptions optionsDataConverter dataConverter) {
         this(workflowExecutionworkflowTypeoptionsdataConverternull);
     }
 
     public DynamicWorkflowClientExternalImpl(WorkflowExecution workflowExecutionWorkflowType workflowType,
             StartWorkflowOptions optionsDataConverter dataConverterGenericWorkflowClientExternal genericClient) {
         this. = workflowExecution;
         this. = workflowType;
         this. = options;
         if (dataConverter == null) {
             this. = new JsonDataConverter();
         }
         else {
             this. = dataConverter;
         }
         this. = genericClient;
     }
 
     public DataConverter getDataConverter() {
         return ;
     }
 
     public void setDataConverter(DataConverter dataConverter) {
         this. = dataConverter;
     }
 
         return ;
     }
 
     public void setSchedulingOptions(StartWorkflowOptions schedulingOptions) {
         this. = schedulingOptions;
     }
 
         return ;
     }
 
     public void setGenericClient(GenericWorkflowClientExternal genericClient) {
         this. = genericClient;
     }
 
         return ;
     }
    public void setWorkflowExecution(WorkflowExecution workflowExecution) {
        this. = workflowExecution;
    }
    public WorkflowType getWorkflowType() {
        return ;
    }
    public void setWorkflowType(WorkflowType workflowType) {
        this. = workflowType;
    }
    @Override
    public void terminateWorkflowExecution(String reasonString detailsChildPolicy childPolicy) {
        TerminateWorkflowExecutionParameters terminateParameters = new TerminateWorkflowExecutionParameters();
        terminateParameters.setReason(reason);
        terminateParameters.setDetails(details);
        if (childPolicy != null) {
            terminateParameters.setChildPolicy(childPolicy);
        }
        terminateParameters.setWorkflowExecution();
        .terminateWorkflowExecution(terminateParameters);
    }
    @Override
    public void requestCancelWorkflowExecution() {
    }
    @Override
    public void startWorkflowExecution(Object[] arguments) {
        startWorkflowExecution(argumentsnull);
    }
    @Override
    public void startWorkflowExecution(Object[] argumentsStartWorkflowOptions startOptionsOverride) {
        if ( == null) {
            throw new IllegalStateException("Required property workflowType is null");
        }
        if ( == null) {
            throw new IllegalStateException("wokflowExecution is null");
        }
        else if (.getWorkflowId() == null) {
            throw new IllegalStateException("wokflowId is null");
        }
        parameters.setWorkflowType();
        parameters.setWorkflowId(.getWorkflowId());
        String input = .toData(arguments);
        parameters.setInput(input);
        parameters = parameters.createStartWorkflowExecutionParametersFromOptions(startOptionsOverride);
        WorkflowExecution newExecution = .startWorkflow(parameters);
        String runId = newExecution.getRunId();
        .setRunId(runId);
    }
    @Override
    public void signalWorkflowExecution(String signalNameObject[] arguments) {
        SignalExternalWorkflowParameters signalParameters = new SignalExternalWorkflowParameters();
        signalParameters.setRunId(.getRunId());
        signalParameters.setWorkflowId(.getWorkflowId());
        signalParameters.setSignalName(signalName);
        String input = .toData(arguments);
        signalParameters.setInput(input);
        .signalWorkflowExecution(signalParameters);
    }
    @Override
    public <T> T getWorkflowExecutionState(Class<T> returnTypethrows Throwable {
        if (state == null)
            return null;
        try {
            Throwable failure = .fromData(stateThrowable.class);
            if (failure != null) {
                throw failure;
            }
        }
        catch (DataConverterException e) {
        }
        catch (RuntimeException e) {
        }
        return .fromData(statereturnType);
    }
New to GrepCode? Check out our FAQ X