DigitalState / Admin

The DigitalState Administration Spa
MIT License
3 stars 1 forks source link

Add ability to add custom variable/property into a Service Scenario #68

Closed StephenOTT closed 6 years ago

StephenOTT commented 6 years ago

Add ability to add a custom variable into the Configs column.

@baddlan

baddlan commented 6 years ago

@mario-digitalstate I added two UI fields to BPM scenarios to inject custom_data in the config property as follows:

...
"config": {
    "bpm": "camunda",
    "process_definition_key": "pothole-report",
    "custom_data": {
        "enable_custom_variables": true,
        "variable_value": {
            "aaa": "bbb"
        },
        "variable_name": "my_var"
    }
},
...
marioprudhomme commented 6 years ago
...
"config": {
    "bpm": "camunda",
    "process_definition_key": "pothole-report",
    "process_custom_data": {
        "enabled": true,
        "value": { // Always holds json object
            "aaa": "bbb"
        }
    },
},
...

variable name will be stored as a configuration under app.bpm.variables.scenario_custom_data, keeping the variable scope clean

type is ommitted for now to keep it simple, and assumed json. later on if we want to add types, the code will assume json if none provided, for backward compatibility.

StephenOTT commented 6 years ago

Notes: The variable name is controlled through a MS config.

StephenOTT commented 6 years ago

@mario-digitalstate in your sample, you say "Always holds json object", does that mean a json array is not supported?

marioprudhomme commented 6 years ago

as long as its a camunda json type compatible value, it can be anything

StephenOTT commented 6 years ago

okay. 👍 looks good.

marioprudhomme commented 6 years ago

Backend is done. Once ui has been adjusted, this issue can be closed

baddlan commented 6 years ago

UI updated.