This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 80613 - Exception when setting N/A as Count Completed Branches prop for ForEach
Summary: Exception when setting N/A as Count Completed Branches prop for ForEach
Status: VERIFIED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: BPEL (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-19 14:37 UTC by Mikhail Kondratyev
Modified: 2006-08-04 08:41 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kondratyev 2006-07-19 14:37:45 UTC
Steps to reproduce:
 - create a BPEL module
 - add ForEach activity to the process
 - open Properties window
 - select ForEach, set Support Completion Condition to true
 - set Count Completed Branches Only property to 'no'
 - set Count Completed Branches Only property back to 'N/A'
Exception will be thrown:
org.netbeans.modules.bpel.properties.props.RuntimeVetoException:
org.netbeans.modules.bpel.model.api.events.VetoException: The ptoperty "Count
Completed Branches Only" is requred and can not be removed
	at
org.netbeans.modules.bpel.properties.props.PropertyUtils$Reflection.setValue(PropertyUtils.java:693)
	at
org.openide.explorer.propertysheet.NodePropertyModel.setValue(NodePropertyModel.java:88)
	at org.openide.explorer.propertysheet.PropUtils.noDlgUpdateProp(PropUtils.java:565)
	at org.openide.explorer.propertysheet.PropUtils.updateProp(PropUtils.java:533)
	at org.openide.explorer.propertysheet.PropUtils.updateProp(PropUtils.java:639)
	at
org.openide.explorer.propertysheet.SheetCellEditor.stopCellEditing(SheetCellEditor.java:350)
	at
org.openide.explorer.propertysheet.SheetCellEditor.actionPerformed(SheetCellEditor.java:217)
	at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1207)
	at
org.openide.explorer.propertysheet.ComboInplaceEditor.fireActionEvent(ComboInplaceEditor.java:191)
	at javax.swing.JComboBox.setSelectedItem(JComboBox.java:559)
	at
org.openide.explorer.propertysheet.ComboInplaceEditor.setSelectedItem(ComboInplaceEditor.java:171)
	at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:595)
	at
javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:813)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
	at java.awt.Component.processMouseEvent(Component.java:5955)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3285)
	at
javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:480)
	at java.awt.Component.processEvent(Component.java:5720)
	at java.awt.Container.processEvent(Container.java:1960)
	at java.awt.Component.dispatchEventImpl(Component.java:4365)
	at java.awt.Container.dispatchEventImpl(Container.java:2018)
	at java.awt.Component.dispatchEvent(Component.java:4195)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4222)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3886)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3816)
	at java.awt.Container.dispatchEventImpl(Container.java:2004)
	at java.awt.Window.dispatchEventImpl(Window.java:2210)
	at java.awt.Component.dispatchEvent(Component.java:4195)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: org.netbeans.modules.bpel.model.api.events.VetoException: The
ptoperty "Count Completed Branches Only" is requred and can not be removed
	at
org.netbeans.modules.bpel.properties.props.PropertyUtils$Reflection.setValue(PropertyUtils.java:660)
	... 34 more
Comment 1 Michael Frisino 2006-07-26 14:05:03 UTC
Nikita, why is there an N/A choice?

I think there should just be a boolean check box. And the default setting shoul
be the default as per the specification.

This N/A is unnecessry complexity, no?
Comment 2 Michael Frisino 2006-07-26 14:13:12 UTC
well, maybe i see what you are worried about. You are worried that the Count
Completion condtion attrbibute is only meaningful if the completion condition is
non-null. You don't want to generate code for completion condtion if there is no
completion condtion. Yes? But you are perhaps worried that if user toggles the
Count Completion Condition property we will generate such code even when there
is no completion condtion value? Let me think about this. I still think we
should be able to use simple boolean for this property. It is just a question of
managing the code generation properly. Maybe Denis can manage this subtlety.
Maybe he can avoid generating code for Completion Condtion if it is empty string
or null.



	<complexType name="tForEach">
      	   <complexContent>
               <extension base="bpws:tActivity">
                   <sequence>
                       <element name="startCounterValue" type="bpws:tExpression"/>
                       <element name="finalCounterValue" type="bpws:tExpression"/>
		       <element name="completionCondition" type="bpws:tCompletionCondition"
minOccurs="0"/>
                       <element ref="bpws:scope" />
                   </sequence>
                   <attribute name="counterName" type="NCName"
                            use="required"/>
<!-- not supported by BPEL engine
                   <attribute name="parallel" type="bpws:tBoolean"
                            use="required"/>
-->
               </extension>
           </complexContent>
	</complexType>
	<complexType name="tCompletionCondition">
	   <complexContent>
               <extension base="bpws:tExtensibleElements">
                   <sequence>
                       <element name="branches">
		           <complexType> 
		             <complexContent>
			        <extension base="bpws:tExpression">
				    <attribute name="countCompletedBranchesOnly" type="bpws:tBoolean" /> 
				</extension> 
			     </complexContent> 
			   </complexType> 
		       </element> 
                   </sequence>
               </extension>
           </complexContent>
	</complexType> 
Comment 3 Michael Frisino 2006-07-26 14:38:27 UTC
Ok, talked to Denis already. He will take look at this bug. We can leave the UI
as combo box for now, but we need to allow user to do two things.

User must be able to set  Count Completion Condition Branches propety to N/A
without getting exception.

User must be able to "remove" the Completion Condition entirely, without getting
"This is required property error". Because, in fact, completion condition is not
required. 

So testing should make sure that both of those cases will work as intended.
Comment 4 Denis Anisimov 2006-07-26 15:20:22 UTC
I didn't find OM issues.

Currently there is no exception, but dialog with error appear.

It appear by reason of absence "romever" for countCompletionBranchesOnly property.
This remover is reflection method in property sheet.
This is wrong assumption in property editor code because there exist method
removeCountCompletionBranchesOnly. Property editor should use this method for 
remove property countCompletionBranchesOnly at least.

So dialog can be fixed in Property editor.

About all other discussion : all needed behavior should be also done in 
property editor code. It could determine absence of Branches and delete element 
CompletionCondition at all from ForEach.
Comment 5 Denis Anisimov 2006-07-26 15:32:29 UTC
There is one more issue when one tries to set empty expression to branches.
In this case dialog also appears.

Branches is ContentElement and it dosn't have method removeContent().
But here should not be called removeContent() method. Here should be called 
method setContent( "" );

And possibly in this case Nikita don't need to call this method at all but he 
need to remove CompletionCondition element at all from ForEach container.
( expression is set to "" , so we don't need actually branches, but
CompletionCondition contains ONLY branches , so we can delete both - 
CompletionCondition and its child - Branches ).
Comment 6 Denis Anisimov 2006-07-27 12:22:46 UTC
I will take care about it.
Comment 7 Denis Anisimov 2006-07-27 12:24:27 UTC
I have implemented possibility to remove countCompletedBranchesOnly attribute.

Will try to implement removal CompletionCondition element when expression is set 
to "".
Comment 8 Denis Anisimov 2006-07-27 13:18:04 UTC
I implemented described above behavior.
( when one set empty completion condition then element CompletionCondition
will be deleted with all its content ).
Comment 9 Mikhail Kondratyev 2006-08-04 08:41:27 UTC
Verified in build 17