本文整理匯總了Java中org.activiti.engine.runtime.ProcessInstance.getProcessInstanceId方法的典型用法代碼示例。如果您正苦於以下問題:Java ProcessInstance.getProcessInstanceId方法的具體用法?Java ProcessInstance.getProcessInstanceId怎麽用?Java ProcessInstance.getProcessInstanceId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.activiti.engine.runtime.ProcessInstance
的用法示例。
在下文中一共展示了ProcessInstance.getProcessInstanceId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: startActivitiProcessInstance
import org.activiti.engine.runtime.ProcessInstance; //導入方法依賴的package包/類
public void startActivitiProcessInstance(StartProcessCommand spic, Task task, OperationResult result)
throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException {
String owner = spic.getProcessOwner();
if (owner != null) {
activitiEngine.getIdentityService().setAuthenticatedUserId(owner);
}
RuntimeService rs = activitiEngine.getProcessEngine().getRuntimeService();
ProcessInstanceBuilder builder = rs.createProcessInstanceBuilder()
.processDefinitionKey(spic.getProcessName())
.processInstanceName(spic.getProcessInstanceName());
for (Map.Entry<String, Object> varEntry : spic.getVariables().entrySet()) {
builder.addVariable(varEntry.getKey(), varEntry.getValue());
}
ProcessInstance pi = builder.start();
if (spic.isSendStartConfirmation()) { // let us send a reply back (useful for listener-free processes)
ProcessStartedEvent event = new ProcessStartedEvent(
pi.getProcessInstanceId(),
((ExecutionEntity) pi).getVariables(), // a bit of hack...
processInterfaceFinder);
event.setRunning(!pi.isEnded());
LOGGER.trace("Event to be sent to IDM: {}", event);
wfTaskController.onProcessEvent(event, task, result);
}
}