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

feat: provide more properties in BpmnSemantic #2854

Merged
merged 15 commits into from
Sep 20, 2023

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented Sep 15, 2023

Return more information available in the internal model for shape-related elements:

  • parentId
  • event: eventDefinitionKind
  • callActivity: callActivityKind & globalTaskKind
  • sub-process: subProcessKind

closes #929

@tbouffard tbouffard added the BPMN diagram usability Something about the way we can interact with BPMN diagrams label Sep 15, 2023
@github-actions
Copy link

github-actions bot commented Sep 15, 2023

♻️ PR Preview 6bbb270 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@github-actions
Copy link

github-actions bot commented Sep 15, 2023

♻️ PR Preview 6bbb270 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@@ -53,13 +52,22 @@ export class BpmnModelRegistry {
}
const bpmnElement = element.bpmnElement;
const isShape = bpmnElement instanceof ShapeBpmnElement;
const semantic: BaseBpmnSemantic = { id: bpmnElementId, name: bpmnElement.name, isShape: isShape, kind: bpmnElement.kind };
const semantic: BaseBpmnSemantic = { id: bpmnElementId, isShape: isShape, kind: bpmnElement.kind, name: bpmnElement.name };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question:
Why is the order being changed?

Copy link
Member Author

@tbouffard tbouffard Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetic order for consistency, I did the same in BaseBpmnSemantic.

@@ -370,8 +371,16 @@ export interface EdgeBpmnSemantic extends BaseBpmnSemantic {
* @category Custom Behavior
*/
export interface ShapeBpmnSemantic extends BaseBpmnSemantic {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:
Why not have a similar architecture to the internal model, to avoid having to access properties when you know they'll never be fulfilled?

Copy link
Member Author

@tbouffard tbouffard Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure to understand the remark.
The APIs return a value object, not a class as in the internal model. We can introduce various interface (for call activity, event, subprocess) but in the end, this will increase the complexity of the user TypeScript code.
They would have to deal with several types and do some casting to be able to check if the property are set.

Let's talk about this in person.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As seen with @csouchet, we find an alternative solution that it is implemented in bf4ac78.
To be reviewed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbouffard 🙏 for the new implementation

@tbouffard tbouffard added the enhancement New feature or request label Sep 18, 2023
more compact syntax
parentId: move to ShapeBpmnSemantic to be able to make it mandatory in edge in the future without breaking change
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@tbouffard tbouffard merged commit 2e8a251 into master Sep 20, 2023
@tbouffard tbouffard deleted the 929-API_return_more_details_in_BpmnSemantic branch September 20, 2023 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BPMN diagram usability Something about the way we can interact with BPMN diagrams enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Provide BPMN Semantic data in addition to HTML elements
2 participants