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

Document configuration options #688

Open
barmac opened this issue Feb 23, 2022 · 8 comments
Open

Document configuration options #688

barmac opened this issue Feb 23, 2022 · 8 comments
Labels
backlog Queued in backlog documentation Improvements or additions to documentation

Comments

@barmac
Copy link
Member

barmac commented Feb 23, 2022

What should we do?

With dmn-js 12, the library will expose at least two configuration options:

  • data types
  • expression languages (and defaults)

Let's document this is currently everything is burried in the source code. This could be part of the usage section of the readme.

Why should we do it?

Let's make the features discoverable.

@barmac barmac added backlog Queued in backlog documentation Improvements or additions to documentation labels Feb 23, 2022
@nikku
Copy link
Member

nikku commented Feb 24, 2022

Consider the good practice we talked about in the context of bpmn-js: Have a dedicated configuration example that we can link to that showcases how configuration works and configuration basics.

@nikku
Copy link
Member

nikku commented Feb 24, 2022

Link that example from the readme, where appropriate.

@CarstenWickner
Copy link
Contributor

Hi @barmac, @nikku, @pinussilvestrus,

Is there a simple example somewhere for those configuration options?
I've been searching for some time now, but can't find a single one.
I'd be happy with a single JSON example for the "configuration" object.
Mostly the default expression language configuration would be relevant, as we want to reflect the "legacy" engine options (JUEL instead of FEEL by default) also in the newer Modeler component.

Extra question: would these things be configured differently under dmn-js 11 (we haven't braved the breaking changes in version 12 yet) or is the configuration object the same then?

@barmac
Copy link
Member Author

barmac commented Nov 15, 2022

Data types:


Expression languages:

It hasn't changed since it was implemented.

@CarstenWickner
Copy link
Contributor

Okay, cool. Thanks for that.
So it would be something like this, I guess:

new DmnJS({
    common: {
        dataTypes: [
            'string',
            'boolean',
            'integer',
            'long',
            'double',
            'date'
        ],
        expressionLanguages: {
            options: [
                { value: 'juel', label: 'JUEL' },
                { value: 'javascript', label: 'JavaScript' },
                { value: 'feel', label: 'FEEL' }
            ],
            defaults: {
                inputCell: 'feel',
                outputCell: 'juel',
                editor: 'juel'
            }
        }
    }
})

If I understand it correctly, the defaults.editor is a fall-back, i.e., in the above case the matching default.outputCell could be omitted.

One extra question though: how to differentiate between an input expression (i.e., in the input column header, that in the past had "juel" as default) vs. an input cell (that in the past had "feel" as default already)?

@barmac
Copy link
Member Author

barmac commented Nov 16, 2022

If I understand it correctly, the defaults.editor is a fall-back, i.e., in the above case the matching default.outputCell could be omitted.

Correct.

One extra question though: how to differentiate between an input expression (i.e., in the input column header, that in the past had "juel" as default) vs. an input cell (that in the past had "feel" as default already)?

If your input expression should have a different default than the editor, you would need to build a custom extension. We don't support that finely grained configuration.

Also, what decision engine do you use?

@CarstenWickner
Copy link
Contributor

CarstenWickner commented Nov 16, 2022

We're using the Camunda decision engine for years now.
The "legacy" behavior was:

  • JUEL as default in input column expressions and output cells
  • FEEL as default in input cells

https://github.com/camunda/camunda-bpm-platform/blob/7c5bf37307d3eeac3aee5724b6e4669a9992eaba/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java#L102-L113

We are just trying to recreate the same behaviour (in order to ensure backward compatibility for the hundreds of stored decision tables) when upgrading to a more recent version of both the engine and the editor component.

@barmac
Copy link
Member Author

barmac commented Nov 17, 2022

Indeed, the configuration you provided should maintain the legacy defaults.

If you ever plan to migrate to the new defaults, this will require batch change of the diagrams to set the expression language property for non-FEEL expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog documentation Improvements or additions to documentation
Development

No branches or pull requests

3 participants