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

Offer two-way conversion of supported BpmnElementTypes to BpmnModelConstants #7506

Closed
RomanJRW opened this issue Jul 15, 2021 · 0 comments · Fixed by #7507
Closed

Offer two-way conversion of supported BpmnElementTypes to BpmnModelConstants #7506

RomanJRW opened this issue Jul 15, 2021 · 0 comments · Fixed by #7507
Assignees
Labels
kind/bug Categorizes an issue or PR as a bug

Comments

@RomanJRW
Copy link
Contributor

RomanJRW commented Jul 15, 2021

Is your feature request related to a problem? Please describe.
In Optimize, we import Runtime engine activity instances and store it's type as part of Optimize's activity instance data structure. For example, a start event from the engine will have type startEvent (or any other type from BpmnModelConstants). We use these types for some of our reports and the underlying aggregations. Think of a user task report, this will filter for all activity instances that have type userTask.

Now that we also import Zeebe process instance data, we have the following problem:

  • Zeebe process instance records have their own bpmnElementType, which is independent from the runtime engine. When we read a process instance event that has been exported from Zeebe, we extract the type and now see a value like USER_TASK. Before we save that in Optimize, we need to convert it to be userTask to make it work. Currently we have a basic switch statement for this conversion
  • If a new BpmnElementType is added to Zeebe (like with SEND_TASK in the most recent release), Optimize doesn't know how to make this conversion to its BpmnModelConstants representation and the import fails for that activity.

Describe the solution you'd like
Rather than Optimize needing to support the same list of supported elements for the reverse conversion, I think it makes sense for Zeebe to allow conversion of each enum field back to its BpmnModelConstants String representation as part of the enum itself.

Describe alternatives you've considered

  • Handling this in Optimize would be tolerable, but an unknown change to the enum breaks the import, as described above
  • Saving the bpmnElementType string isn't an option we would like to explore, as Optimize is quite tightly built around the existing BpmnModelConstants we get from the runtime engine. If we ever want to support both zeebe and the runtime engine in the same Optimize instance, this would make things awkward

Additional context
This could probably be done at the same time as #7290

@RomanJRW RomanJRW added the kind/feature Categorizes an issue or PR as a feature, i.e. new behavior label Jul 15, 2021
@npepinpe npepinpe added this to In progress in Zeebe Jul 16, 2021
@npepinpe npepinpe moved this from In progress to Review in progress in Zeebe Jul 16, 2021
ghost pushed a commit that referenced this issue Jul 16, 2021
7507: feat(bpmn elements): allow conversion of BpmnElementTypes back to String r=npepinpe a=RomanJRW

Returns the optional BpmnModelConstant String representation of each BpmnElementType to allow Optimize to convert them to compatible types consistent with their model constant

## Description

closes #7506



Co-authored-by: Josh Windels <joshuawindels@gmail.com>
ghost pushed a commit that referenced this issue Jul 16, 2021
7507: feat(bpmn elements): allow conversion of BpmnElementTypes back to String r=RomanJRW a=RomanJRW

Returns the optional BpmnModelConstant String representation of each BpmnElementType to allow Optimize to convert them to compatible types consistent with their model constant

## Description

closes #7506



Co-authored-by: Josh Windels <joshuawindels@gmail.com>
@ghost ghost closed this as completed in e1489cf Jul 17, 2021
Zeebe automation moved this from Review in progress to Done Jul 17, 2021
menski pushed a commit that referenced this issue Jul 30, 2021
Returns the optional BpmnModelConstant String representation of each BpmnElementType to allow Optimize to convert them to compatible types consistent with their model constant

related to #7506
@menski menski added kind/bug Categorizes an issue or PR as a bug and removed kind/feature Categorizes an issue or PR as a feature, i.e. new behavior labels Jul 30, 2021
@KerstinHebel KerstinHebel removed this from Done in Zeebe Mar 23, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes an issue or PR as a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants