cancel
Showing results for 
Search instead for 
Did you mean: 

extendind the palette of activiti designer

mhammad_makni
Champ in-the-making
Champ in-the-making
hi;
I'm trying to extend te palette of activiti designer with a special tipe of bundary event and specific connector.
I seceeded in the implementation of the exepple of money node witch is written in user guide.
I kept reading user guide  and I reached to uderstand this:
-the annotation @Runtime allow to define the super class witch have to implement JavaDelegate.
-beside, I looked for the classes that implement JavaDelegate and I found them in this package org.activiti.bpmn.model
so, am I right in my interpretation?  Smiley Surprisedops:  :?:
I'll be so happy to get your response .
thanks a lot.
22 REPLIES 22

tiesebarrell
Champ in-the-making
Champ in-the-making
You can't extend the palette to create new types of boundary events. This is only supported for Service Tasks. If you use an @Runtime annotation on a service task extension, you don't *have* to implement JavaDelegate anymore (since last release). It can also be a Spring Bean. But in most cases, you will probably implement JavaDelegate. However, the implementation is not to be found in that package, because those are the default implementations. In most cases, you will want to write your own implementation of JavaDelegate en link to that using @Runtime.

mhammad_makni
Champ in-the-making
Champ in-the-making
does this mean that I can't use activiti designer to acheve my purpose or I can create new types of boundary events if I implelent JavaDelegate to create my own; because I have to follow the instruction of my proffessor who supervise me, and if I can't I'll be obliged to find a new BPMN editor, wich I don't want to do it.  :cry:
please could you provide me a solution to get my aim. Smiley Surprisedops:
thank you for your response;

tiesebarrell
Champ in-the-making
Champ in-the-making
You're mixing two things here.

1) To implement CustomServiceTasks in Designer, which is what adds new kinds of elements to the palette, you don't implement JavaDelegate. You write a regular java class and annotate it as specified in the user guide.

2) Any ServiceTask can be bound to a runtime implementation, which is the code that is executed when a process instance is being executed and the service task is reached. Since a CustomServiceTask is effectively a regular ServiceTask at runtime, this is available for CustomServiceTasks as well. This is what is specified using the @Runtime annotation on the CustomServiceTask's class. One of the options for that runtime implementation is to implement JavaDelegate, but keep in mind this is the runtime implementation and has very little to do with defining a CustomServiceTask itself.

Regarding 1), this is only available for ServiceTasks (hence the name "CustomServiceTasks"), so if you need to add boundary events, you cannot use this. If you need to add customized boundary events, you will need to add them to the core of Designer in the same way any other boundary events have been created already. For examples of that, take a look at the implementations that are already there.

I hope this helps. In short, yes, you can do this, but not using the standard extension mechanism provided by CustomServiceTasks. You will have to expand the functionality of the core Designer to achieve it.

mhammad_makni
Champ in-the-making
Champ in-the-making
thanks a lot for you generosity;
this is rearlly help, but does this mean that I can't any more use the maven "mecanism" and I have to download the source code to expand the functionality of the core Designer.
thanks exceedingly.

tiesebarrell
Champ in-the-making
Champ in-the-making
yes, you will have to set up a complete development environment in Eclipse to extend the core functionality

mhammad_makni
Champ in-the-making
Champ in-the-making
I appreciate your precious advice , and I'm so grateful for you; Smiley Happy
could you please guide me to previous works that manipulate the core functionality of activiti designer as well as mine.
thanks a lot.

tiesebarrell
Champ in-the-making
Champ in-the-making
The documentation for extending Designer that we have is all in the userguide here: http://activiti.org/userguide/index.html#eclipseDesignerExtending

With regards to extending Designer's core, there is no information. This is Eclipse plugin development work and we use Graphiti (http://www.eclipse.org/graphiti/) as a framework for the graphical editing.

There are a couple of places to look at in Designer's code base:
The package org.activiti.designer.features in the gui bundle contains Create and Add features for various kinds of palette items as examples.
The class org.activiti.designer.diagram.ActivitiBPMNFeatureProvider adds the items to the palette, so you'll need to add your new shape there.
In the package org.activiti.designer.property of the gui bundle are examples of property panes so user's can configure the properties of your shape.

Hope that helps to get you started. Have fun!

hi;
as I annouunced in my frist comment , I want to add to the palette a specific type of boundary events and connectors.
first of all, how could I create a group in the palette as like as gateway for instance, and how do I link my shapes to it.
I succeeded to add a shape whitch I called "shape" by creating AddShapeFeature( extends AbstractAddBoundaryFeature) and CreateShapeFeature ( extends AbstractCreateBoundaryFeature). ps: I copied the classes AddBoundaryErrorFeature and
CreateBoundaryErrorFeature.
and I modified ActivitiBPMNFeatureProvider: I added IcreateFeature  new CreateShapeFeature(this);
despite, I could'nt change the name of the shape neither it view in the diagram.
so am I in the right way, and what should I do to correct  these mistake

hi;
as I annouunced in my frist comment , I want to add to the palette a specific type of boundary events and connectors.
first of all, how could I create a group in the palette as like as gateway for instance, and how do I link my shapes to it.
I succeeded to add a shape whitch I called "shape" by creating AddShapeFeature( extends AbstractAddBoundaryFeature) and CreateShapeFeature ( extends AbstractCreateBoundaryFeature). ps: I copied the classes AddBoundaryErrorFeature and
CreateBoundaryErrorFeature.
and I modified ActivitiBPMNFeatureProvider: I added IcreateFeature  new CreateShapeFeature(this);
despite, I could'nt change the name of the shape neither it view in the diagram.
so am I in the right way, and what should I do to correct  these mistake