本文整理汇总了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);
}
}