Author: koen.aers(a)jboss.com
Date: 2009-05-27 17:24:00 -0400 (Wed, 27 May 2009)
New Revision: 15569
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/TerminateEndEvent.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventEndsSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventStateSection.java
Removed:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/TerminateEndEvent.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
Log:
support end event attributes (GPD-326)
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-27 18:02:25 UTC (rev
15568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-27 21:24:00 UTC (rev
15569)
@@ -391,24 +391,38 @@
<propertySection
afterSection="org.jboss.tools.jpdl4.name"
class="org.jboss.tools.flow.jpdl4.properties.ExclusiveGatewayLanguageSection"
- id="org.jboss.tools.jpdl4.exclusivegateway.language"
+ id="org.jboss.tools.jpdl4.exclusiveGateway.language"
tab="org.jboss.tools.jpdl4.general">
<input
type="org.jboss.tools.flow.jpdl4.model.ExclusiveGateway"/>
</propertySection>
<propertySection
- afterSection="org.jboss.tools.jpdl4.exclusivegateway.language"
+ afterSection="org.jboss.tools.jpdl4.exclusiveGateway.language"
class="org.jboss.tools.flow.jpdl4.properties.ExclusiveGatewayExpressionSection"
- id="org.jboss.tools.jpdl4.exclusivegateway.expression"
+ id="org.jboss.tools.jpdl4.exclusiveGateway.expression"
tab="org.jboss.tools.jpdl4.general">
<input
type="org.jboss.tools.flow.jpdl4.model.ExclusiveGateway"/>
</propertySection>
<propertySection
-
afterSection="org.jboss.tools.jpdl4.exclusivegateway.expression"
+
afterSection="org.jboss.tools.jpdl4.exclusiveGateway.expression"
class="org.jboss.tools.flow.jpdl4.properties.ExclusiveGatewayClassNameSection"
- id="org.jboss.tools.jpdl4.exclusivegateway.classname"
+ id="org.jboss.tools.jpdl4.exclusiveGateway.classname"
tab="org.jboss.tools.jpdl4.general">
<input
type="org.jboss.tools.flow.jpdl4.model.ExclusiveGateway"/>
</propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.name"
+
class="org.jboss.tools.flow.jpdl4.properties.EndEventEndsSection"
+ id="org.jboss.tools.jpdl4.endEvent.ends"
+ tab="org.jboss.tools.jpdl4.general">
+ <input
type="org.jboss.tools.flow.jpdl4.model.TerminateEndEvent"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.endEvent.ends"
+
class="org.jboss.tools.flow.jpdl4.properties.EndEventStateSection"
+ id="org.jboss.tools.jpdl4.endEvent.state"
+ tab="org.jboss.tools.jpdl4.general">
+ <input
type="org.jboss.tools.flow.jpdl4.model.TerminateEndEvent"/>
+ </propertySection>
</propertySections>
</extension>
<extension
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-05-27
18:02:25 UTC (rev 15568)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-05-27
21:24:00 UTC (rev 15569)
@@ -26,6 +26,7 @@
import org.jboss.tools.flow.jpdl4.model.Process;
import org.jboss.tools.flow.jpdl4.model.SubprocessTask;
import org.jboss.tools.flow.jpdl4.model.Swimlane;
+import org.jboss.tools.flow.jpdl4.model.TerminateEndEvent;
import org.jboss.tools.flow.jpdl4.model.Timer;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -99,6 +100,16 @@
}
}
+ class TerminateEndEventAttributeHandler extends NodeAttributeHandler {
+ public void deserializeAttributes(Wrapper wrapper, Element element) {
+ super.deserializeAttributes(wrapper, element);
+ if (!(wrapper.getElement() instanceof TerminateEndEvent)) return;
+ TerminateEndEvent terminateEndEvent = (TerminateEndEvent)wrapper.getElement();
+ terminateEndEvent.setEnds(element.getAttribute("ends"));
+ terminateEndEvent.setState(element.getAttribute("state"));
+ }
+ }
+
class HumanTaskAttributeHandler extends NodeAttributeHandler {
AssignmentAttributeHandler assignmentAttributeHandler = new
AssignmentAttributeHandler();
public void deserializeAttributes(Wrapper wrapper, Element element) {
@@ -436,6 +447,8 @@
return new SubprocessTaskAttributeHandler();
} else if (element instanceof ExclusiveGateway) {
return new ExclusiveGatewayAttributeHandler();
+ } else if (element instanceof TerminateEndEvent) {
+ return new TerminateEndEventAttributeHandler();
} else {
return new NodeAttributeHandler();
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-05-27
18:02:25 UTC (rev 15568)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-05-27
21:24:00 UTC (rev 15569)
@@ -335,14 +335,6 @@
result.add("lang");
return result;
}
- protected String getPropertyName(String attributeName) {
- if ("expr".equals(attributeName)) {
- return ExclusiveGateway.EXPR;
- } else if ("repeat".equals(attributeName)) {
- return ExclusiveGateway.LANG;
- }
- return super.getPropertyName(attributeName);
- }
public void appendBody(StringBuffer buffer, Wrapper wrapper, int level) {
ExclusiveGateway exclusiveGateway = (ExclusiveGateway)wrapper.getElement();
String handler = exclusiveGateway.getHandler();
@@ -355,6 +347,15 @@
}
}
+ class TerminateEndEventWrapperSerializer extends ProcessNodeWrapperSerializer {
+ protected List<String> getAttributesToSave() {
+ List<String> result = super.getAttributesToSave();
+ result.add("ends");
+ result.add("state");
+ return result;
+ }
+ }
+
class HumanTaskWrapperSerializer extends ProcessNodeWrapperSerializer {
protected List<String> getAttributesToSave() {
List<String> result = super.getAttributesToSave();
@@ -607,7 +608,7 @@
if (element instanceof SequenceFlow) {
new SequenceFlowWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof TerminateEndEvent) {
- new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+ new TerminateEndEventWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof ErrorEndEvent) {
new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof CancelEndEvent) {
@@ -660,7 +661,7 @@
if (element instanceof SequenceFlow) {
new SequenceFlowWrapperSerializer().appendBody(buffer, wrapper, level);
} else if (element instanceof TerminateEndEvent) {
- new ProcessNodeWrapperSerializer().appendBody(buffer, wrapper, level);
+ new TerminateEndEventWrapperSerializer().appendBody(buffer, wrapper, level);
} else if (element instanceof ErrorEndEvent) {
new ProcessNodeWrapperSerializer().appendBody(buffer, wrapper, level);
} else if (element instanceof CancelEndEvent) {
Deleted:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/TerminateEndEvent.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/TerminateEndEvent.java 2009-05-27
18:02:25 UTC (rev 15568)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/TerminateEndEvent.java 2009-05-27
21:24:00 UTC (rev 15569)
@@ -1,6 +0,0 @@
-package org.jboss.tools.flow.jpdl4.model;
-
-
-public class TerminateEndEvent extends EndEvent {
-
-}
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/TerminateEndEvent.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/TerminateEndEvent.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/TerminateEndEvent.java 2009-05-27
21:24:00 UTC (rev 15569)
@@ -0,0 +1,79 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+
+
+public class TerminateEndEvent extends EndEvent {
+
+ public final static String ENDS = "ends";
+ public final static String STATE = "state";
+
+ private String ends;
+ private String state;
+
+ public TerminateEndEvent() {
+ setMetaData("propertySource", new PropertySource());
+ }
+
+ public String getEnds() {
+ return ends;
+ }
+
+ public void setEnds(String ends) {
+ this.ends = ends;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ private class PropertySource implements IPropertySource {
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return new IPropertyDescriptor[0];
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (ENDS.equals(id)) {
+ return getEnds();
+ } else if (STATE.equals(id)) {
+ return getState();
+ } else {
+ return null;
+ }
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (ENDS.equals(id)) {
+ return getEnds() != null;
+ } else if (STATE.equals(id)) {
+ return getState() != null;
+ } else {
+ return false;
+ }
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (ENDS.equals(id)) {
+ setEnds((String)value);
+ } else if (STATE.equals(id)) {
+ setState((String)value);
+ }
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/TerminateEndEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventEndsSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventEndsSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventEndsSection.java 2009-05-27
21:24:00 UTC (rev 15569)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.TerminateEndEvent;
+
+public class EndEventEndsSection extends TextFieldPropertySection {
+
+ public EndEventEndsSection() {
+ super(TerminateEndEvent.ENDS, "Ends");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventEndsSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventStateSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventStateSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventStateSection.java 2009-05-27
21:24:00 UTC (rev 15569)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.TerminateEndEvent;
+
+public class EndEventStateSection extends TextFieldPropertySection {
+
+ public EndEventStateSection() {
+ super(TerminateEndEvent.STATE, "State");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EndEventStateSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain