public SpringTestPOJOWorkflowImplementationGenericWorkflowClient() {
    genericClient = new TestGenericWorkflowClient();
    genericClient.setFactoryFactory(
        new POJOWorkflowDefinitionFactoryFactory() {

          @Override
          protected POJOWorkflowImplementationFactory getImplementationFactory(
              Class<?> workflowImplementationType,
              Class<?> workflowInteface,
              WorkflowType workflowType) {
            final Object instanceProxy = workflowImplementations.get(workflowImplementationType);
            if (instanceProxy == null) {
              throw new IllegalArgumentException(
                  "unknown workflowImplementationType: " + workflowImplementationType);
            }
            return new POJOWorkflowImplementationFactory() {

              @Override
              public Object newInstance(DecisionContext decisionContext) throws Exception {
                WorkflowScope.setDecisionContext(decisionContext);
                return instanceProxy;
              }

              @Override
              public void deleteInstance(Object instance) {
                WorkflowScope.removeDecisionContext();
              }
            };
          }
        });
  }
 public String generateUniqueId() {
   return genericClient.generateUniqueId();
 }
 public void continueAsNewOnCompletion(ContinueAsNewWorkflowExecutionParameters parameters) {
   genericClient.continueAsNewOnCompletion(parameters);
 }
 public String getWorkflowState(WorkflowExecution execution) throws WorkflowException {
   return genericClient.getWorkflowState(execution);
 }
 public void requestCancelWorkflowExecution(WorkflowExecution execution) {
   genericClient.requestCancelWorkflowExecution(execution);
 }
 public Promise<Void> signalWorkflowExecution(SignalExternalWorkflowParameters signalParameters) {
   return genericClient.signalWorkflowExecution(signalParameters);
 }
 public Promise<String> startChildWorkflow(
     String workflow, String version, Promise<String> input) {
   return genericClient.startChildWorkflow(workflow, version, input);
 }
 public Promise<StartChildWorkflowReply> startChildWorkflow(
     StartChildWorkflowExecutionParameters parameters) {
   return genericClient.startChildWorkflow(parameters);
 }
 public void setDecisionContextProvider(DecisionContextProvider decisionContextProvider) {
   genericClient.setDecisionContextProvider(decisionContextProvider);
 }
 public DecisionContextProvider getDecisionContextProvider() {
   return genericClient.getDecisionContextProvider();
 }
 private POJOWorkflowDefinitionFactoryFactory getFactoryFactory() {
   return ((POJOWorkflowDefinitionFactoryFactory) genericClient.getFactoryFactory());
 }