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


Java Variables.createVariables方法代码示例

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


在下文中一共展示了Variables.createVariables方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNewVariables

import org.camunda.bpm.engine.variable.Variables; //导入方法依赖的package包/类
private VariableMap getNewVariables(JsonObject event) {
  VariableMap variables = Variables.createVariables();
  if (event.get("pickId") != null) {
    variables.putValue("pickId", event.getString("pickId"));
  }
  if (event.get("shipmentId") != null) {
    variables.putValue("shipmentId", event.getString("shipmentId"));
  }
  return variables;
}
 
开发者ID:flowing,项目名称:flowing-retail-old,代码行数:11,代码来源:CamundaBpmnOrderEventHandler.java

示例2: getCorrelationKeys

import org.camunda.bpm.engine.variable.Variables; //导入方法依赖的package包/类
private VariableMap getCorrelationKeys(JsonObject event) {
  VariableMap correlationKeys = Variables.createVariables();
  if (event.get("orderId") != null) {
    correlationKeys.put("orderId", event.getString("orderId"));
  } else if (event.get("refId") != null) {
    correlationKeys.put("orderId", event.getString("refId"));
  } else if (event.get("pickId") != null) {
    correlationKeys.put("pickId", event.getString("pickId"));
  } else if (event.get("shipmentId") != null) {
    correlationKeys.put("shipmentId", event.getString("shipmentId"));
  }
  return correlationKeys;
}
 
开发者ID:flowing,项目名称:flowing-retail-old,代码行数:14,代码来源:CamundaBpmnOrderEventHandler.java

示例3: buildVariableMapFromVariableContext

import org.camunda.bpm.engine.variable.Variables; //导入方法依赖的package包/类
protected VariableMap buildVariableMapFromVariableContext(VariableContext variableContext) {

    VariableMap variableMap = Variables.createVariables();

    Set<String> variables = variableContext.keySet();
    for(String variable: variables) {
      variableMap.put(variable, variableContext.resolve(variable));
    }

    return variableMap;
  }
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:12,代码来源:DefaultDmnDecisionContext.java

示例4: assertExample

import org.camunda.bpm.engine.variable.Variables; //导入方法依赖的package包/类
public static void assertExample(DmnEngine engine, DmnDecision decision) {
  VariableMap variables = Variables.createVariables();
  variables.put("status", "bronze");
  variables.put("sum", 200);

  DmnDecisionTableResult results = engine.evaluateDecisionTable(decision, variables);
  assertThat(results)
    .hasSingleResult()
    .containsKeys("result", "reason")
    .containsEntry("result", "notok")
    .containsEntry("reason", "work on your status first, as bronze you're not going to get anything");

  variables.put("status", "silver");

  results = engine.evaluateDecisionTable(decision, variables);
  assertThat(results)
    .hasSingleResult()
    .containsKeys("result", "reason")
    .containsEntry("result", "ok")
    .containsEntry("reason", "you little fish will get what you want");

  variables.put("sum", 1200);

  results = engine.evaluateDecisionTable(decision, variables);
  assertThat(results)
    .hasSingleResult()
    .containsKeys("result", "reason")
    .containsEntry("result", "notok")
    .containsEntry("reason", "you took too much man, you took too much!");

  variables.put("status", "gold");
  variables.put("sum", 200);

  results = engine.evaluateDecisionTable(decision, variables);
  assertThat(results)
    .hasSingleResult()
    .containsKeys("result", "reason")
    .containsEntry("result", "ok")
    .containsEntry("reason", "you get anything you want");
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:41,代码来源:DmnExampleVerifier.java

示例5: initEngine

import org.camunda.bpm.engine.variable.Variables; //导入方法依赖的package包/类
@Before
public void initEngine() {
  variables = Variables.createVariables();

  List<FeelToJuelFunctionTransformer> customFunctionTransformers = new ArrayList<FeelToJuelFunctionTransformer>();
  customFunctionTransformers.add(new StartsWithFunctionTransformer());

  FeelEngineFactoryImpl feelEngineFactory = new FeelEngineFactoryImpl(customFunctionTransformers);

  feelEngine = feelEngineFactory.createInstance();
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:12,代码来源:FeelEngineCustomFunctionTest.java

示例6: handleEvent

import org.camunda.bpm.engine.variable.Variables; //导入方法依赖的package包/类
@Override
public boolean handleEvent(String type, String eventName, String transactionId, JsonObject event) {
  if ("Event".equals(type) && "OrderPlaced".equals(eventName)) {
    // Currently special handling to also persist the order

    Order order = parseOrder(event.getJsonObject("order"));
    // "Persist" order
    orderRepository.persistOrder(order);

    VariableMap variables = Variables.createVariables();
    variables.put("orderId", order.getId());
    variables.put("transactionId", transactionId);      
    engine.getRuntimeService().startProcessInstanceByKey("order", transactionId, variables);
    
    return true;
  } else {

    // Currently the transaction is NOT used for correlation, as we can assume
    // to hit some legacy system some time which is not able to handle it
    // That's why we only use it for tracking / monitoring purposes

    // Correlate by possible ids in this priority
    VariableMap correlationKeys = getCorrelationKeys(event);
  
    MessageCorrelationBuilder correlation = engine.getRuntimeService().createMessageCorrelation(eventName);
    ExecutionQuery query = engine.getRuntimeService().createExecutionQuery().messageEventSubscriptionName(eventName);
    
    for (String key : correlationKeys.keySet()) {
      correlation.processInstanceVariableEquals(key, correlationKeys.get(key));
      query.processVariableValueEquals(key, correlationKeys.get(key));
    }
    
    // if nobody waits for this event we consider it not to be for us
    if (query.count()==0) {
      return false;
    }

    // otherwise correlate it

    // add all possible additional correlation keys as variables to the flow
    VariableMap newVariables = getNewVariables(event);
    correlation.setVariables(newVariables);
    
    correlation.correlateWithResult();
    return true;      
  }
}
 
开发者ID:flowing,项目名称:flowing-retail-old,代码行数:48,代码来源:CamundaBpmnOrderEventHandler.java

示例7: initVariables

import org.camunda.bpm.engine.variable.Variables; //导入方法依赖的package包/类
@Before
public void initVariables() {
  variables = Variables.createVariables();
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:5,代码来源:DmnEngineTest.java

示例8: initVariables

import org.camunda.bpm.engine.variable.Variables; //导入方法依赖的package包/类
@Before
public void initVariables() {
  variables = Variables.createVariables();
  variables.putValue(INPUT_VARIABLE, 13);
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:6,代码来源:FeelExceptionTest.java


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