dmn integration with bpmn : does not recognize 'years and months duration' function

203 views
Skip to first unread message

Ravi Mangalagiri

unread,
May 30, 2022, 10:35:42 PM5/30/22
to Kogito development mailing list
Hi Kogito Team,
I built a small example project plugging 2 dmns in a bpmn and got the following exception.

 Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.kie.kogito.process.ProcessInstanceExecutionException: Process instance with id 55f1d72b-d61f-44b7-9953-d85e077ecf0b failed becuase of java.lang.RuntimeException - DMN result errors:: Message [id=0, level=ERROR, path=null, line=24, column=-1
   text=DMN: FEEL ERROR while evaluating literal expression 'years and months duration(s.dob, today())': Unable to find function 'years and months duration( lass org.kie.dmn.feel.runtime.functions.YearsAndMonthsFunctio )' (DMN id: _BA857A0A-5548-4F6D-9631-2B2E2A463F5E, FEEL expression evaluation error) ]] with root cause

java.lang.RuntimeException: DMN result errors:: Message [id=0, level=ERROR, path=null, line=24, column=-1
   text=DMN: FEEL ERROR while evaluating literal expression 'years and months duration(s.dob, today())': Unable to find function 'years and months duration( lass org.kie.dmn.feel.runtime.functions.YearsAndMonthsFunctio )' (DMN id: _BA857A0A-5548-4F6D-9631-2B2E2A463F5E, FEEL expression evaluation error) ]
        at org.jbpm.workflow.instance.node.RuleSetNodeInstance.internalTrigger(RuleSetNodeInstance.java:123) ~[jbpm-flow-1.20.0.Final.jar:1.20.0.Final]
        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:225) ~[jbpm-flow-1.20.0.Final.jar:1.20.0.Final]
        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:424) ~[jbpm-flow-1.20.0.Final.jar:1.20.0.Final]
        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:409) ~[jbpm-flow-1.20.0.Final.jar:1.20.0.Final]
        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:379) ~[jbpm-flow-1.20.0.Final.jar:1.20.0.Final]
        at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:71) ~[jbpm-flow-1.20.0.Final.jar:1.20.0.Final]

Not sure what I am missing. Sample project attached.
--
Ravi Mangalagiri
bpmn-orchestrator.zip

Matteo Mortari

unread,
May 31, 2022, 3:05:54 AM5/31/22
to Kogito development mailing list
Hi Ravi,

the "years and month duration()" built-in function requires 2 parameters of the same type: https://kiegroup.github.io/dmn-feel-handbook/#years-and-months-duration-from-to

It is very likely the case that `s.dob` is not a FEEL date, given today() always returns a FEEL date, hence the error.

I would suggest you ensure you are passing s.dob as a FEEL date to the DMN model, or that you convert s.dob as a FEEL date otherwise.

Hope this helps!
MM

--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/CALg%3DC8MqaZ3g_EfryLdpFM4wd0i5%2BnEc8D1LKW%3DqV8RKCeH6UA%40mail.gmail.com.


--

Ravi Mangalagiri

unread,
May 31, 2022, 4:13:04 PM5/31/22
to Kogito development mailing list
Let me investigate more...



--
Ravi Mangalagiri
Reply all
Reply to author
Forward
0 new messages