| extend SequenceFlow [message #1097251] |
Thu, 29 August 2013 08:46  |
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 #1110869 is a reply to message #1110810] |
Tue, 17 September 2013 08:37   |
|
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 #1118023 is a reply to message #1115013] |
Thu, 26 September 2013 22:12   |
|
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 #1125212 is a reply to message #1124262] |
Fri, 04 October 2013 05:19  |
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 , but I'm counting on your generosity.
I'm waiting for your response.
Thank you very much.
|
|
|
Powered by
FUDForum. Page generated in 0.03177 seconds