当前位置: 首页>>代码示例>>Java>>正文


Java FieldBaseStructureInstance.setFieldValue方法代码示例

本文整理汇总了Java中org.activiti.engine.impl.bpmn.data.FieldBaseStructureInstance.setFieldValue方法的典型用法代码示例。如果您正苦于以下问题:Java FieldBaseStructureInstance.setFieldValue方法的具体用法?Java FieldBaseStructureInstance.setFieldValue怎么用?Java FieldBaseStructureInstance.setFieldValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.impl.bpmn.data.FieldBaseStructureInstance的用法示例。


在下文中一共展示了FieldBaseStructureInstance.setFieldValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:30,代码来源:WebServiceUELTest.java

示例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);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:30,代码来源:WebServiceUELTest.java

示例3: 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);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:MessageImplicitDataInputAssociation.java

示例4: 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);
    }
  }
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:12,代码来源:MessageImplicitDataInputAssociation.java


注:本文中的org.activiti.engine.impl.bpmn.data.FieldBaseStructureInstance.setFieldValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。