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: add ElementTemplates#applyTemplate API #624

Merged
merged 2 commits into from
Mar 24, 2022

Conversation

nikku
Copy link
Member

@nikku nikku commented Mar 23, 2022

This allows us to use the elementTemplate service to apply templates without caring about the implementation details, i.e. if it is a Platform or Cloud template.

Mid-term this will also support our "element templates everywhere" spirit (cf. bpmn-io/bpmn-js-connectors-extension#apply-template-usage).


Related to bpmn-io/element-template-chooser#2 (comment).

Required by bpmn-io/element-template-chooser#2

This allows us to use the `elementTemplate` service
to apply templates without caring about the implementation
details, i.e. if it is a Platform or Cloud template.
Comment on lines -17 to +18
elementTemplates = injector.get('elementTemplates');
const elementTemplates = injector.get('elementTemplates');

const oldTemplate = elementTemplates.get(element);

commandStack.execute('propertiesPanel.zeebe.changeTemplate', {
element: element,
newTemplate,
oldTemplate
});
return elementTemplates.applyTemplate(element, newTemplate);
Copy link
Member

Choose a reason for hiding this comment

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

I like it 👍

@fake-join fake-join bot merged commit e84abda into master Mar 24, 2022
@fake-join fake-join bot deleted the element-templates-apply-template branch March 24, 2022 07:14
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Mar 24, 2022
@pinussilvestrus
Copy link
Contributor

Awesome 🎉

@nikku
Copy link
Member Author

nikku commented Mar 24, 2022

Released with v1.0.0-alpha.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants