Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » extend SequenceFlow
extend SequenceFlow [message #1097251] Thu, 29 August 2013 08:46 Go to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
hi;
I want to extend a Sequence Flow with an attribut when it links two event (that I defined).
In ather words I want the behaviour of Sequence Flow persist and I want to have a new connection shape in a sub palette.
is it possible?
thanks
Re: extend SequenceFlow [message #1110810 is a reply to message #1097251] Tue, 17 September 2013 06:54 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
hi;
because of the situation that doesn't allow me to create a new element in bpmn2 palette of type Sequence Flow I decided to not use the plugin extension and trying to explore the code of bpmn2 in order to add elements to the palette.
in my first step I added My metaclasses to the ecore file and I regenerated genmodel then .edit and .editor project.
in my second step I explored the grphiti plugin, so that I get bpmn2.ui and bpmn2.core and I added the code that correspond my metaclass.
as result, I was able to add an event and I sure that I can add any types of node but unfortunately, the problem of adding an element type connection persist.
so please do you have any advices for me. (lines of cod to add ...)
waiting for your response.
thanks
Re: extend SequenceFlow [message #1110869 is a reply to message #1110810] Tue, 17 September 2013 08:37 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 461
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

I will look into it as soon as I get the editor code stabilized for an upcoming release this Wednesday. Please have patience.
In the meantime, have a look at the <toolPalette> extension point, examples of which can be found in the jBPM plugin.xml

Bob
Re: extend SequenceFlow [message #1111534 is a reply to message #1110869] Wed, 18 September 2013 06:54 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
thanks alot Robert and I'll be patient Smile
Re: extend SequenceFlow [message #1115013 is a reply to message #1111534] Mon, 23 September 2013 10:27 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
hi,
thanks for Pulling my attention to the jbpm project, and I remarked that we could have two shapes types association using an attribute to differentiate between them, so I tried to add a property and follow the same way and obviously it doesn't seems the best way, so that I spent a lot of time in figuring the code which is seems a bad idea either because each time I get an instable situation(non working shape for instance) , so I'm felling as a "man in whirlpool". Sad
so is there a way to introduce 2 shapes type sequence flow: the first one is the original and the second is extended using modelExtension.
I didn't want to disturb you but, I was facing a wall and I really need your help.
thanks a lot. Smile
Re: extend SequenceFlow [message #1118023 is a reply to message #1115013] Thu, 26 September 2013 22:12 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 461
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Mhammad,

I've been working on this and after some code refactoring, it's now possible to create custom connections as well as shapes. I need to do some more testing, but so far it looks pretty good. I should have something for you to test out by tomorrow.

Cheers,
Bob
Re: extend SequenceFlow [message #1118281 is a reply to message #1118023] Fri, 27 September 2013 04:45 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
hi,
this is really awesome.
I can't wait to try it tomorrow.
thanks Smile
Re: extend SequenceFlow [message #1118701 is a reply to message #1118281] Fri, 27 September 2013 13:38 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 461
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

OK, give it a try. You'll need to refresh your git repository from here: https://git.eclipse.org/c/bpmn2-modeler/org.eclipse.bpmn2-modeler.git/
The latest Kepler build with these changes is here: http://download.eclipse.org/bpmn2-modeler/updates/nightly/kepler/
Re: extend SequenceFlow [message #1118827 is a reply to message #1118701] Fri, 27 September 2013 16:43 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
hi,
I tried to get a custom connection but it doesn't exist. so please I'll be so grateful if you implement a custom connection in the customtask example .
thanks
Re: extend SequenceFlow [message #1119469 is a reply to message #1118827] Sat, 28 September 2013 09:54 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 461
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Try the org.eclipse.bpmn2.modeler.runtime.example plugin.
Re: extend SequenceFlow [message #1119805 is a reply to message #1119469] Sat, 28 September 2013 18:57 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
hi Robert,
sorry it's still the same problem. Crying or Very Sad
what should I do?
Re: extend SequenceFlow [message #1119996 is a reply to message #1119805] Sun, 29 September 2013 00:13 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 461
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Have you looked at the SampleCustomSequenceFlowFeatureContainer class? Is this not what you were asking for? I don't know what else to do to help you.
icon14.gif  Re: extend SequenceFlow [message #1120369 is a reply to message #1119996] Sun, 29 September 2013 10:11 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
yes I saw it, and it's really amazing Crying or Very Sad Laughing
thank you very very very much Smile Smile Smile
icon9.gif  Re: extend SequenceFlow [message #1121391 is a reply to message #1120369] Mon, 30 September 2013 11:17 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
hi Robert,
I was busy lately because the success of adding connection, but I think that the event definition example doesn't work. Confused
is there any thing I can do?
Re: extend SequenceFlow [message #1121429 is a reply to message #1121391] Mon, 30 September 2013 12:07 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 461
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Sorry, looks like I broke something Sad
Can you please file a bugzilla report for this?

Thanks!
Bob
icon5.gif  Re: extend SequenceFlow [message #1122713 is a reply to message #1121429] Tue, 01 October 2013 17:34 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
Hi Robert;
what's new? this bug, could it be fixed? is there a good news? Confused

Thanks
Re: extend SequenceFlow [message #1122720 is a reply to message #1122713] Tue, 01 October 2013 17:42 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 461
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Sorry, I've been busy with other stuff. I'll take a look at this tonight.

Bob
icon5.gif  Re: extend SequenceFlow [message #1123653 is a reply to message #1122720] Wed, 02 October 2013 15:58 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
Hi Robert,
I wonder if it is a big problem? Rolling Eyes

Thanks
Re: extend SequenceFlow [message #1124262 is a reply to message #1123653] Thu, 03 October 2013 06:53 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
Hi Robert;
I tried to figure out the problem, so I compared MyEventDefinitioFeatureContainer with other FeatureContainer to much the methods that could help.
Effectively, this implementation allow me to resolve the "canAdd" Problem of MyEventDefinition
Quote:


public boolean canCreate(ICreateContext context) {


Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
if (e instanceof BoundaryEvent) {
return true;
}

return false;
}



thanks to this method the symbol "not allowed" has been disappeared(the super implementation return false), but unfortunately MyEventDefinition couldn't be added. Confused

I hope that this could help us.
Thanks




icon4.gif  Re: extend SequenceFlow [message #1125212 is a reply to message #1124262] Fri, 04 October 2013 05:19 Go to previous message
mhammad makni is currently offline mhammad makni
Messages: 31
Registered: June 2013
Member
Hi Robert;
Quote:

package org.eclipse.bpmn2.modeler.examples.time;

import org.eclipse.bpmn2.BaseElement;
import org.eclipse.bpmn2.Event;
import org.eclipse.bpmn2.modeler.core.features.FeatureContainer;
import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractAddEventDefinitionFeature;
import org.eclipse.bpmn2.modeler.core.features.event.definitions.AbstractEventDefinitionFeatureContainer;
import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
import org.eclipse.bpmn2.modeler.core.runtime.CustomTaskImageProvider;
import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
import org.eclipse.bpmn2.modeler.core.utils.StyleUtil;
import org.eclipse.bpmn2.modeler.core.utils.StyleUtil.FillStyle;
import org.eclipse.bpmn2.modeler.examples.time.MyModel.MyEventDefinition;
import org.eclipse.bpmn2.modeler.examples.time.MyModel.MyModelPackage;
import org.eclipse.bpmn2.modeler.ui.features.activity.task.CustomTaskFeatureContainer;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.graphiti.features.IAddFeature;
import org.eclipse.graphiti.features.ICreateFeature;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.IAddContext;
import org.eclipse.graphiti.mm.MmPackage;
import org.eclipse.graphiti.mm.algorithms.Ellipse;
import org.eclipse.graphiti.mm.algorithms.Image;
import org.eclipse.graphiti.mm.algorithms.Polygon;
import org.eclipse.graphiti.mm.algorithms.Rectangle;
import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.Graphiti;
import org.eclipse.graphiti.services.IGaService;
import org.eclipse.graphiti.services.IPeService;

public class MyEventDefinitionFeatureContainer extends CustomTaskFeatureContainer {

private final static String TYPE_VALUE = "MyEventDefinition";
private final static String CUSTOM_TASK_ID = "org.eclipse.bpmn2.modeler.examples.customtask.eventDefinition1";

public MyEventDefinitionFeatureContainer() {
}

@Override
public String getId(EObject object) {

EStructuralFeature f = ModelUtil.getAnyAttribute(object, "type");
if (f!=null) {
Object id = object.eGet(f);
if (TYPE_VALUE.equals(id))
return CUSTOM_TASK_ID;
}

return null;
}

protected FeatureContainer createFeatureContainer(IFeatureProvider fp) {
return new AbstractEventDefinitionFeatureContainer() {

@Override
public ICreateFeature getCreateFeature(IFeatureProvider fp) {
return new CreateMyEventDefinitionFeature(fp);
}

@Override
protected Shape drawForStart(DecorationAlgorithm algorithm, ContainerShape shape) {
return draw(algorithm,shape);
}

@Override
protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
return draw(algorithm,shape);
}

@Override
protected Shape drawForThrow(DecorationAlgorithm algorithm, ContainerShape shape) {
return draw(algorithm,shape);
}

@Override
protected Shape drawForCatch(DecorationAlgorithm algorithm, ContainerShape shape) {
return draw(algorithm,shape);
}

@Override
protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
return draw(algorithm,shape);
}

private Shape draw(DecorationAlgorithm algorithm, ContainerShape shape) {
Shape iconShape = Graphiti.getPeService().createShape(shape, false);
Image img = CustomTaskImageProvider.createImage(customTaskDescriptor, iconShape, customTaskDescriptor.getIcon(), 30, 30);
Graphiti.getGaService().setLocationAndSize(img, 3, 3, 30, 30);
return iconShape;
}

};
}

public class CreateMyEventDefinitionFeature extends CreateEventDefinition<MyEventDefinition> {

public CreateMyEventDefinitionFeature(IFeatureProvider fp) {
super(fp, "My Event Definition", "Create My Event Definition");
}

@Override
public EClass getBusinessObjectClass() {
return MyModelPackage.eINSTANCE.getMyEventDefinition();
}

@Override
protected String getStencilImageId() {
return null;
}

}
}



this implementation allow me to add MyEventDefinition(appeare on xml), but, it doesn't show the graphic image on the diagram.
by the way, I want to show the attribute of MyEventDefinition on the diagram.
I really feel that I'm carrying on you so much Embarrassed , but I'm counting on your generosity. Smile
I'm waiting for your response.
Thank you very much.
Previous Topic:Can't access xxxxRefs from SequenceFlow
Goto Forum:
  


Current Time: Mon Oct 07 12:43:19 EDT 2013

Powered by FUDForum. Page generated in 0.03177 seconds