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