當前位置: 首頁>>代碼示例>>Java>>正文


Java FieldBaseStructureInstance類代碼示例

本文整理匯總了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());
}
 
開發者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) {
  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()));
  }
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:9,代碼來源:MessageImplicitDataOutputAssociation.java

示例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);
  }
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:10,代碼來源:MessageImplicitDataInputAssociation.java

示例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);
    }
  }
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:12,代碼來源:MessageImplicitDataInputAssociation.java


注:本文中的org.activiti.engine.impl.bpmn.data.FieldBaseStructureInstance類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。