Hi Michael,
Please find WorkFlow.java code Snippet:
/**
* Checks whether all the properties of the WorkFlow class are set. Also it
* instantiate ExecutionService and RepositoryService.
*
* @throws WorkFlowException
* if processEngine were not set.
* @throws WorkFlowRuntimeException
* if process definition files do not exists.
*/
public void init() throws WorkFlowException, WorkFlowRuntimeException {
if (null == processEngine) {
throw new IllegalStateException("JBPM ProcessEngine not set");
}
// Instantiate ExecutionService object using processEngine.
executionService = processEngine.getExecutionService();
if (null == executionService) {
throw new IllegalStateException("JBPM ExecutionService not set");
}
System.out.println("executionService::" + executionService);
// Instantiate RepositoryService object using processEngine.
repositoryService = processEngine.getRepositoryService();
if (null == repositoryService) {
throw new IllegalStateException("JBPM RepositoryService not set");
}
System.out.println("repositoryService::" + repositoryService);
// Instantiate TaskService object using processEngine.
taskService = processEngine.getTaskService();
if (null == taskService) {
throw new IllegalStateException("JBPM HistoryService not set");
}
System.out.println("repositoryService::" + repositoryService);
if (null == iWorkFlowDao) {
throw new IllegalStateException("WorkFlowDao object not set");
}
if (null == iCaseDao) {
throw new IllegalStateException("ManageCaseDao object not set");
}
if (null == iAssistRegionDao) {
throw new IllegalStateException("iAssistRegionDao object not set");
}
this.deploy();
}
private void deploy() throws WorkFlowException, WorkFlowRuntimeException {
try {
// Deploying the WorkFlow process definition.
String ddrDeploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("request.jpdl.xml").deploy();
// Checking the deployment is success.
if (null == ddrDeploymentId || ddrDeploymentId.equals("")) {
throw new WorkFlowException(
"The Work flow deployment is failed");
}
}
Description:
This WorkFlow.java class is a spring bean class. So whenever the appliaction startup its init() method will get called and in that we are a reference to the method deploy() and in that method we are handling the
repositoryService.createDeployment()
.addResourceFromClasspath("ddr_request.jpdl.xml").deploy()
And my doubt is if didn't deploy this how will our workflow work?
So can yoiu please tell me what I can do instead?