Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Overriding Display Name for Sequence Flow(Overriding Display Name for Sequence Flow)
Overriding Display Name for Sequence Flow [message #1407907] Wed, 13 August 2014 19:09 Go to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Folks,

Is it possible to override the display name for the sequence flow what is displayed onto Sequence Flow element for text pictogram element attached to it.

I don't want to show the persisted name as is for the sequence flow but want to provide a custom display name when render in the graphical editor, this name is not stored into bpmn model rather should be computed dynamically when sequence flow is getting displayed.

I have tried couple of things by overriding the AddFeature, UpdateFeautre, LayoutFeature etc but because of some annoying reason whenever i update the name value to text element attached to Sequence Flow the sequence flow is rendered with red dotted line. Any help , pointers are appreciated.

--
Thanks and Regards,
Bhuvan Mehta
Re: Overriding Display Name for Sequence Flow [message #1407945 is a reply to message #1407907] Wed, 13 August 2014 21: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

Updating of Sequence Flow labels (and in fact, labels for all shapes and connections) is handled by the UpdateLabelFeature class. This is one of several Update Features that are invoked during Sequence Flow updating, and is constructed in SequenceFlowFeatureContainer. See the getUpdateFeature() method. You can override the text string like so:

	@Override
	public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
		MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
		multiUpdate.addFeature(new UpdateDefaultSequenceFlowFeature(fp));
		multiUpdate.addFeature(new UpdateConditionalSequenceFlowFeature(fp));
		multiUpdate.addFeature(new UpdateLabelFeature(fp) {

			@Override
			protected String getLabelString(BaseElement element) {
				return "This is a Sequence Flow";
			}
			
		});
		return multiUpdate;
	}


BTW, just curious: are you writing an extension plugin for the editor, or just hacking the code directly for your own purposes? Reason I ask is because there is a way to do this "legally" in an extension plugin.

Cheers,
Bob
Re: Overriding Display Name for Sequence Flow [message #1409437 is a reply to message #1407945] Mon, 18 August 2014 05:26 Go to previous message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Bob,

Thanks for the quick response. Looks like i am still on a little older version of modeler in which SequenceFlowFeatureContainer contains UpdateBaseElementNameFeature rather than UpdateLabelFeature, as suggested by you.
Would like to do it in extension way, Kindly suggest.

update feature for SequenceFlowFeatureContainer looks as following :

@Override
public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
multiUpdate.addUpdateFeature(new UpdateDefaultSequenceFlowFeature(fp));
multiUpdate.addUpdateFeature(new UpdateConditionalSequenceFlowFeature(fp));
multiUpdate.addUpdateFeature(new UpdateBaseElementNameFeature(fp));
return multiUpdate;
}


I guess we still need to override add feature as well for custom name display else there is red dotted lie drawn for sequence flow.


Kindly suggest how this can be achived in best possible manner?

--
Thanks and Best Regards,
Bhuvan Mehta
Previous Topic:Howto install BPMN in Eclipse Luna Portable
Next Topic:Creating custom Property Tab, cannot inherit from AbstractBpmn2PropertySection
Goto Forum:
  


Current Time: Thu Apr 18 10:53:26 GMT 2024

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

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

Back to the top