本文整理汇总了Java中org.activiti.engine.impl.bpmn.data.ItemDefinition.createInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ItemDefinition.createInstance方法的具体用法?Java ItemDefinition.createInstance怎么用?Java ItemDefinition.createInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.bpmn.data.ItemDefinition
的用法示例。
在下文中一共展示了ItemDefinition.createInstance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAsyncInvocationWithDataFlowUEL
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入方法依赖的package包/类
@Deployment
public void testAsyncInvocationWithDataFlowUEL() throws Exception {
assertEquals(-1, counter.getCount());
ProcessDefinitionEntity processDefinition = processEngineConfiguration
.getCommandExecutorTxRequiresNew()
.execute(new Command<ProcessDefinitionEntity>() {
public ProcessDefinitionEntity execute(CommandContext commandContext) {
return Context
.getProcessEngineConfiguration()
.getDeploymentCache()
.findDeployedLatestProcessDefinitionByKey("asyncWebServiceInvocationWithDataFlowUEL");
}
});
ItemDefinition itemDefinition = processDefinition.getIoSpecification().getDataInputs().get(0).getDefinition();
ItemInstance itemInstance = itemDefinition.createInstance();
FieldBaseStructureInstance structureInstance = (FieldBaseStructureInstance) itemInstance.getStructureInstance();
structureInstance.setFieldValue("newCounterValue", 23);
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("dataInputOfProcess", itemInstance);
processEngine.getRuntimeService().startProcessInstanceByKey("asyncWebServiceInvocationWithDataFlowUEL", variables);
waitForJobExecutorToProcessAllJobs(10000L, 250L);
assertEquals(23, counter.getCount());
}
示例2: testWebServiceInvocationWithDataFlowUEL
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入方法依赖的package包/类
@Deployment
public void testWebServiceInvocationWithDataFlowUEL() throws Exception {
ProcessDefinitionEntity processDefinition = processEngineConfiguration
.getCommandExecutorTxRequiresNew()
.execute(new Command<ProcessDefinitionEntity>() {
public ProcessDefinitionEntity execute(CommandContext commandContext) {
return Context
.getProcessEngineConfiguration()
.getDeploymentCache()
.findDeployedLatestProcessDefinitionByKey("webServiceInvocationWithDataFlowUEL");
}
});
ItemDefinition itemDefinition = processDefinition.getIoSpecification().getDataInputs().get(0).getDefinition();
ItemInstance itemInstance = itemDefinition.createInstance();
FieldBaseStructureInstance structureInstance = (FieldBaseStructureInstance) itemInstance.getStructureInstance();
structureInstance.setFieldValue("prefix", "The counter has the value ");
structureInstance.setFieldValue("suffix", ". Good news");
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("dataInputOfProcess", itemInstance);
ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByKey("webServiceInvocationWithDataFlowUEL", variables);
waitForJobExecutorToProcessAllJobs(10000L, 250L);
String response = (String) processEngine.getRuntimeService().getVariable(instance.getId(), "dataOutputOfProcess");
assertEquals("The counter has the value -1. Good news", response);
}