[jboss-jira] [JBoss JIRA] (DROOLS-1551) Implement FEEL/DMN value marshaller
Edson Tirelli (JIRA)
issues at jboss.org
Sun Jul 2 09:23:00 EDT 2017
[ https://issues.jboss.org/browse/DROOLS-1551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13430273#comment-13430273 ]
Edson Tirelli commented on DROOLS-1551:
---------------------------------------
Implemented 2 marshallers:
FEELStringMarshaller: https://github.com/kiegroup/drools/pull/1345/files#diff-1912b09200f1836e5cf31af32354f906R15
FEELCodeMarshaller: https://github.com/kiegroup/drools/pull/1345/files#diff-9bcf716d408c6a61ff585147fd355993R16
The main difference between them is that the String marshaller simply normalizes values and present them in a human readable format, while the Code marshaller produces a FEEL expression that can be executed to reconstruct the value.
For instance, marshalling the duration value P5Y2M with the String marshaller will result in:
P5Y2M
While using the Code marshaller will result in
duration( "P5Y2M" )
Both marshallers will normalize duration objects and set the negative sign, when appropriate, at the start of the expression as per the requirement.
> Implement FEEL/DMN value marshaller
> -----------------------------------
>
> Key: DROOLS-1551
> URL: https://issues.jboss.org/browse/DROOLS-1551
> Project: Drools
> Issue Type: Feature Request
> Components: dmn engine
> Affects Versions: 7.0.0.CR3
> Reporter: Edson Tirelli
> Assignee: Edson Tirelli
> Priority: Critical
>
> Some value types in FEEL/DMN require special formatting when marshalling/unmarshalling. For instance:
> {quote}
> So it seems that ISO 8601 does not define negative intervals. I.e., ISO 8601 only supports things like "PT1H". XPath extends that with a leading optional sign, like "+PT1H" and "-PT1H". Java extends that allowing the sign to be used in each of the units in the duration like, "PT+1H", "PT-1H", besides the leading sign "-PT1H".
> The FEEL spec on page 113 seems to follow the XPath lexical definition, so the leading sign "-PT1H" seems to be the correct format.
> {quote}
> Implement an object marshaller for DMN/FEEL that is capable of marshalling/unmarshalling objects. Most object types are straightforward, but a few of them (like durations) need special handling. In particular:
> * negative duration should use a leading - sign instead of having the sign in the unit numbers
> * durations need to be normalized before marshalled:
> {quote}
> A days and time duration in the semantic domain is a sequence of numbers for the days, hours, minutes, and seconds of duration, normalized such that the sum of these numbers is minimized.
> {quote}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list