Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Replacing property tab did overwrite all model objects?
Replacing property tab did overwrite all model objects? [message #1691158] Thu, 02 April 2015 16:22 Go to next message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 193
Registered: July 2009
Senior Member
Hi,

I created a custom Task model element wich extends the standard task model element (see the CustomTask Tutorial)
Next I tried to configure one of my custom propertySections to replace one of the default tabs of the Task element when my CustomTab element is selected:

<propertyTab
            class="org.imixs.bpmn.ui.process.ProcessApplicationPropertySection"
            id="org.imixs.bpmn.propertytab.application"
            label="Application"
            replaceTab="org.eclipse.bpmn2.modeler.task.tab"
            runtimeId="org.imixs.workflow.bpmn.runtime"
            type="org.eclipse.bpmn2.Task">
</propertyTab>


This works. But now also for all other Task Model Objects the default 'Task' tab is hidden.

My goal was just to replace this tab if my customTask was selected.
Is it possible to configure this or to overwrite this behavior?

Thanks for help

====
Ralph
Re: Replacing property tab did overwrite all model objects? [message #1691218 is a reply to message #1691158] Fri, 03 April 2015 14:08 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,

I think it IS possible to do this within the current API somehow. I'll let you know what I find out....

Bob
Re: Replacing property tab did overwrite all model objects? [message #1691222 is a reply to message #1691218] Fri, 03 April 2015 14:45 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, try this:

Override the method public boolean doReplaceTab(String replacedId, IWorkbenchPart part, ISelection selection) in your ProcessApplicationPropertySection class. In there you will have to examine the business object associated with the selection and determine if you want the tab to be replaced. You can use this:

		EObject businessObject = BusinessObjectUtil.getBusinessObjectForSelection(selection);


to get the business object.

I haven't had a chance to test this out, so let me know if this works!

Cheers,
Bob
Re: Replacing property tab did overwrite all model objects? [message #1691234 is a reply to message #1691222] Fri, 03 April 2015 16:29 Go to previous message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 193
Registered: July 2009
Senior Member
Hi Bob,

yes this works. Thanks!

	@Override
	public boolean doReplaceTab(String id, IWorkbenchPart part,
			ISelection selection) {

		EObject businessObject = BusinessObjectUtil
				.getBusinessObjectForSelection(selection);

		EStructuralFeature feature = ModelDecorator.getAnyAttribute(
				businessObject, "processid");
		if (feature != null && feature instanceof EAttribute) {
			if (ImixsRuntimeExtension.targetNamespace
					.equals(((EAttributeImpl) feature).getExtendedMetaData()
							.getNamespace())) {
				return true;
			}
		}

		return false;
	}


I will add this into the tutorial...

===
Ralph
Previous Topic:TextObjectEditor - setMultiLine(true) not working as expected?
Next Topic:Creating a documentation of BPMN 2.0 model
Goto Forum:
  


Current Time: Sun Oct 06 19:11:23 GMT 2024

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

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

Back to the top