Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMN improvements for demo #4269

Closed
3 tasks done
joeribekker opened this issue May 6, 2024 · 2 comments · Fixed by #4282
Closed
3 tasks done

DMN improvements for demo #4269

joeribekker opened this issue May 6, 2024 · 2 comments · Fixed by #4282
Assignees
Labels
enhancement needs-backport Fix must be backported to stable release branch owner: den-haag topic: DMN
Milestone

Comments

@joeribekker
Copy link
Contributor

joeribekker commented May 6, 2024

Some improvements to the DMN UI

  • When selecting a decision definition/table to evaluate, the dependencies in the DRD do not seem to be taken into account
  • Consequently, only the inputs of a single table, but not as a whole DRD are taken into account
  • Check if we can directly provide the necessary inputs instead of a required decision
  • Using a + b expressions in an input expression is... uncommon. We don't necessarily need to support this right now.
  • Invoking a table for each item in an editgrid (repeating group)?
  • Try out -> and relay back error message

Useful resource: https://consulting.camunda.com/dmn-simulator/

Tasks

  • Update DMN parser in django-camunda to correctly resolve requirements and their inputs - this doesn't seem to go right now
  • Add JS library (https://github.com/nikku/feelin/blob/main/src/parser.ts) to parse the FEEL expressions client-side to extract the remaining input parameters.
  • Ensure that we can configure variable mappings with implicit parameters (e.g. input with a + b FEEL expression -> vars a and b)
@sergei-maertens
Copy link
Member

sergei-maertens commented May 7, 2024

Findings of research done for this ticket:

  • Camunda 7.20 implements a part of DMN 1.3
    • It only supports two kinds of boxed expressions: decision table and literal expression. DMN spec itself supports more.
    • It does not support business knowledge models, which is much more advanced and can be used for advanced decision modelling. This could be a direction to deal with repeating groups.
    • It does seem to support contexts per decision, but this doesn't appear to be explicitly exposed in the modeller. Untested.
  • When a decision has (one or more other) required decisions, then the input parameters of that need to be provided.
    • It does not seem possible in Camunda to evaluate a leaf decision by providing all of its inputs directly, thereby skipping the requirement.
    • Likely evaluating the requirement by itself is possible.
    • Camunda only returns the output of the requested decision, not the outputs of all intermediates (not sure how their playground works then...)
  • The DROOLS DMN engine seems more full-featured and can be a nice reference. Way out of scope for here though!
  • The Camunda modeler only supports primitive types for inputs, so we have a problem with repeating groups (putting that out of scope for now, it may be solvable in OF rather than at the Camunda level)
  • FEEL expression language is part of the standard and the default. We only support FEEL (Camunda supports JS, Python... too)

sergei-maertens added a commit that referenced this issue May 8, 2024
The input expressions require additional parsing to properly extract
the required input variables for a decision table.
sergei-maertens added a commit that referenced this issue May 8, 2024
This should help form builders configure DMN tables to see
which input expressions are expected by the decision engine.
sergei-maertens added a commit that referenced this issue May 8, 2024
Input expressions can be complex with the actual requested variable buried
deep inside. We leverage the 'feelin' library to parse FEEL expressions
so that we can extract the actual (likely) expected variables and
combine this information with our retrieved input clauses.

This result is used to build a list of DMN variables for input
mapping - this list is ordered to put labeled literal variables
at the top, followed by the extracted unlabeled variables, and
finally the legal identifiers that are labeled but likely
complex/edge cases.

This implements the DMN 1.3 FEEL identifier specification to
select candidates.
sergei-maertens added a commit that referenced this issue May 8, 2024
Use the existing VariableSelection component to render a
dropdown of available Open Forms variables.

Added an accessible label to the dropdowns in the mapping
tables.
sergei-maertens added a commit that referenced this issue May 8, 2024
Updated the assertions for the existing stories so that the
interaction tests pass again.

Added a story for the complex expression cases.
@sergei-maertens sergei-maertens changed the title DMN improvements (sergei will fill in) DMN improvements for demo May 8, 2024
sergei-maertens added a commit that referenced this issue May 8, 2024
This has the correct input dependency resolution implementation.
sergei-maertens added a commit that referenced this issue May 8, 2024
The input expressions require additional parsing to properly extract
the required input variables for a decision table.
sergei-maertens added a commit that referenced this issue May 8, 2024
This should help form builders configure DMN tables to see
which input expressions are expected by the decision engine.
sergei-maertens added a commit that referenced this issue May 8, 2024
Input expressions can be complex with the actual requested variable buried
deep inside. We leverage the 'feelin' library to parse FEEL expressions
so that we can extract the actual (likely) expected variables and
combine this information with our retrieved input clauses.

This result is used to build a list of DMN variables for input
mapping - this list is ordered to put labeled literal variables
at the top, followed by the extracted unlabeled variables, and
finally the legal identifiers that are labeled but likely
complex/edge cases.

This implements the DMN 1.3 FEEL identifier specification to
select candidates.
sergei-maertens added a commit that referenced this issue May 8, 2024
Use the existing VariableSelection component to render a
dropdown of available Open Forms variables.

Added an accessible label to the dropdowns in the mapping
tables.
sergei-maertens added a commit that referenced this issue May 8, 2024
Updated the assertions for the existing stories so that the
interaction tests pass again.

Added a story for the complex expression cases.
sergei-maertens added a commit that referenced this issue May 8, 2024
This has the correct input dependency resolution implementation.
@sergei-maertens sergei-maertens added the needs-backport Fix must be backported to stable release branch label May 8, 2024
@sergei-maertens
Copy link
Member

While these are enhancements, they are critical enhancements to be backported because in its current state, DMN integration is not usable.

sergei-maertens added a commit that referenced this issue May 8, 2024
The input expressions require additional parsing to properly extract
the required input variables for a decision table.
sergei-maertens added a commit that referenced this issue May 8, 2024
This should help form builders configure DMN tables to see
which input expressions are expected by the decision engine.
sergei-maertens added a commit that referenced this issue May 8, 2024
Input expressions can be complex with the actual requested variable buried
deep inside. We leverage the 'feelin' library to parse FEEL expressions
so that we can extract the actual (likely) expected variables and
combine this information with our retrieved input clauses.

This result is used to build a list of DMN variables for input
mapping - this list is ordered to put labeled literal variables
at the top, followed by the extracted unlabeled variables, and
finally the legal identifiers that are labeled but likely
complex/edge cases.

This implements the DMN 1.3 FEEL identifier specification to
select candidates.
sergei-maertens added a commit that referenced this issue May 8, 2024
Use the existing VariableSelection component to render a
dropdown of available Open Forms variables.

Added an accessible label to the dropdowns in the mapping
tables.
sergei-maertens added a commit that referenced this issue May 8, 2024
Updated the assertions for the existing stories so that the
interaction tests pass again.

Added a story for the complex expression cases.
sergei-maertens added a commit that referenced this issue May 8, 2024
This has the correct input dependency resolution implementation.
sergei-maertens added a commit that referenced this issue May 8, 2024
The input expressions require additional parsing to properly extract
the required input variables for a decision table.
sergei-maertens added a commit that referenced this issue May 8, 2024
This should help form builders configure DMN tables to see
which input expressions are expected by the decision engine.
sergei-maertens added a commit that referenced this issue May 8, 2024
Input expressions can be complex with the actual requested variable buried
deep inside. We leverage the 'feelin' library to parse FEEL expressions
so that we can extract the actual (likely) expected variables and
combine this information with our retrieved input clauses.

This result is used to build a list of DMN variables for input
mapping - this list is ordered to put labeled literal variables
at the top, followed by the extracted unlabeled variables, and
finally the legal identifiers that are labeled but likely
complex/edge cases.

This implements the DMN 1.3 FEEL identifier specification to
select candidates.
sergei-maertens added a commit that referenced this issue May 8, 2024
Use the existing VariableSelection component to render a
dropdown of available Open Forms variables.

Added an accessible label to the dropdowns in the mapping
tables.
sergei-maertens added a commit that referenced this issue May 8, 2024
Updated the assertions for the existing stories so that the
interaction tests pass again.

Added a story for the complex expression cases.
sergei-maertens added a commit that referenced this issue May 8, 2024
This has the correct input dependency resolution implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs-backport Fix must be backported to stable release branch owner: den-haag topic: DMN
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants