-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat: provide more properties in BpmnSemantic #2854
Conversation
♻️ PR Preview 6bbb270 has been successfully destroyed since this PR has been closed. 🤖 By surge-preview |
♻️ 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 }; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
more compact syntax parentId: move to ShapeBpmnSemantic to be able to make it mandatory in edge in the future without breaking change
Kudos, SonarCloud Quality Gate passed! |
Return more information available in the internal model for shape-related elements:
eventDefinitionKind
callActivityKind
&globalTaskKind
subProcessKind
closes #929