bpmn-io / bpmn-io/extract-process-variables
Add context information to extractors
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
__Is your feature request related to a problem? Please describe__
Currently, all extractors retrieve the variables from a specific place. E.g. `extractFormFields` considers variables from camunda form fields.
It would be great if, after all variables got collected, we can determine in which context the variable was found. This would make it easier to offer navigation to the place the variable got created.
__Describe the solution you'd like__
I could imagine another field called `context` or `type` or `extractedFrom` when [creating the process variable information](https://github.com/bpmn-io/extract-process-variables/blob/1048507c9d8027243d8d826286764456ca5ba3c2/src/util/ProcessVariablesUtil.js#L37).
```js
{
name: 'myVariable,
origin: [ 'StartEvent_1' ],
scope: 'Process_1',
extractedFrom: 'camunda:formField`
};
```
__Describe alternatives you've considered__
Update data structure to handle origin element and type together, as we have [inside our prototype](https://github.com/pinussilvestrus/variables-prototypes/blob/main/packages/variables-modeler/src/features/variable-store/VariableStore.js#L24-L37).
```js
{
name: 'myVariable,
created: [
{
element: 'StartEvent_1',
type: 'camunda:formField'
}
],
used: [], // skip for now
scope: 'Process_1',
extractedFrom: 'camunda:formField`
};
```
__Additional context__
/
Contributor guide
Assessment
This issue has not been assessed yet.