Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Custom SequenceFlow's extended properties doesn't work for bpmn2.
icon9.gif  Custom SequenceFlow's extended properties doesn't work for bpmn2. [message #1696208] Sat, 23 May 2015 04:15 Go to next message
Takahiro Yamanaka is currently offline Takahiro YamanakaFriend
Messages: 7
Registered: May 2015
Junior Member
Hi.

We've been using eclipse bpmn2 modeler with luna SR2. We originally installed this plugin:

bpmn2-modeler/updates/luna/1.1.3

We tried to extend the Sequence Connector by reference to Custom Task(https://wiki.eclipse.org/BPMN2-Modeler/DeveloperTutorials/CreateCustomTask).

In Custom Task case,We could display the extend the properties of Task.
In Sequence Connector case, We didn't.

Then We compare them and found differences.
In Custom Task case, We could get value of ModelDecorator.getAnyAttribute(object, "type") in "getId"method.
But in Sequence Connector case,We didn't. #ModelDecorator.getAnyAttribute(object, "type") return null.

Could anyone help? Let me know if more information is required. Razz

Thanks in advance.

Sample code follow:
plugin.xml
 <customTask category="Imixs-Workflow" featureContainer="org.imixs.bpmn.model.SampleCustomSequenceFlowFeatureContainer"
        icon="test.png"
        id="org.imixs.workflow.bpmn.customFlow"
        name="Mitigation Flow"
        runtimeId="org.imixs.workflow.bpmn.runtime"
        type="SequenceFlow">
   <property name="type" value="BaseFlow">
   </property>
   <property name="priority"  type="EInt" value="1">  </property>
		</customTask>
  <customTask
        category="Imixs-Workflow"
        featureContainer="org.imixs.bpmn.model.TaskElementFeatureContainer"
        icon="test.png"
        id="org.imixs.workflow.bpmn.customTask"
        name="Mitigation Task"
        runtimeId="org.imixs.workflow.bpmn.runtime"
        type="Task">
     <property
           name="type"
           value="BaseTask">
     </property>
     <property
           name="prop1"
           type="EString"
           value="Test">
     </property>
  </customTask>
   </extension>


public class SampleCustomSequenceFlowFeatureContainer extends CustomConnectionFeatureContainer {

	private final static String TYPE_VALUE = "BaseFlow";
	private final static String CUSTOM_FLOW_ID = "org.imixs.workflow.bpmn.customFlow";

	@Override
	protected IFeatureContainer createFeatureContainer(IFeatureProvider fp) {
		return new SequenceFlowFeatureContainer() {
			@Override
			public IAddFeature getAddFeature(IFeatureProvider fp) {
				return new AddSequenceFlowFeature(fp) {
					@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 getId(EObject object) {
		if (object == null)
			return null;
		EStructuralFeature f = ModelDecorator.getAnyAttribute(object, "type");
		if (f != null) {
			Object id = object.eGet(f);
			if (TYPE_VALUE.equals(id))
				return CUSTOM_FLOW_ID;
		}
		return null;
	}

	@Override
	public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
		return new ICustomFeature[] { new ShowPropertiesFeature(fp) };
	}
}


public class TaskElementFeatureContainer extends CustomShapeFeatureContainer {
	private final static String TYPE_VALUE = "BaseTask";
	private final static String CUSTOM_TASK_ID = "org.imixs.workflow.bpmn.customTask";

	public TaskElementFeatureContainer() {
	}

	@Override
	public String getId(EObject object) {
		EStructuralFeature f = ModelDecorator.getAnyAttribute(object, "type");
		if (f != null) {
			Object id = object.eGet(f);
			if (TYPE_VALUE.equals(id))
				return CUSTOM_TASK_ID;
		}

		return null;
	}

	@Override
	public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
		return new ICustomFeature[] { new ShowPropertiesFeature(fp) };
	}	
}


Yamanaka
Re: Custom SequenceFlow's extended properties doesn't work for bpmn2. [message #1698056 is a reply to message #1696208] Wed, 10 June 2015 17:10 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

Looks like this is a bug. The CUSTOM TASK ID is not being set during connection creation. I have filed a BZ report to track this:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=469872
Re: Custom SequenceFlow's extended properties doesn't work for bpmn2. [message #1698337 is a reply to message #1698056] Sun, 14 June 2015 13:17 Go to previous messageGo to next message
Takahiro Yamanaka is currently offline Takahiro YamanakaFriend
Messages: 7
Registered: May 2015
Junior Member
Hi.
We've updated the library.
We were able to set the custom attributes.
Thank you for your help.
Smile
Re: Custom SequenceFlow's extended properties doesn't work for bpmn2. [message #1698436 is a reply to message #1698337] Mon, 15 June 2015 16:31 Go to previous message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Yay! I'm glad it's working Very Happy
Previous Topic:Difference between BPEL and BPMN
Next Topic:Re: Exception while opening diagram
Goto Forum:
  


Current Time: Sat Aug 18 16:28:11 GMT 2018

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

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

Back to the top