Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Several identical elements in <extensionElements> tag
Several identical elements in <extensionElements> tag [message #1744359] Mon, 26 September 2016 10:04 Go to next message
Oleg Shcherbakov is currently offline Oleg ShcherbakovFriend
Messages: 2
Registered: June 2016
Junior Member
Hi there!

Is it possible to add several identical elements to the <extensionElements> tag without the intermediate container tag (like "TaskConfig" in DeveloperTutorial's example)?

My current goal is to add several taskListener elements with different event types to my customTask. It should turn out as in TaskListenerTest example from Activiti repository e.g.:
<userTask id="task1" name="Schedule meeting" > 
		Schedule a meeting with management. 
		<activiti:taskListener event="create" class="org.activiti.examples.bpmn.tasklistener.TaskCreateListener" /> 
		<activiti:taskListener event="complete" class="org.activiti.examples.bpmn.tasklistener.TaskCompleteListener"> 
			<activiti:field name="greeter" stringValue="The Process" /> 
			<activiti:field name="shortName" expression="${'Activiti'.substring(0,3)}" /> 
		<activiti:taskListener event="assignment" class="org.activiti.examples.bpmn.tasklistener.TaskAssignmentListener" /> 
		<activiti:taskListener event="all" class="org.activiti.examples.bpmn.tasklistener.TaskAllEventsListener" /> 

I can fetch all TaskListener extension objects from current Task by calling:
ModelDecorator.getAllExtensionAttrivuteValues(eObject, TaskListener.class);

But I don't see any way to save more than one of newly created TaskListener objects directly to the extensionElements container because there is only one corresponding EStructuralFeature object for my taskListener tag.
Re: Several identical elements in <extensionElements> tag [message #1746904 is a reply to message #1744359] Mon, 07 November 2016 14:10 Go to previous message
Oleg Shcherbakov is currently offline Oleg ShcherbakovFriend
Messages: 2
Registered: June 2016
Junior Member
Hi all once again!

I returned to this problem. At this point it is not clear why my structuralFeature (TaskListener) object have upperBound value equal to "1" while in ecore model it equals to "-2". My model.ecore looks like:

I'm getting it by calling next part of code:
TargetRuntime runtime = getTargetRuntime();
CustomTaskDescriptor customTaskDescriptor = runtime.getCustomTask(CUSTOM_TASK_ID);
List<TaskListener> taskLitenerList = ModelDecorator.getAllExtensionAttributeValues(eObject, TaskListener.class);
taskListenerList.getUpperBound(); // equals "1"

Probably because of this, as a result, I always get only one TaskListener element from extensionElements regardless of their actual number.
Is the return value of "1" a correct behavior?
Previous Topic:Latest Stable Channel
Next Topic:In memory 2 sequence flow created while loading the resource file.
Goto Forum:

Current Time: Fri Jun 02 08:54:32 GMT 2023

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

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

Back to the top