本文整理汇总了Java中org.camunda.bpm.dmn.engine.DmnDecisionTableResult类的典型用法代码示例。如果您正苦于以下问题:Java DmnDecisionTableResult类的具体用法?Java DmnDecisionTableResult怎么用?Java DmnDecisionTableResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DmnDecisionTableResult类属于org.camunda.bpm.dmn.engine包,在下文中一共展示了DmnDecisionTableResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: execute
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
public Map<String, Object> execute()
{
DmnEngine dmnEngine = DmnEngineConfiguration.createDefaultDmnEngineConfiguration().buildEngine();
try
{
DmnDecision decision = dmnEngine.parseDecision("decision", dmnInputStream);
DmnDecisionTableResult result = dmnEngine.evaluateDecisionTable(decision, variables);
if (result.getFirstResult() == null)
{
return Collections.emptyMap();
}
return result.getFirstResult().getEntryMap();
}
finally
{
try
{
dmnInputStream.close();
}
catch (IOException e)
{
// close silently
}
}
}
开发者ID:ivy-supplements,项目名称:bpm-beans,代码行数:26,代码来源:DmnExecutor.java
示例2: testMultipleOutputValues
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testMultipleOutputValues() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(MULTIPLE_OUTPUT_VALUES);
assertThat(decisionResult).hasSize(1);
assertMultipleOutputValues(decisionResult.getFirstResult());
try {
decisionResult.getSingleEntry();
failBecauseExceptionWasNotThrown(DmnDecisionResultException.class);
}
catch (DmnDecisionResultException e){
assertThat(e)
.hasMessageStartingWith("DMN-01007")
.hasMessageContaining("multipleValues1")
.hasMessageContaining("multipleValues2");
}
}
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:20,代码来源:DmnDecisionTableResultTest.java
示例3: testOutputList
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testOutputList() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE, MULTIPLE_OUTPUT_VALUES);
List<Map<String, Object>> entryMapList = decisionResult.getResultList();
assertThat(entryMapList).hasSize(2);
Map<String, Object> firstResult = entryMapList.get(0);
assertThat(firstResult).hasSize(1);
assertThat(firstResult).containsEntry("firstOutput", "singleValue");
Map<String, Object> secondResult = entryMapList.get(1);
assertThat(secondResult).hasSize(2);
assertThat(secondResult).containsEntry("firstOutput", "multipleValues1");
assertThat(secondResult).containsEntry("secondOutput", "multipleValues2");
}
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:18,代码来源:DmnDecisionTableResultTest.java
示例4: testSingleOutputUntypedValue
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleOutputUntypedValue() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();
TypedValue typedEntry = ruleResult.getEntryTyped("firstOutput");
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
typedEntry = ruleResult.getEntryTyped("secondOutput");
assertThat(typedEntry).isNull();
typedEntry = ruleResult.getFirstEntryTyped();
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
typedEntry = ruleResult.getSingleEntryTyped();
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
}
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:21,代码来源:DmnDecisionTableResultTest.java
示例5: testSingleOutputTypedValue
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleOutputTypedValue() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();
TypedValue typedValue = ruleResult.getEntryTyped("firstOutput");
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
typedValue = ruleResult.getEntryTyped("secondOutput");
assertThat(typedValue).isNull();
typedValue = ruleResult.getFirstEntryTyped();
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
typedValue = ruleResult.getSingleEntryTyped();
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
}
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:21,代码来源:DmnDecisionTableResultTest.java
示例6: shouldEvaluateDecisionsWithDifferentInputAndOutputTypes
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
public void shouldEvaluateDecisionsWithDifferentInputAndOutputTypes() {
DmnDecisionTableResult results = dmnEngine.evaluateDecisionTable(parseDecisionFromFile("A", DMN_DECISIONS_WITH_DIFFERENT_INPUT_OUTPUT_TYPES) , createVariables()
.putValue("dd", "5")
.putValue("ee", 21)
.asVariableContext());
assertThat(results.get(0))
.containsEntry("aa", 7.1);
results = dmnEngine.evaluateDecisionTable(parseDecisionFromFile("A", DMN_DECISIONS_WITH_DIFFERENT_INPUT_OUTPUT_TYPES) , createVariables()
.putValue("dd", "5")
.putValue("ee", 2147483650L)
.asVariableContext());
assertThat(results.get(0))
.containsEntry("aa", 7.0);
}
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:19,代码来源:DmnDecisionEvaluationTest.java
示例7: testCollectHitPolicySingleOutputMultipleMatchingRules
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@DecisionResource(resource = COLLECT_SINGLE)
public void testCollectHitPolicySingleOutputMultipleMatchingRules() {
DmnDecisionTableResult results = evaluateDecisionTable(true, true, false, "a", "b", "c");
assertThat(results).hasSize(2);
assertThat(collectSingleOutputEntries(results)).containsOnlyOnce("a", "b");
results = evaluateDecisionTable(true, false, true, "a", "b", "c");
assertThat(results).hasSize(2);
assertThat(collectSingleOutputEntries(results)).containsOnlyOnce("a", "c");
results = evaluateDecisionTable(false, true, true, "a", "b", "c");
assertThat(results).hasSize(2);
assertThat(collectSingleOutputEntries(results)).containsOnlyOnce("b", "c");
results = evaluateDecisionTable(true, true, true, "a", "b", "c");
assertThat(results).hasSize(3);
assertThat(collectSingleOutputEntries(results)).containsOnlyOnce("a", "b", "c");
}
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:20,代码来源:HitPolicyTest.java
示例8: testCollectHitPolicyCompoundOutputSingleMatchingRule
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@DecisionResource(resource = COLLECT_COMPOUND)
public void testCollectHitPolicyCompoundOutputSingleMatchingRule() {
DmnDecisionTableResult results = evaluateDecisionTable(true, false, false, "a", "b", "c");
assertThat(results)
.hasSingleResult()
.containsOnly(entry("out1", "a"), entry("out2", "a"), entry("out3", "a"));
results = evaluateDecisionTable(false, true, false, "a", "b", "c");
assertThat(results)
.hasSingleResult()
.containsOnly(entry("out1", "b"), entry("out2", "b"), entry("out3", "b"));
results = evaluateDecisionTable(false, false, true, "a", "b", "c");
assertThat(results)
.hasSingleResult()
.containsOnly(entry("out1", "c"), entry("out2", "c"), entry("out3", "c"));
}
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:19,代码来源:HitPolicyTest.java
示例9: evaluateAerzteArzneiTarifAB
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@Deployment(resources = SKILL_DMN_RESOURCE)
public void evaluateAerzteArzneiTarifAB() throws Exception {
DmnDecisionTableResult results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(
DECISION_KEY,
Variables.createVariables().putValue(REQUIRED_SKILLS, Lists.<String> newArrayList("GOÄ", "AMNOG", "TAR_AB"))
.putValue(REQUIRED_AUTH, Lists.<String> newArrayList()));
assertEquals(3, FluentIterable.from(results).size());
assertEquals("Herbert", FluentIterable.from(results).get(0).get(CANDIDATE_USERS));
assertEquals("Andreas", FluentIterable.from(results).get(1).get(CANDIDATE_USERS));
assertEquals("Sonja", FluentIterable.from(results).get(2).get(CANDIDATE_USERS));
results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(REQUIRED_SKILLS, Lists.<String> newArrayList("GOZ")).putValue(REQUIRED_AUTH, Lists.<String> newArrayList("Not permitted")));
assertEquals(0, FluentIterable.from(results).size());
}
开发者ID:holisticon,项目名称:skill-based-routing,代码行数:21,代码来源:RoutingRuleTest.java
示例10: evaluateZahnarzt
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@Deployment(resources = SKILL_DMN_RESOURCE)
public void evaluateZahnarzt() throws Exception {
DmnDecisionTableResult results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(REQUIRED_SKILLS, Lists.<String> newArrayList("GOZ")).putValue(REQUIRED_AUTH, Lists.<String> newArrayList()));
assertEquals(3, FluentIterable.from(results).size());
assertEquals("Herbert", FluentIterable.from(results).get(0).get(CANDIDATE_USERS));
assertEquals("Sonja", FluentIterable.from(results).get(1).get(CANDIDATE_USERS));
assertEquals("Xaver", FluentIterable.from(results).get(2).get(CANDIDATE_USERS));
results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(REQUIRED_SKILLS, Lists.<String> newArrayList("GOZ")).putValue(REQUIRED_AUTH, Lists.<String> newArrayList("Not permitted")));
assertEquals(0, FluentIterable.from(results).size());
}
开发者ID:holisticon,项目名称:skill-based-routing,代码行数:19,代码来源:RoutingRuleTest.java
示例11: evaluateHeilmittel
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@Deployment(resources = SKILL_DMN_RESOURCE)
public void evaluateHeilmittel() throws Exception {
DmnDecisionTableResult results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(REQUIRED_SKILLS, Lists.<String> newArrayList("HeilM-RL")).putValue(REQUIRED_AUTH, Lists.<String> newArrayList()));
assertEquals(3, FluentIterable.from(results).size());
assertEquals("Herbert", FluentIterable.from(results).get(0).get(CANDIDATE_USERS));
assertEquals("Sonja", FluentIterable.from(results).get(1).get(CANDIDATE_USERS));
assertEquals("Hanna", FluentIterable.from(results).get(2).get(CANDIDATE_USERS));
results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(REQUIRED_SKILLS, Lists.<String> newArrayList("GOZ")).putValue(REQUIRED_AUTH, Lists.<String> newArrayList("Not permitted")));
assertEquals(0, FluentIterable.from(results).size());
}
开发者ID:holisticon,项目名称:skill-based-routing,代码行数:19,代码来源:RoutingRuleTest.java
示例12: evaluateAuthExkassoSVIP
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@Deployment(resources = AUTH_DMN_RESOURCE)
public void evaluateAuthExkassoSVIP() throws Exception {
final TaskHolder task = new TaskHolder();
task.setTaskDefinitionKey(TASK_ZAHLUNG_FREIGEBEN);
DmnDecisionTableResult results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(TaskHolder.TASK, task).putValue(RECHNUNGSART, "").putValue(ERSTATTUNG, 0).putValue(KUNDENSTATUS, KS_VIP));
assertEquals(1, results.getResultList().size());
assertEquals("EXKASSO_S", results.get(0).get(REQUIRED_AUTH));
results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(TaskHolder.TASK, task).putValue(RECHNUNGSART, "").putValue(ERSTATTUNG, 199).putValue(KUNDENSTATUS, KS_VIP));
assertEquals(1, results.getResultList().size());
assertEquals("EXKASSO_S", results.get(0).get(REQUIRED_AUTH));
results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(TaskHolder.TASK, task).putValue(RECHNUNGSART, "").putValue(ERSTATTUNG, 500).putValue(KUNDENSTATUS, KS_VIP));
assertEquals(1, results.getResultList().size());
assertEquals("EXKASSO_S", results.get(0).get(REQUIRED_AUTH));
}
开发者ID:holisticon,项目名称:skill-based-routing,代码行数:27,代码来源:AuthorizationRuleTest.java
示例13: evaluateAuthExkassoSStandard
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@Deployment(resources = AUTH_DMN_RESOURCE)
public void evaluateAuthExkassoSStandard() throws Exception {
final TaskHolder task = new TaskHolder();
task.setTaskDefinitionKey(TASK_ZAHLUNG_FREIGEBEN);
DmnDecisionTableResult results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(TaskHolder.TASK, task).putValue(RECHNUNGSART, "").putValue(ERSTATTUNG, 0).putValue(KUNDENSTATUS, KS_STANDARD));
assertEquals(1, results.getResultList().size());
assertEquals("EXKASSO_S", results.get(0).get(REQUIRED_AUTH));
results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(TaskHolder.TASK, task).putValue(RECHNUNGSART, "").putValue(ERSTATTUNG, 78).putValue(KUNDENSTATUS, KS_STANDARD));
assertEquals(1, results.getResultList().size());
assertEquals("EXKASSO_S", results.get(0).get(REQUIRED_AUTH));
results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(TaskHolder.TASK, task).putValue(RECHNUNGSART, "").putValue(ERSTATTUNG, 99).putValue(KUNDENSTATUS, KS_STANDARD));
assertEquals(1, results.getResultList().size());
assertEquals("EXKASSO_S", results.get(0).get(REQUIRED_AUTH));
}
开发者ID:holisticon,项目名称:skill-based-routing,代码行数:27,代码来源:AuthorizationRuleTest.java
示例14: evaluateAuthExkassoMStandard
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@Deployment(resources = AUTH_DMN_RESOURCE)
public void evaluateAuthExkassoMStandard() throws Exception {
final TaskHolder task = new TaskHolder();
task.setTaskDefinitionKey(TASK_ZAHLUNG_FREIGEBEN);
DmnDecisionTableResult results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(TaskHolder.TASK, task).putValue(RECHNUNGSART, "").putValue(ERSTATTUNG, 100).putValue(KUNDENSTATUS, KS_STANDARD));
assertEquals(1, results.getResultList().size());
assertEquals("EXKASSO_M", results.get(0).get(REQUIRED_AUTH));
results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(TaskHolder.TASK, task).putValue(RECHNUNGSART, "").putValue(ERSTATTUNG, 213).putValue(KUNDENSTATUS, KS_STANDARD));
assertEquals(1, results.getResultList().size());
assertEquals("EXKASSO_M", results.get(0).get(REQUIRED_AUTH));
results = processEngineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_KEY,
Variables.createVariables().putValue(TaskHolder.TASK, task).putValue(RECHNUNGSART, "").putValue(ERSTATTUNG, 500).putValue(KUNDENSTATUS, KS_STANDARD));
assertEquals(1, results.getResultList().size());
assertEquals("EXKASSO_M", results.get(0).get(REQUIRED_AUTH));
}
开发者ID:holisticon,项目名称:skill-based-routing,代码行数:27,代码来源:AuthorizationRuleTest.java
示例15: evaluateDecisionTable
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@PostDeploy
public void evaluateDecisionTable(ProcessEngine processEngine) {
DecisionService decisionService = processEngine.getDecisionService();
VariableMap variables = Variables.createVariables()
.putValue("season", "Spring")
.putValue("guestCount", 10)
.putValue("guestsWithChildren", false);
DmnDecisionTableResult dishDecisionResult = decisionService.evaluateDecisionTableByKey("dish", variables);
String desiredDish = dishDecisionResult.getSingleEntry();
System.out.println("Desired dish: " + desiredDish);
DmnDecisionTableResult beveragesDecisionResult = decisionService.evaluateDecisionTableByKey("beverages", variables);
List<Object> beverages = beveragesDecisionResult.collectEntries("beverages");
System.out.println("Desired beverages: " + beverages);
}
开发者ID:camunda,项目名称:camunda-get-started-dmn,代码行数:21,代码来源:DinnerApplication.java
示例16: evaluateDecisionById
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@Deployment(resources = DMN_FILE)
public void evaluateDecisionById() {
// given
DecisionDefinition decisionDefinition = engineRule.getRepositoryService().createDecisionDefinitionQuery().singleResult();
// when
authRule.init(scenario).withUser("userId").bindResource("decisionDefinitionKey", DECISION_DEFINITION_KEY).start();
DmnDecisionTableResult decisionResult = engineRule.getDecisionService().evaluateDecisionTableById(decisionDefinition.getId(), createVariables());
// then
if (authRule.assertScenario(scenario)) {
assertThatDecisionHasExpectedResult(decisionResult);
}
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:EvaluateDecisionAuthorizationTest.java
示例17: evaluateDecisionByKey
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@Deployment(resources = DMN_FILE)
public void evaluateDecisionByKey() {
// given
DecisionDefinition decisionDefinition = engineRule.getRepositoryService().createDecisionDefinitionQuery().singleResult();
// when
authRule.init(scenario).withUser("userId").bindResource("decisionDefinitionKey", DECISION_DEFINITION_KEY).start();
DmnDecisionTableResult decisionResult = engineRule.getDecisionService().evaluateDecisionTableByKey(decisionDefinition.getKey(), createVariables());
// then
if (authRule.assertScenario(scenario)) {
assertThatDecisionHasExpectedResult(decisionResult);
}
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:EvaluateDecisionAuthorizationTest.java
示例18: evaluateDecisionByKeyAndVersion
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Test
@Deployment(resources = DMN_FILE)
public void evaluateDecisionByKeyAndVersion() {
// given
DecisionDefinition decisionDefinition = engineRule.getRepositoryService().createDecisionDefinitionQuery().singleResult();
// when
authRule.init(scenario).withUser("userId").bindResource("decisionDefinitionKey", DECISION_DEFINITION_KEY).start();
DmnDecisionTableResult decisionResult = engineRule.getDecisionService().evaluateDecisionTableByKeyAndVersion(decisionDefinition.getKey(),
decisionDefinition.getVersion(), createVariables());
// then
if (authRule.assertScenario(scenario)) {
assertThatDecisionHasExpectedResult(decisionResult);
}
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:EvaluateDecisionAuthorizationTest.java
示例19: apply
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
@Override
public CandidateGroup apply(final String decisionTable, final BusinessData businessData) {
DmnDecisionTableResult result = decisionService.evaluateDecisionTableByKey(decisionTable, businessData.toVariables());
DmnDecisionRuleResult singleResult = result.getSingleResult();
return singleResult != null ? new CandidateGroup(singleResult.getSingleEntry()) : CandidateGroup.empty();
}
开发者ID:holisticon,项目名称:holunda,代码行数:9,代码来源:EvaluateDecisionTable.java
示例20: handleProcessLog
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult; //导入依赖的package包/类
/**
* Checks if the current execution matches the configuration. If {@code yes} performs desired
* operation; here just prints a message that was specified in the DMN model.
*
* @param execution the current execution
*/
private void handleProcessLog(final DelegateExecution execution) {
if (execution.getCurrentActivityId() != null && execution.getEventName() != null) {
VariableMap variables =
Variables.putValue("activityId", execution.getCurrentActivityId())
.putValue("eventName", execution.getEventName());
DmnDecisionTableResult result =
dmnEngine.evaluateDecisionTable(eventLogDecision, variables);
if (!result.isEmpty()) {
// the configuration matched the event
System.out.println(">>> " + result.getSingleEntry().toString());
}
}
}
开发者ID:FrVaBe,项目名称:camunda,代码行数:20,代码来源:GlobalExecutionListener.java
注:本文中的org.camunda.bpm.dmn.engine.DmnDecisionTableResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论