Data Type Definition: Required and Optional data

179 views
Skip to first unread message

Weaver Swenson

unread,
Sep 25, 2023, 12:16:18 PM9/25/23
to Kogito development mailing list
I am looking for a way in DMN to declare that a piece of data is required or optional.   This is often called nullable and not nullable.  If a data item is marked as optional or nullable, then if it is not present, the value null is used for it.  If a data items is defined as required or not nullable, then if the data item is missing it is an error.

DMN data types can require an enumerated set of values.  They can define a require range for the value.  However I am not finding a way to state that a field is nullable or not.

I did note that Trisotech has some kind of annotation to indicate this, but I don't know how that is stored in the DMN file.  Does anyone know?  I assume it is a proprietary extension to the DMN format.

This seems like a required feature in DMN data type definition.  Any suggestions on how to store this in a DMN file?

Matteo Mortari

unread,
Sep 26, 2023, 2:28:33 AM9/26/23
to kogito-de...@googlegroups.com
Hi Keith,

not sure what is meant by "data item" (do you mean ItemDefinition or InputData?) but in general it seems to me you are missing to use the typecheck flag, which provides _most_ of the features you are asking for checking value passed must conform to the types defined in ItemDefinition
See:

"enumerations" in DMN are realized by means of explicitly listing the values of the enum, as literals, in the unary test allowedValues for its ItemDefinition.
To my knowledge, the feature Trisotech is offering, is a custom GUI checkbox that would "append the null literal" as part of the allowedValues (instead of, say, typing that in, manually) and they persist that information in the xml as an extended xml attribute.
For completeness, analogous concept (and Trisotech extension) for DT InputClause's InputValues. 

To my knowledge, InputData in DMN is never optional by design: you have discussed the DRD/DRG with the SME and stakeholder, and you have agreed a certain "input" is needed.

Hope this helps!


--
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/c61ffce0-7ae6-4549-b630-dca5537fc459n%40googlegroups.com.


--

Rhett S

unread,
Oct 1, 2023, 7:05:45 AM10/1/23
to kogito-de...@googlegroups.com
Labeling a type as optional is one purpose of nullable item/types. But that is really open to the design. but is see the point: If the designer of the system knows the information may not be available in some cases, label it as optional and then use nulls. 

If the data item is part of a larger enterprise data dictionary, perhaps this null check could be done outside the DMN. For instance, I've seen Data Quality services in enterprise systems that would execute this type of validation logic (null, mask,length, range, enum, etc). outside of the system that runs the business logic.

making a decision "based on the predetermined required info" vs "based on the information available" are two viable approaches. Often times, the best decision needs to be made, acknowledging that some information may not be available at the time of the decision, thus the decision moves forward with the info it was provided. For instance, in human lung-organ donors/donation, frequently a bronchoscope video is performed to provide additional information of the health of the organ. The results of the bronchoscope are valuable in defining the suitability of the organ, however a bronchscope video is not always performed/provided, and the suitability decision needs to be made regardless.

Onno Schmidt

unread,
Oct 16, 2023, 3:27:10 PM10/16/23
to Kogito development mailing list

I see typecheck property is mentioned here.

I am trying to get this input check to work on a Kogito project, what do I need to do to have this enabled?
I tried in several ways but never get this to work.
Reply all
Reply to author
Forward
0 new messages