import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class ProcessHandler {
private static final String HTTP_LOCALHOST_8080_APP_REST = "http://localhost:8080/mycamunda/rest";
private static final Logger logger = LoggerFactory.getLogger(ProcessHandler.class);
@Autowired
private RuntimeService runtimeService;
private ProcessInstance processInstance;
public boolean startProcess(String processInstanceKey) {
logger.debug("Called method startProcess() ");
try {
logger.debug("Starting process for Key: " + processInstanceKey);
processInstance = runtimeService.startProcessInstanceByKey(processInstanceKey);
logger.debug("Process Started Successfully");
} catch (Exception ex) {
logger.debug("Error while starting the process. Reason: " + ex.getMessage());
return false;
}
return true;
}
}
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class ProcessHandler {
private static final String HTTP_LOCALHOST_8080_APP_REST = "http://localhost:8080/mycamunda/rest";
private static final Logger logger = LoggerFactory.getLogger(ProcessHandler.class);
@Autowired
private RuntimeService runtimeService;
private ProcessInstance processInstance;
public boolean startProcess(String processInstanceKey) {
logger.debug("Called method startProcess() ");
try {
logger.debug("Starting process for Key: " + processInstanceKey);
processInstance = runtimeService.startProcessInstanceByKey(processInstanceKey);
logger.debug("Process Started Successfully");
} catch (Exception ex) {
logger.debug("Error while starting the process. Reason: " + ex.getMessage());
return false;
}
return true;
}
}