本文整理汇总了Java中org.activiti.engine.impl.bpmn.data.FieldBaseStructureInstance类的典型用法代码示例。如果您正苦于以下问题:Java FieldBaseStructureInstance类的具体用法?Java FieldBaseStructureInstance怎么用?Java FieldBaseStructureInstance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldBaseStructureInstance类属于org.activiti.engine.impl.bpmn.data包,在下文中一共展示了FieldBaseStructureInstance类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAsyncInvocationWithDataFlowUEL
import org.activiti.engine.impl.bpmn.data.FieldBaseStructureInstance; //导入依赖的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.FieldBaseStructureInstance; //导入依赖的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);
}
示例3: evaluate
import org.activiti.engine.impl.bpmn.data.FieldBaseStructureInstance; //导入依赖的package包/类
@Override
public void evaluate(ActivityExecution execution) {
MessageInstance message = (MessageInstance) execution.getVariable(WebServiceActivityBehavior.CURRENT_MESSAGE);
if (message.getStructureInstance() instanceof FieldBaseStructureInstance) {
FieldBaseStructureInstance structure = (FieldBaseStructureInstance) message.getStructureInstance();
execution.setVariable(this.getTarget(), structure.getFieldValue(this.getSource()));
}
}
示例4: evaluate
import org.activiti.engine.impl.bpmn.data.FieldBaseStructureInstance; //导入依赖的package包/类
@Override
public void evaluate(ActivityExecution execution) {
Object value = execution.getVariable(this.source);
MessageInstance message = (MessageInstance) execution.getVariable(WebServiceActivityBehavior.CURRENT_MESSAGE);
if (message.getStructureInstance() instanceof FieldBaseStructureInstance) {
FieldBaseStructureInstance structure = (FieldBaseStructureInstance) message.getStructureInstance();
structure.setFieldValue(this.target, value);
}
}
示例5: evaluate
import org.activiti.engine.impl.bpmn.data.FieldBaseStructureInstance; //导入依赖的package包/类
@Override
public void evaluate(ActivityExecution execution) {
if (StringUtils.isNotEmpty(this.source)) {
Object value = execution.getVariable(this.source);
MessageInstance message = (MessageInstance) execution.getVariable(WebServiceActivityBehavior.CURRENT_MESSAGE);
if (message.getStructureInstance() instanceof FieldBaseStructureInstance) {
FieldBaseStructureInstance structure = (FieldBaseStructureInstance) message.getStructureInstance();
structure.setFieldValue(this.target, value);
}
}
}