@Test public void blanketApproveEngineCreate() { OrchestrationConfig config = new OrchestrationConfig(EngineCapability.BLANKET_APPROVAL); WorkflowEngine workflowEngine = factory.newEngine(config); assertNotNull(workflowEngine); assertTrue(workflowEngine instanceof BlanketApproveEngine); assertFalse(workflowEngine instanceof SimulationEngine); }
@SuppressWarnings("unchecked") @Override public <E extends WorkflowEngine> E newEngine(OrchestrationConfig config) { switch (config.getCapability()) { case STANDARD: return (E) new StandardWorkflowEngine(routeNodeService, routeHeaderService, parameterService, config); case BLANKET_APPROVAL: return (E) new BlanketApproveEngine(routeNodeService, routeHeaderService, parameterService, config); case SIMULATION: return (E) new SimulationEngine(routeNodeService, routeHeaderService, parameterService, config); } return null; }
WorkflowEngineFactoryImpl implements WorkflowEngineFactory, InitializingBean { @SuppressWarnings("unchecked") @Override public <E extends WorkflowEngine> E newEngine(OrchestrationConfig config) { switch (config.getCapability()) { case STANDARD: return (E) new StandardWorkflowEngine(routeNodeService, routeHeaderService, parameterService, config); case BLANKET_APPROVAL: return (E) new BlanketApproveEngine(routeNodeService, routeHeaderService, parameterService, config); case SIMULATION: return (E) new SimulationEngine(routeNodeService, routeHeaderService, parameterService, config); } return null; } }
WorkflowEngineFactoryImpl implements WorkflowEngineFactory, InitializingBean { @SuppressWarnings("unchecked") @Override public <E extends WorkflowEngine> E newEngine(OrchestrationConfig config) { switch (config.getCapability()) { case STANDARD: return (E) new StandardWorkflowEngine(routeNodeService, routeHeaderService, parameterService, config); case BLANKET_APPROVAL: return (E) new BlanketApproveEngine(routeNodeService, routeHeaderService, parameterService, config); case SIMULATION: return (E) new SimulationEngine(routeNodeService, routeHeaderService, parameterService, config); } return null; }  }
WorkflowEngineFactoryImpl implements WorkflowEngineFactory, InitializingBean { @SuppressWarnings("unchecked") @Override public <E extends WorkflowEngine> E newEngine(OrchestrationConfig config) { switch (config.getCapability()) { case STANDARD: return (E) new StandardWorkflowEngine(routeNodeService, routeHeaderService, parameterService, config); case BLANKET_APPROVAL: return (E) new BlanketApproveEngine(routeNodeService, routeHeaderService, parameterService, config); case SIMULATION: return (E) new SimulationEngine(routeNodeService, routeHeaderService, parameterService, config); } return null; }  @Override void afterPropertiesSet(); @SuppressWarnings("unchecked") @Override E newEngine(OrchestrationConfig config); RouteNodeService getRouteNodeService(); void setRouteNodeService(RouteNodeService routeNodeService); RouteHeaderService getRouteHeaderService(); void setRouteHeaderService(RouteHeaderService routeHeaderService); ParameterService getParameterService(); void setParameterService(ParameterService parameterService); }
WorkflowEngineFactoryImpl implements WorkflowEngineFactory, InitializingBean { @SuppressWarnings("unchecked") @Override public <E extends WorkflowEngine> E newEngine(OrchestrationConfig config) { switch (config.getCapability()) { case STANDARD: return (E) new StandardWorkflowEngine(routeNodeService, routeHeaderService, parameterService, config); case BLANKET_APPROVAL: return (E) new BlanketApproveEngine(routeNodeService, routeHeaderService, parameterService, config); case SIMULATION: return (E) new SimulationEngine(routeNodeService, routeHeaderService, parameterService, config); } return null; }  @Override void afterPropertiesSet(); @SuppressWarnings("unchecked") @Override E newEngine(OrchestrationConfig config); RouteNodeService getRouteNodeService(); void setRouteNodeService(RouteNodeService routeNodeService); RouteHeaderService getRouteHeaderService(); void setRouteHeaderService(RouteHeaderService routeHeaderService); ParameterService getParameterService(); void setParameterService(ParameterService parameterService);  }