If I add a property to all instances of BPMNElementNode subclasses, what components do I need to extend and rebuild? #425
Replies: 1 comment
-
|
Hi @chrisesposito4 You do not need to care about the saving of this property into your file. This is done automatically. So this is how you add a BPMN 2.0 extension element into a BPMN Process element (Open-BPMN Meta Project) The other question is how to control an extension property from the property panel in the modelling tool. This is where the open-bpmn extensions come into the play. You can define a new extension and extend the class public class ImixsBPMNDiagramModule extends BPMNDiagramModule {
@SuppressWarnings("unused")
private static Logger logger = Logger.getLogger(ImixsBPMNDiagramModule.class.getName());
/**
* This method adds the custom Imixs BPMN Extensions
*
* @param binding
*/
@Override
public void configureBPMNElementExtensions(final Multibinder<BPMNElementExtension> binding) {
// bind BPMN default extensions
super.configureBPMNElementExtensions(binding);
// Imixs Task Extensions
binding.addBinding().to(ImixsBPMNDefinitionsExtension.class);
binding.addBinding().to(ImixsBPMNTaskExtension.class);
binding.addBinding().to(ImixsBPMNTaskACLExtension.class);
// Imixs Event Extensions
binding.addBinding().to(ImixsBPMNEventExtension.class);
binding.addBinding().to(ImixsBPMNEventHistoryExtension.class);
binding.addBinding().to(ImixsBPMNEventRuleExtension.class);
binding.addBinding().to(ImixsBPMNEventSchedulerExtension.class);
binding.addBinding().to(ImixsBPMNEventACLExtension.class);
binding.addBinding().to(ImixsBPMNEventMailExtension.class);
binding.addBinding().to(ImixsBPMNEventReportExtension.class);
// Imixs DataObject Extensions
binding.addBinding().to(ImixsBPMNDataObjectExtension.class);
}
/**
* This method adds the BPMN default model extensions
* <p>
* Overwrite this method to add custom BPMN Extensions
*
* @param binding
*/
@Override
public void configureBPMNModelExtensions(final Multibinder<BPMNModelExtension> binding) {
super.configureBPMNModelExtensions(binding);
// bind Imixs model extensions
binding.addBinding().to(ImixsModelValidatorExtension.class);
}
}This is an example from our custom imixs-bpmn-server part. You can find the source code from the Imixs-Server part here: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on an application where I need to add 2 user-editable properties (let's call them 'PropertyA' and 'PropertyB', each with a text value) to all instances of any node in the diagram (i.e., all subclasses of BPMNElementNode). From what I understand after reading the docs at https://www.open-bpmn.org/glsp-server/BPMN_EXTENSIONS.html , I need to implement the BPMNElementExtension interface as part of the process for getting the new properties to show up on an element's property page.
What's less clear to me is whether or not I also need to implement the BPMNModelExtension interface if I want these new properties to be saved and loaded as part of the diagram, just the same way that the Name and Documentation properties are saved and loaded.
Beta Was this translation helpful? Give feedback.
All reactions