JbpmJUnitBaseTestCase - 使用 DMN 测试流程

问题描述 投票:0回答:1

我正在尝试测试一个包含 dmn 表的进程。启动该过程时,我收到问题 DMN 模型“EvaluatePreChecks”未找到名称空间“xxxxxxxxx”。

手动测试和端到端测试工作正常。

我当前的代码就是那个:

未找到命名空间“xxxxxxx”的 DMN 模型“EvaluatePreChecks”

  public void testDMN() {
//      //KieSession workingMemory = createStatefulKnowledgeSessionFromRule(true);
//
    RuntimeManager runtimeManager = createRuntimeManager(Strategy.PROCESS_INSTANCE, "RunPreChecks",
        "RunPreChecks.bpmn");
    RuntimeEngine runtimeEngine = getRuntimeEngine(EmptyContext.get());
    KieSession ksession = runtimeEngine.getKieSession();
    MobileConcernFlowData mobileConcernFlowData = MobileConcernFlowData.builder()
        .concernId("concernId")
        .accountNumber(("accountNumber"))
        .hasActiveMobileSubscription(true)
        .hasDeliveredDevice(true)
        .build();

    Map<String, Object> params = new HashMap();
    params.put("concernFlowData", mobileConcernFlowData);

     Map<String,Object> result = new HashMap<>();
     result.put("isValidMobileAccount", true);
     ProcessInstance processInstance = (ProcessInstance)ksession.startProcess('RunPreChecks", params);
     assertProcessInstanceActive(processInstance.getId(), ksession);

    runtimeManager.disposeRuntimeEngine(runtimeEngine);
     runtimeManager.close();
  }

手动测试工作正常。

请问可以帮助任何人吗?

谢谢

寻找例子,如果我正在尝试的事情是否可能,等等

jbpm
1个回答
0
投票

在 jbpm 流程中包含简单的 DMN 规则节点时,我在单元测试中遇到了同样的问题。想知道是否有人可以成功执行带有场景的 JbpmJUnitBaseTestCase

org.jbpm.workflow.instance.WorkflowRuntimeException:[age_group_process:1 - 决策:3] - 未在命名空间“https://kiegroup.org/dmn/_BF7EAB11-F904-4974-992D-”中找到 DMN 模型“AgeGroup” D30A969013B3'

at org.jbpm.workflow.instance.node.RuleSetNodeInstance.handleException(RuleSetNodeInstance.java:215)
at org.jbpm.workflow.instance.node.RuleSetNodeInstance.internalTrigger(RuleSetNodeInstance.java:197)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:207)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:415)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:393)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:362)
at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:73)
at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:49)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:207)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:415)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:393)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:362)
at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:72)
at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:43)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:207)
at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:40)
at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:248)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:559)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:261)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:218)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:197)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:1815)
at org.acme.AgeGroupProcessTest.testAgeGroup(AgeGroupProcessTest.java:56)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

引起:java.lang.IllegalArgumentException:未找到命名空间“https://kiegroup.org/dmn/_BF7EAB11-F904-4974-992D-D30A969013B3”的DMN模型“AgeGroup” 在 org.jbpm.workflow.instance.node.RuleSetNodeInstance.internalTrigger(RuleSetNodeInstance.java:128)

© www.soinside.com 2019 - 2024. All rights reserved.