Skip to main content


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 12:46 Go to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 10:54 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 12:37 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
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 10:54 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 14:27 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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] Fri, 27 September 2013 02:12 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
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 08:45 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 17:38 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
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 20:43 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 13:54 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
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 22:57 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 04:13 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
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 14:11 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 15:17 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 16:07 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
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 21:34 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 21:42 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
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 19:58 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 10:53 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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 09:19 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
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.
Re: extend SequenceFlow [message #1129244 is a reply to message #1125212] Tue, 08 October 2013 12:47 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
Hi,
when I read about the plugin extension I deduced that we could extend the bpmn2.0 metamodel using an ecore file, indeed, The demands of my work oblige me to have a new meta-classes that extend from defined meta-classes (event Definition and sequence flow).
the super imlementation of canCreate() return true only if the element invoked is type of BaseElement, in the custom task example I remarked that you didn't define any meta-class, and I saw that this could be the problem of not having a BaseElement type.
In my case I defined MyEventDefinition (extends EventDefinition), and as it mentioned in my previous comment, I'm permitted to add MyEventDefinition and effectevly, it is shown on the xml file, but it doesn't figure on the graphic.
I tried to solve this graphic problem by redefining the addFeature, but unfortunately I didn't get the wanted result.
so please could you take a look and tell me what should I do.
waiting for your help.
thanks
Re: extend SequenceFlow [message #1137752 is a reply to message #1129244] Mon, 14 October 2013 18:15 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Mhammad,

I've updated the customtask example and fixed the EventDefinition extension. The problem was that enablement of EventDefinitions was controlled by a complex set of rules (enforced by the BPMN 2.0 spec) in the base class and the MyEventDefinition did not match any of those rules.

Bob
Re: extend SequenceFlow [message #1150654 is a reply to message #1137752] Tue, 22 October 2013 22:57 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert,
I wonder if there is a problem in the "Sample Business Process Engine" plugin because it doesn't work(no changes to the palette), indeed, my own plugin doesn't work since the latest changes.
thanks
icon4.gif  Re: extend SequenceFlow [message #1152908 is a reply to message #1150654] Thu, 24 October 2013 08:49 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert,
looks there is something broken;
obviously the rules managed to activate the event definition are not fixed to elements of other type. Confused
I declare it as bug and I hope that it will be fixed soon https://bugs.eclipse.org/bugs/show_bug.cgi?id=420244
thanks Smile
icon5.gif  Re: extend SequenceFlow [message #1165501 is a reply to message #1152908] Fri, 01 November 2013 10:26 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert,
I wonder if there is a good new about the bug.
thanks a lot.
Re: extend SequenceFlow [message #1165688 is a reply to message #1165501] Fri, 01 November 2013 13:18 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

This appears to be working with the latest 1.0M1 build. Please retest.
Re: extend SequenceFlow [message #1198394 is a reply to message #1165688] Wed, 20 November 2013 09:51 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert;
I'm so grateful for every thing you did until now, but could you help me one last time. Embarrassed
you have commented above the SampleCustomSequenceFlowFeatureContainer class situated under org.eclipse.bpmn2.modeler.runtime.example bundle
Quote:

/**
* Example implementation of a Custom Connection feature container. The main things to consider
* here are:
*
* createFeatureContainer() - creates the Feature Container that is responsible for
* building the "custom connection". This can be a subclass of an existing Feature Container
* from the editor core, or a new one. Typically, this should be a subclass of the
* Feature Container for the type of bpmn2 element defined in the "type" attribute
* of this Custom Task extension point.
*
* If your Feature Container extends one of the existing classes from editor core, you should
* override the following methods:
*
* getAddFeature() - this should override the Add Feature from the chosen Feature Container
* base class (see above). Typically you will want to override the decorateShape() method
* which allows you to customize the graphical representation of this Custom Connection figure.
* getCreateFeature() - this MUST be overridden if you intend to add extension attributes to
* your business object (bpmn2 element) - see the code example below. You will also want to
* provide your own images for the tool palette by overriding getCreateImageId() and
* getCreateLargeImageId() in your Create Feature.
*
* @author Bob Brodt
*/

I'm trying to elaborate a new one, so I spent all this period to do it and unfortunately I couldn't get it. Sad
I wanna note that I want to create a new custom connection named dependency and it should be written in the xml file like this:
<dependency sourceref="xx" targetref="yy" property="zz">
thank you very very much Smile
Re: extend SequenceFlow [message #1198781 is a reply to message #1198394] Wed, 20 November 2013 14:03 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

ok, so it looks like <dependency> is an extension element, which means you have to create an extension model. The CustomTask screencast shows how to do that.
So, I have a couple of questions:

1. should Dependency have any of the attributes of any of the existing BPMN2 connection elements (i.e. SequenceFlow, Association, etc.) If so, you can define your Dependency element as a subclass of an existing BPMN2 element.
2. what will be the container for your Dependency elements? For example, SequenceFlows are contained in a FlowElementsContainer (more precisely, one of its subclasses like Process or SubProcess or Choreography). If Dependency will be treated similarly, then it MUST subclass a BPMN2 element (in this example, it must be a FlowElement if it's going to be contained in a FlowElementsContainer).
3. can Dependency be treated like an extension element? That is, can its containment look something like this:

  <bpmn2:process ...>
    <bpmn2:extensionElements>
      <tns:dependency sourceref="xx" targetref="yy" property="zz"/>
    </bpmn2:extensionElements>


if it cannot be contained like one of the existing BPMN2 elements, then it needs to go in the <bpmn2:extensionElements> container.


Also keep in mind that your extension element will belong to a different namespace (in the example above "tns" will be the namespace of your EMF model).
Lastly, Dependency should have an "id" attribute if it will be referenced by other elements in your model. At the very least it should subclass the BPMN2 BaseElement.

Cheers,
Bob
Re: extend SequenceFlow [message #1198920 is a reply to message #1198781] Wed, 20 November 2013 15:33 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert,
my extension target to add 2 elements which are subtype of eventDefinition and a connection whose name "Dependency" that links these 2 elements.
this connection hasn't any relation with any other bpmn2 connection (i.e. SequenceFlow, Association, etc.), it is a FlowNode.
the problem is to create a featureContainer specific to my Dependency customTask.
waiting for your response
thanks. Smile
Re: extend SequenceFlow [message #1199541 is a reply to message #1198920] Wed, 20 November 2013 22:19 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

ok, I'm confused...if it's a FlowNode then your feature container should extend CustomShapeFeatureContainer, but if it has the properties of a connection line (it can't be a FlowNode, a FlowElement maybe?) then you should extend CustomConnectionFeatureContainer. Which one is it?

I've never actually tried to build a custom feature container for an object type that doesn't extend one of the BPMN2 types. I'll take a look to see if it's possible...
Re: extend SequenceFlow [message #1203650 is a reply to message #1199541] Fri, 22 November 2013 19:30 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert,
sorry for the mistake, I meant to say FlowElement.
so please could you please if it is possible to create a custom connection that extend CustomConnectionFeatureContainer other than SequenceFlow and Association.
thank you very much.
Re: extend SequenceFlow [message #1209799 is a reply to message #1203650] Mon, 25 November 2013 18:07 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
Hi Robert,
the SampleCustomSequenceFlowFeatureContainer class situated under org.eclipse.bpmn2.modeler.runtime.example bundle aims to create a sequence flow named Mitigation Flow.
Quote:

public class SampleCustomSequenceFlowFeatureContainer extends CustomConnectionFeatureContainer {

@Override
protected IFeatureContainer createFeatureContainer(IFeatureProvider fp) {
return new SequenceFlowFeatureContainer()
{

@Override
public IAddFeature getAddFeature(IFeatureProvider fp) {
return new AddSequenceFlowFeature(fp) {

/* (non-Javadoc)
* @see org.eclipse.bpmn2.modeler.ui.features.flow.SequenceFlowFeatureContainer.AddSequenceFlowFeature#decorateConnection(org.eclipse.graphiti.features.context.IAddConnectionContext, org.eclipse.graphiti.mm.pictograms.Connection, org.eclipse.bpmn2.SequenceFlow)
*
* This implementation of SequenceFlow's decorateConnection() changes the appearance of the connection
* to distinguish it from regular SequenceFlows.
*/
@Override
protected void decorateConnection(IAddConnectionContext context, Connection connection,
SequenceFlow businessObject) {
super.decorateConnection(context, connection, businessObject);
connection.getGraphicsAlgorithm().setLineWidth(3);
connection.getGraphicsAlgorithm().setLineStyle(LineStyle.DASH);
}

};
}

@Override
public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
return new CreateSequenceFlowFeature(fp) {

@Override
public SequenceFlow createBusinessObject(ICreateConnectionContext context) {
SequenceFlow businessObject = super.createBusinessObject(context);
return businessObject;
}

@Override
public String getCreateImageId() {
return SampleImageProvider.getImageId(customTaskDescriptor, IconSize.SMALL);
}

@Override
public String getCreateLargeImageId() {
return SampleImageProvider.getImageId(customTaskDescriptor, IconSize.LARGE);
}
};
}
};
}


the methods getCreateConnectionFeature and getAddFeature define the nature of the connection which is in the particular example above is a SquenceFlow.
is it possible to create an equivalent to SquenceFlow named "Dependency" which is a FlowElement defined in myEcore in order to get this kind of tag in the xml file:
<Dependency sourceref="xx" targetref="yy" property="zz">
it doesn't matter if it came as like as this form:
<bpmn2:process ...>
<bpmn2:extensionElements>
<tns:dependency sourceref="xx" targetref="yy" property="zz"/>
</bpmn2:extensionElements>

I tried to reform my request and I hope that you get me.
thank you very very much
your are the best. Smile
waiting for your response. Smile
Re: extend SequenceFlow [message #1212118 is a reply to message #1209799] Tue, 26 November 2013 19:28 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert,
I tried to give a shot, so this is the description of the steps that I made and I hope that you give your opinion about it.
I created a class named TemporalDepedency->FlowElement in my Ecore.
TemporalDepedency has 3 attribute:
-sourceRef which reference a BoundaryEvent
-targetRef which reference a BoundaryEvent
-lagTime type EString
in runtime extension point I defined TemporalDepedency as the following
Quote:

<customTask
category="Time-BPMN"
description="TemporalDependency"
featureContainer="org.eclipse.bpmn2.modeler.examples.timebpmn.TemporalDependencyFeatureContainer"
icon="TemporalDepedency.png"
id="org.eclipse.bpmn2.modeler.examples.timebpmn.temporalDependency"
name="TemporalDependency"
runtimeId="org.eclipse.bpmn2.modeler.examples.timebpmn.runtime"
type="FlowElement">
<property
name="lagTime"
type="EString"
value="3hr">
</property>
</customTask>


I defined TemporalDependencyFeatureContainer class like this
Quote:


public class TemporalDependencyFeatureContainer extends CustomShapeFeatureContainer {

private final static String TYPE_VALUE = "TemporalDependency";
private final static String CUSTOM_TASK_ID = "org.eclipse.bpmn2.modeler.examples.timebpmn.temporalDependency";

public TemporalDependencyFeatureContainer() {
}

@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;
}


@Override
protected IFeatureContainer createFeatureContainer(IFeatureProvider fp) {
return new TemporalDependencyFeature()
{

@Override
public IAddFeature getAddFeature(IFeatureProvider fp) {
return new AddTemporalDependencyFeature(fp);
}

@Override
public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) {
return new CreateTemporalDependencyFeature(fp) ;

}
};
}
}

if you have remarked, I create a class named TemporalDependencyFeature (I followed the SequenceFlowFeatureContainer).
despite this, it still doesn't work.
waiting for your response. Smile
I hope I'm not bothering you Embarrassed
thank you very much. Smile
Re: extend SequenceFlow [message #1219607 is a reply to message #1212118] Wed, 04 December 2013 22:00 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Mhammad,

It turns out that what you're trying to do was not possible previously Embarrassed

I have created this bugzilla to track the issue and am working on a fix for this. It should be available in tonight's build. Please check the nightly build update site.

I've also enhanced the custom task example plug-in to include your use-case. Please pull down the latest source code from git to see how this is all done.

Thanks for helping to improve the extension API Smile

Bob
icon14.gif  Re: extend SequenceFlow [message #1220959 is a reply to message #1219607] Mon, 16 December 2013 11:16 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert;
thanks for your help and I'm glad deal with you.
Excellent job Smile
icon5.gif  Re: extend SequenceFlow [message #1226396 is a reply to message #1220959] Wed, 01 January 2014 16:48 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert;
I have two request,
I tried a several time to add a property tab that I can update lagTime through it, so please is there an example that could help. Rolling Eyes
I also wonder if it is possible to show the value of lag time as a decoration in the center of Temporaldependency between "[]" : ----------[]---------->
thanks for your help. Smile
Re: extend SequenceFlow [message #1228681 is a reply to message #1226396] Tue, 07 January 2014 20:03 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Mhammad,

Sorry for the late reply. I finally got around to trying this out myself and discovered that there's a bug which prevents the definition of <propertyTab> extensions which involve classes not defined in the bpmn2 metamodel. See Bug 425047 for a description.

I've also enhanced the org.eclipse.bpmn2.modeler.examples.customtask example plugin to demonstrate how to define a property tab for these custom objects.

Cheers,
Bob
Re: extend SequenceFlow [message #1232167 is a reply to message #1228681] Thu, 16 January 2014 10:52 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert;
you've done an excellent job.
could you tell me if it is possible to show the value of lag time as a decoration in the center of Temporaldependency between "[]" : ----------[]---------->
I also wonder about the possibility of showing the proprety of MyEventDefinition on top of the shape on the diagram.
thanks
Re: extend SequenceFlow [message #1239621 is a reply to message #1232167] Tue, 04 February 2014 16:07 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert;
sorry for disturb Embarrassed , but could you answer this request
http://www.eclipse.org/forums/index.php/mv/msg/514341/1232167/#msg_1232167

thanks. Razz
Re: extend SequenceFlow [message #1243731 is a reply to message #1239621] Tue, 11 February 2014 11:09 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi,
in the customTask example and exactly in the configuration of TemporalDependency, I remarque that the "runtime id" is defined as the following "org.eclipse.bpmn2.modeler.examples.timebpmn.runtime" which does not correspond the runtime id of the plugin which is "org.eclipse.bpmn2.modeler.examples.customtask.runtime".
could you explain this dis coordination please.
thanks a lot.
icon5.gif  Re: extend SequenceFlow [message #1250624 is a reply to message #1243731] Wed, 19 February 2014 12:23 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert,
I was trying lately to define my plugin extension which contains the extension of bpmn that I suggested theoretically, unfortunately, I founded some difficulty.
I'm presenting in my metamodel of extension (ecore file) 8 classes types EventDefinition and 2 classes types FlowElement (connection)
the major difficulty is to attribute the property tab to its EClass (no way to define property tab for each customtask)
I want also to show the properties of each shape on the diagram for clarity and semantic reasons.
there is anther problem that arises when I reopen a bpmn file output of my extension.
please could you answer my question as soon as possible Robert. Embarrassed
thank you very very much. Smile Smile
Re: extend SequenceFlow [message #1251699 is a reply to message #1250624] Thu, 20 February 2014 14:00 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Mhammad,

I have been doing a lot of work in the area of extensibility because I've gotten a lot of questions and suggestions/requests to improve the API. The new API will be available shortly (by next week) so if you can hold on until then, it may solve all of your problems Wink

I still have a lot of testing to do to make sure nothing is broken! I'll also take the existing example plugins and convert them to use the new APIs, just to make sure things work as I had envisioned.

The idea is to use dynamic EMF to create extension EPackages, classes and features, instead of having to create an ecore file and generate java classes for your extension objects, although you should still be able to use that method as well. You will also be able to define these extensions in configuration files which are reloaded when created or modified.

Bob

Re: extend SequenceFlow [message #1256823 is a reply to message #1251699] Tue, 25 February 2014 21:06 Go to previous messageGo to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert.
would you tell us exactly when the next version will be available.
thank you very much.
Re: extend SequenceFlow [message #1258941 is a reply to message #1256823] Thu, 27 February 2014 22:57 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

I'm hoping to have this done by end of this week which, according to my work schedule, is Sunday March 2 Wink
I'll post a new topic on this forum when the new build is ready.
This will be version 1.1.0 because the API changes require a new minor version number.
icon5.gif  Re: extend SequenceFlow [message #1294405 is a reply to message #1258941] Sun, 13 April 2014 12:26 Go to previous message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
hi Robert,
is there some thing new about the user guide?
thanks. Smile
Previous Topic:Initial point of a Sequence Flow
Next Topic:New release and Bug Hunt Contest
Goto Forum:
  


Current Time: Thu Apr 18 11:14:49 GMT 2024

Powered by FUDForum. Page generated in 0.05097 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top