| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kew.engine; |
| 17 | |
|
| 18 | |
import org.kuali.rice.core.framework.parameter.ParameterService; |
| 19 | |
import org.kuali.rice.kew.engine.node.service.RouteNodeService; |
| 20 | |
import org.kuali.rice.kew.engine.simulation.SimulationEngine; |
| 21 | |
import org.kuali.rice.kew.routeheader.service.RouteHeaderService; |
| 22 | |
import org.springframework.beans.factory.InitializingBean; |
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | 0 | public class WorkflowEngineFactoryImpl implements WorkflowEngineFactory, InitializingBean { |
| 30 | |
|
| 31 | |
private RouteNodeService routeNodeService; |
| 32 | |
private RouteHeaderService routeHeaderService; |
| 33 | |
private ParameterService parameterService; |
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
@Override |
| 43 | |
public void afterPropertiesSet() { |
| 44 | 0 | if (routeNodeService == null) { |
| 45 | 0 | throw new IllegalStateException("routeNodeService not properly injected, was null."); |
| 46 | |
} |
| 47 | 0 | if (routeHeaderService == null) { |
| 48 | 0 | throw new IllegalStateException("routeHeaderService not properly injected, was null."); |
| 49 | |
} |
| 50 | 0 | if (parameterService == null) { |
| 51 | 0 | throw new IllegalStateException("parameterService not properly injected, was null."); |
| 52 | |
} |
| 53 | 0 | } |
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
@SuppressWarnings("unchecked") |
| 59 | |
@Override |
| 60 | |
public <E extends WorkflowEngine> E newEngine(OrchestrationConfig config) { |
| 61 | 0 | switch (config.getCapability()) { |
| 62 | |
case STANDARD: |
| 63 | 0 | return (E) new StandardWorkflowEngine(routeNodeService, routeHeaderService, parameterService, config); |
| 64 | |
case BLANKET_APPROVAL: |
| 65 | 0 | return (E) new BlanketApproveEngine(routeNodeService, routeHeaderService, parameterService, config); |
| 66 | |
case SIMULATION: |
| 67 | 0 | return (E) new SimulationEngine(routeNodeService, routeHeaderService, parameterService, config); |
| 68 | |
} |
| 69 | |
|
| 70 | 0 | return null; |
| 71 | |
} |
| 72 | |
|
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
public RouteNodeService getRouteNodeService() { |
| 77 | 0 | return this.routeNodeService; |
| 78 | |
} |
| 79 | |
|
| 80 | |
|
| 81 | |
|
| 82 | |
|
| 83 | |
|
| 84 | |
public void setRouteNodeService(RouteNodeService routeNodeService) { |
| 85 | 0 | this.routeNodeService = routeNodeService; |
| 86 | 0 | } |
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | |
|
| 92 | |
public RouteHeaderService getRouteHeaderService() { |
| 93 | 0 | return this.routeHeaderService; |
| 94 | |
} |
| 95 | |
|
| 96 | |
|
| 97 | |
|
| 98 | |
|
| 99 | |
|
| 100 | |
public void setRouteHeaderService(RouteHeaderService routeHeaderService) { |
| 101 | 0 | this.routeHeaderService = routeHeaderService; |
| 102 | 0 | } |
| 103 | |
|
| 104 | |
|
| 105 | |
|
| 106 | |
|
| 107 | |
|
| 108 | |
public ParameterService getParameterService() { |
| 109 | 0 | return this.parameterService; |
| 110 | |
} |
| 111 | |
|
| 112 | |
|
| 113 | |
|
| 114 | |
|
| 115 | |
|
| 116 | |
public void setParameterService(ParameterService parameterService) { |
| 117 | 0 | this.parameterService = parameterService; |
| 118 | 0 | } |
| 119 | |
|
| 120 | |
} |