Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » bindAttribute did not work in case of copy&pase
bindAttribute did not work in case of copy&pase [message #1726400] Sat, 12 March 2016 14:16 Go to next message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 193
Registered: July 2009
Senior Member
Hi Bob,

there is a strange behavior by my own implementation of a customTask element with a customPropertySection.
The customTask element implements a customPropertySection and binds a new attribute called 'processid'

....
@Override
public void createBindings(EObject be) {
setTitle("Workflow");

// ProcessID
this.bindAttribute(attributesComposite, be, "processid");
....
...

This looks than like in screen1.png

index.php/fa/25284/0/

In XML the task/attribute definition in bpmn looks like this:
<bpmn2:task id="Task_2" imixs:processid="6" name="Task 1">

So far, everything works.
When you now do a copy&past of this element the id-editor is not rendered (see screen2.png)

index.php/fa/25285/0/

Closing the editor and reopen it - everything works again fine.
This behavior exists since a long time. So I did not think it is related to latest changes in 1.2.3. I can't figure out what is wrong. I guess something in the implementation of the customTask element is wrong in general?
We have this public bpmn2-example code on github:
https://github.com/rsoika/bpmn2-tutorial

This is also the example code I used mainly for the developer tutorial in the wiki
https://wiki.eclipse.org/BPMN2-Modeler/DeveloperTutorials/CustomPropertyTabs

Maybe you can take a look at the example code of 'ProcessWorkflowPropertySection'

https://github.com/rsoika/bpmn2-tutorial/blob/master/bpmn2.tutorial.plugin/src/bpmn2/tutorial/ui/task/ProcessWorkflowPropertySection.java

I would update the tutorial code and also the wiki if you can give me a hint what's going wrong?


===
Ralph
  • Attachment: screen1.png
    (Size: 23.22KB, Downloaded 480 times)
  • Attachment: screen2.png
    (Size: 27.83KB, Downloaded 445 times)
Re: bindAttribute did not work in case of copy&pase [message #1726571 is a reply to message #1726400] Mon, 14 March 2016 17:36 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 Ralph,

Congratulations, you've found another bug Wink

This is actually caused by the Paste function in DefaultPasteBPMNElementFeature.copyEObject(T eObject). Normally when a new object is constructed (i.e. during loading, or creation through the tool palette) the object is passed through the ModelExtensionDescriptor which adds metadata to the ExtendedPropertiesAdapter for extension features (the "processId" in your case). This does not happen during the Paste operation because...well, I just forgot to handle it.

I have a patch that fixes this easily and with no obvious side-effects. At the end of copyEObject() just before the return t; add these lines:

		ExtendedPropertiesAdapter<T> oldAdapter = ExtendedPropertiesAdapter.adapt(eObject);
		ExtendedPropertiesAdapter<T> newAdapter = ExtendedPropertiesAdapter.adapt(result);
		for (EStructuralFeature oldFeature : oldAdapter.getExtensionFeatures()) {
			FeatureDescriptor fd = newAdapter.getFeatureDescriptor(oldFeature);
			fd.setProperty(ExtendedPropertiesAdapter.IS_EXTENSION_FEATURE, Boolean.TRUE);
		}



Can you please file a bugzilla so we can track this bug?

Thanks!
Bob
Re: bindAttribute did not work in case of copy&pase [message #1726620 is a reply to message #1726571] Tue, 15 March 2016 07:40 Go to previous message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 193
Registered: July 2009
Senior Member
fine - I will do this.

===
Ralph
Previous Topic:v1.3.0: Strange Behavior of 'Edit Script Task'
Next Topic:New builds available for Mars and Luna
Goto Forum:
  


Current Time: Tue Oct 15 00:13:10 GMT 2024

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

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

Back to the top