cancel
Showing results for 
Search instead for 
Did you mean: 

extending the palette of activiti designer's palette

mhammad_makni
Champ in-the-making
Champ in-the-making
hi;
the graphiti documentation consist to :
domain model which determine an Eclass (metamodel)
picogram model which define the graphic shape
link model which link domain model element to picogram model element.
so please, how do I implement my shape and how do I associate each element of my shape to each model *WALL*
thank you very much. *blush*
I'm waiting for your response 
11 REPLIES 11

mhammad_makni
Champ in-the-making
Champ in-the-making
hi ;
can I add a shape to the palette whithout defining an Eclass
ps: the shape that I want to add is a specific type of bundary event
thanks a lot.

tiesebarrell
Champ in-the-making
Champ in-the-making
Sure, you can do that by extending the model project. We don't have a Eclass model in Designer ourselves, so this is similar to how we do it. You need to create a CreateFeature and AddFeature, similar to the ones we already have.

mhammad_makni
Champ in-the-making
Champ in-the-making
hi;
I added  CreateShapeFeature and AddShapeFeature in order to create a shape called "shape".
so, I copied CreateBoundaryErrorFeature AddBoundaryErrorFeature because I want to add a specific type of boundary event, so I've got a new shape but I couldn't change the graphical image in the diagram and the it name contrariwise of the description.
beside I want to create a new palette component and fill it with my shapes.
so what should I do.
thanks for your generosity.

tiesebarrell
Champ in-the-making
Champ in-the-making
The shapes need to be added to the palette in the ActivitiToolBehaviorProvider class. Also, look at the ActivitiBPMNFeatureProvider for linking the two. The graphical representation in the diagram is determined in the Create feature. If you want to customize it, you should do it there. The palette graphical stuff is determined in the DefaultIconProvider, if I'm not mistaken.

mhammad_makni
Champ in-the-making
Champ in-the-making
hi;
please could you tell me how do I link the properties which I want to add to my shape to the element that you told me to add it earlier.
moreover, I wonder why there is two classes (PropertySection and PropertyFilter) for each shape
thanks alot.

tiesebarrell
Champ in-the-making
Champ in-the-making
Well, the linking is actually done by the filter. Eclipse will ask each filter whether the section should be shown for the provided element. There you need to check for your new type. If that matches, then your section will be shown.

mhammad_makni
Champ in-the-making
Champ in-the-making
hi,
I succeed to add a shape in the palette with its properties, but the properties added to my shape are not shown in the XML file.
so please could you tell me how I add the propery tag to the XML file (diagram)
thanks alot.

tiesebarrell
Champ in-the-making
Champ in-the-making
There are several ways to do this. The easiest way with the current release is to look in the org.activiti.designer.eclipse.editor.ActivitiDiagramEditor.doSaveToBpmn(Bpmn2MemoryModel, String) method. There you can see that a BpmnXMLConverter is created, that is used to transform the Bpmn2MemoryModel to XML. If you change the logic in there, you can output whatever you want once the model gets marshalled to XML.

Another option is to create your own ExportMarshaller. This is currently a disabled feature, but you can easily re-enable it by invoking your marshaller in org.activiti.designer.eclipse.editor.ActivitiDiagramEditor too. Or, you can wait for the next release, in which I hope to have the ExportMarshaller functionality back in there to use without changes.

Writing a custom marshaller can be quite a bit of work, though, so I'd take a look at changing or subclassing the default behavior from the first option I mentioned. That way you get all the default stuff, plus your extra XML.

mhammad_makni
Champ in-the-making
Champ in-the-making
hi;
I'm trying to extend the Bpmn notation, so I used activiti designer and I extended the palette by a sepcial type of a boundary event.
as you see in the comments that I posted earlier, I succeded to add a shape to the palette which mr tiese barrell helped me to get it.
but, unfortunatly I can't show its properties in the XML file, so mr tiese proposed to change the logic of the class BpmnXMLConverter.
could you tell me how to add the tag of my shape .

secondly, I wonder if I can extend the activiti designer project using eclipse plugin because I'm using the source code which is not a good way to publish my work.
thank you very much.