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

Can We Add Custom Element And Shape For Drawing #36

Closed
TaheriSohrab opened this issue Feb 20, 2023 · 11 comments
Closed

Can We Add Custom Element And Shape For Drawing #36

TaheriSohrab opened this issue Feb 20, 2023 · 11 comments
Labels
question Further information is requested

Comments

@TaheriSohrab
Copy link

Hi there, I'm using your source and project, which is a matter of pride.
But I want to add some new custom elements in the change type, like adding some flow beside default flow and conditional flow between elements and drawing the custom shape I wanna add it
Is it possible?
I've been involved with that for a month but couldn't find any solution

with regards

@miyuesc
Copy link
Collaborator

miyuesc commented Feb 20, 2023

Thank you for your recognition!
However, could you provide an example diagram for this issue?

@TaheriSohrab
Copy link
Author

let me explain more.
I wanna change the connector between two elements like a start event and a gateway, when I click on the connector(the sequence flow) the setting icon which u called CHANGE TYPE I want to add a new connector there beside default flow and conditional flow...and connectors changes after selecting the custom connector

@TaheriSohrab
Copy link
Author

vite

@miyuesc
Copy link
Collaborator

miyuesc commented Feb 21, 2023

So, you mean you want to add a custom type of sequence flow and add it to the 'Change Element' menu, right?
And then, when you click it, the selected sequence flow should switch to the custom one.

@TaheriSohrab
Copy link
Author

TaheriSohrab commented Feb 21, 2023

Yes yesss exactly, is it possible?

@miyuesc
Copy link
Collaborator

miyuesc commented Feb 21, 2023

Sure, its possible.

First, you need to add a JSON schema for your custom shape. Then, you should inherit the BpmnRenderer.js to write an SVG node creation method for this shape. Lastly, you need to modify the original BpmnReplaceOptions.js and BpmnReplace.js .

The JSON schema, you can reference my SQL Node.

@miyuesc
Copy link
Collaborator

miyuesc commented Feb 21, 2023

As for BpmnReplaceOptions and BpmnReplace, you can just inherit from BpmnReplace and implement a new replacement module that overwrites the original module when you use it.

@TaheriSohrab
Copy link
Author

thanks so muchhhh for your attention, time, and explanation
I go for it now and check it out to see what can I do after ur explanations
thanks a lot...I'll be in touch with you and share the result...

@TaheriSohrab
Copy link
Author

I cannot find your JSON schema template in your code and don't know how to add the new custom shape to the change element...
would you please give me a directory of your project or describe it crystal-clear to me...
I like to make it English and other languages and make pull requests for ur project to appreciate you

@miyuesc
Copy link
Collaborator

miyuesc commented Feb 21, 2023

Emmm... I think you can find the answer here bpmn-js-examples/custom-meta-model

@TaheriSohrab
Copy link
Author

thanks so much I'm reading and checking it...I'll be in touch with you..
anyway your response and attention are so valuable to me

@miyuesc miyuesc closed this as completed Feb 21, 2023
@miyuesc miyuesc added the question Further information is requested label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants