Merge latest luna changes
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IExtensionValueAdapter.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IExtensionValueAdapter.java
index c4fb2a1..c3ded72 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IExtensionValueAdapter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/adapters/IExtensionValueAdapter.java
@@ -13,13 +13,14 @@
package org.eclipse.bpmn2.modeler.core.adapters;
+import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
/**
*
*/
-public interface IExtensionValueAdapter {
+public interface IExtensionValueAdapter extends Adapter {
public boolean shouldSaveElement(EObject o);
public boolean shouldSaveFeature(EObject o, EStructuralFeature f);
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractConnectionRouter.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractConnectionRouter.java
index 9cf814c..6e23ba8 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractConnectionRouter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractConnectionRouter.java
@@ -12,12 +12,14 @@
******************************************************************************/
package org.eclipse.bpmn2.modeler.core.features;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorSite;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.graphiti.features.IFeatureProvider;
+import org.eclipse.graphiti.mm.algorithms.styles.Point;
import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.services.Graphiti;
import org.eclipse.graphiti.services.IGaService;
import org.eclipse.graphiti.services.IPeService;
-import org.eclipse.core.runtime.Assert;
/**
* Abstract base class for Connection Routers. This is a container for common utility functions
@@ -30,17 +32,6 @@
/** The Constant gaService. */
protected static final IGaService gaService = Graphiti.getGaService();
-
- /**
- * The connection routing directions.
- */
- public enum Direction {
- UP,
- DOWN,
- LEFT,
- RIGHT,
- NONE
- };
/** The Feature Provider. */
protected IFeatureProvider fp;
@@ -55,6 +46,11 @@
}
/* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.IConnectionRouter#initialize(org.eclipse.graphiti.mm.pictograms.Connection)
+ */
+ protected abstract void initialize(Connection connection);
+
+ /* (non-Javadoc)
* @see org.eclipse.bpmn2.modeler.core.features.IConnectionRouter#route(org.eclipse.graphiti.mm.pictograms.Connection)
*/
@Override
@@ -158,6 +154,11 @@
return addRoutingInfo(connection, info+"="+value); //$NON-NLS-1$
}
+ public static String setRoutingInfo(Connection connection, String info, String value) {
+ removeRoutingInfo(connection, info+"="); //$NON-NLS-1$
+ return addRoutingInfo(connection, info+"="+value); //$NON-NLS-1$
+ }
+
/**
* Gets the routing info.
*
@@ -169,7 +170,7 @@
String oldInfo = getRoutingInfo(connection);
String a[] = oldInfo.split(","); //$NON-NLS-1$
for (String s : a) {
- if (oldInfo.startsWith(info+"=")) { //$NON-NLS-1$
+ if (s.startsWith(info+"=")) { //$NON-NLS-1$
try {
String b[] = s.split("="); //$NON-NLS-1$
return Integer.parseInt(b[1]);
@@ -181,6 +182,22 @@
return -1;
}
+ public static String getRoutingInfo(Connection connection, String info) {
+ String oldInfo = getRoutingInfo(connection);
+ String a[] = oldInfo.split(","); //$NON-NLS-1$
+ for (String s : a) {
+ if (s.startsWith(info+"=")) { //$NON-NLS-1$
+ try {
+ String b[] = s.split("="); //$NON-NLS-1$
+ return b[1];
+ }
+ catch (Exception e) {
+ }
+ }
+ }
+ return null;
+ }
+
/**
* Sets the force routing.
*
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BendpointConnectionRouter.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BendpointConnectionRouter.java
index 50a58ea..48633fe 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BendpointConnectionRouter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BendpointConnectionRouter.java
@@ -12,13 +12,16 @@
******************************************************************************/
package org.eclipse.bpmn2.modeler.core.features;
-import java.util.ArrayList;
-import java.util.List;
-
+import org.eclipse.bpmn2.BoundaryEvent;
import org.eclipse.bpmn2.modeler.core.di.DIUtils;
import org.eclipse.bpmn2.modeler.core.utils.AnchorSite;
+import org.eclipse.bpmn2.modeler.core.utils.AnchorType;
import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
+import org.eclipse.bpmn2.modeler.core.utils.BoundaryEventPositionHelper;
+import org.eclipse.bpmn2.modeler.core.utils.BoundaryEventPositionHelper.PositionOnLine;
+import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.graphiti.datatypes.IDimension;
import org.eclipse.graphiti.datatypes.ILocation;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -27,6 +30,7 @@
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.FixPointAnchor;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
+import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.Graphiti;
/**
@@ -41,7 +45,13 @@
/** The removed bendpoint. */
protected Point removedBendpoint;
/** The list of old connection cuts (including the end cuts) for determining if a route has changed */
- protected List<Point> oldPoints;
+ protected Point oldPoints[];
+
+ /** The list of allowable source shape edges which can serve as sites (top, left, bottom or right) */
+ AnchorSite sourceAnchorSites[];
+
+ /** The list of allowable target shape edges which can serve as sites */
+ AnchorSite targetAnchorSites[];
/**
* Instantiates a new bendpoint connection router.
@@ -53,34 +63,21 @@
}
/* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.DefaultConnectionRouter#route(org.eclipse.graphiti.mm.pictograms.Connection)
+ * @see org.eclipse.bpmn2.modeler.core.features.IConnectionRouter#canRoute(org.eclipse.graphiti.mm.pictograms.Connection)
*/
@Override
- public boolean route(Connection connection) {
- super.route(connection);
-
- boolean changed = false;
- if (connection instanceof FreeFormConnection) {
- ffc = (FreeFormConnection)connection;
- initialize();
- ConnectionRoute route = calculateRoute();
- if (route!=null) {
- changed = isRouteChanged(route);
- applyRoute(route);
- }
- dispose();
- }
-
- return changed;
+ public boolean canRoute(Connection connection) {
+ return super.canRoute(connection) && connection instanceof FreeFormConnection;
}
- /**
- * Initialize the newPoints list and set the new start and end anchors.
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.DefaultConnectionRouter#initialize(org.eclipse.graphiti.mm.pictograms.Connection)
*/
@Override
- protected void initialize() {
- super.initialize();
-
+ protected void initialize(Connection connection) {
+ super.initialize(connection);
+ ffc = (FreeFormConnection)connection;
+
movedBendpoint = getMovedBendpoint(ffc);
if (movedBendpoint==null)
movedBendpoint = getAddedBendpoint(ffc);
@@ -100,15 +97,456 @@
* Save the connection's start/end anchors, and their locations as well as
* the bendpoints. This is used to compare against the new ConnectionRoute
*/
- oldPoints = new ArrayList<Point>();
- oldPoints.add(GraphicsUtil.createPoint(ffc.getStart()));
+ oldPoints = new Point[ffc.getBendpoints().size() + 2];
+ int i = 0;
+ oldPoints[i++] = GraphicsUtil.createPoint(ffc.getStart());
for (Point p : ffc.getBendpoints()) {
- oldPoints.add(GraphicsUtil.createPoint(p));
+ oldPoints[i++] = GraphicsUtil.createPoint(p);
}
- oldPoints.add(GraphicsUtil.createPoint(ffc.getEnd()));
+ oldPoints[i++] = GraphicsUtil.createPoint(ffc.getEnd());
calculateAllowedAnchorSites();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.DefaultConnectionRouter#route(org.eclipse.graphiti.mm.pictograms.Connection)
+ */
+ @Override
+ public boolean route(Connection connection) {
+ initialize(connection);
+
+ boolean changed = false;
+ if (connection instanceof FreeFormConnection) {
+ ConnectionRoute route = calculateRoute();
+ if (route!=null) {
+ changed = isRouteChanged(route);
+ applyRoute(route);
+ }
+ dispose();
+ }
+
+ return changed;
+ }
+
+ /**
+ *
+ */
+ protected void calculateAllowedAnchorSites() {
+
+ EObject bo = BusinessObjectUtil.getBusinessObjectForPictogramElement(source);
+ if (bo instanceof BoundaryEvent) {
+ sourceAnchorSites = calculateBoundaryEventAnchorSites(source);
+ }
+ bo = BusinessObjectUtil.getBusinessObjectForPictogramElement(target);
+ if (bo instanceof BoundaryEvent) {
+ targetAnchorSites = calculateBoundaryEventAnchorSites(target);
+ }
+ if (AnchorType.getType(source) == AnchorType.CONNECTION) {
+ sourceAnchorSites = new AnchorSite[1];
+ sourceAnchorSites[0] = AnchorSite.CENTER;
+ }
+ if (AnchorType.getType(target) == AnchorType.CONNECTION) {
+ targetAnchorSites = new AnchorSite[1];
+ targetAnchorSites[0] = AnchorSite.CENTER;
+ }
+
+ ILocation sPos = Graphiti.getPeService().getLocationRelativeToDiagram(source);
+ IDimension sSize = GraphicsUtil.calculateSize(source);
+ ILocation tPos = Graphiti.getPeService().getLocationRelativeToDiagram(target);
+ IDimension tSize = GraphicsUtil.calculateSize(target);
+
+ if (movedBendpoint!=null) {
+ Point sc = GraphicsUtil.getShapeCenter(source);
+ Point tc = GraphicsUtil.getShapeCenter(target);
+ double ds = GraphicsUtil.getLength(movedBendpoint, sc);
+ double dt = GraphicsUtil.getLength(movedBendpoint, tc);
+ boolean expandSourceSites = ds > 2*dt;
+ boolean expandTargetSites = dt > 2*ds;
+ if (sourceAnchorSites==null) {
+ if (movedBendpoint.getX() < sPos.getX()) {
+ // bendpoint is left of shape
+ if (movedBendpoint.getY() < sPos.getY()) {
+ // bendpoint is above shape
+ sourceAnchorSites = new AnchorSite[2];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ sourceAnchorSites[1] = AnchorSite.TOP;
+ }
+ else if (sPos.getY()+sSize.getHeight() < movedBendpoint.getY()) {
+ // bendpoint is below shape
+ sourceAnchorSites = new AnchorSite[2];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ sourceAnchorSites[1] = AnchorSite.BOTTOM;
+ }
+ else {
+ // bendpoint is directly left of shape
+ if (expandSourceSites) {
+ sourceAnchorSites = new AnchorSite[3];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ sourceAnchorSites[1] = AnchorSite.TOP;
+ sourceAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ else {
+ sourceAnchorSites = new AnchorSite[1];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ }
+ }
+ }
+ else if (sPos.getX()+sSize.getWidth() < movedBendpoint.getX()) {
+ // bendpoint is right of shape
+ if (movedBendpoint.getY() < sPos.getY()) {
+ // bendpoint is above shape
+ sourceAnchorSites = new AnchorSite[2];
+ sourceAnchorSites[0] = AnchorSite.RIGHT;
+ sourceAnchorSites[1] = AnchorSite.TOP;
+ }
+ else if (sPos.getY()+sSize.getHeight() < movedBendpoint.getY()) {
+ // bendpoint is below shape
+ sourceAnchorSites = new AnchorSite[2];
+ sourceAnchorSites[0] = AnchorSite.RIGHT;
+ sourceAnchorSites[1] = AnchorSite.BOTTOM;
+ }
+ else {
+ // bendpoint is directly right of shape
+ if (expandSourceSites) {
+ sourceAnchorSites = new AnchorSite[3];
+ sourceAnchorSites[0] = AnchorSite.RIGHT;
+ sourceAnchorSites[1] = AnchorSite.TOP;
+ sourceAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ else {
+ sourceAnchorSites = new AnchorSite[1];
+ sourceAnchorSites[0] = AnchorSite.RIGHT;
+ }
+ }
+ }
+ else {
+ // bendpoint is directly above or below shape
+ if (movedBendpoint.getY() < sPos.getY()) {
+ // bendpoint is above shape
+ if (expandSourceSites) {
+ sourceAnchorSites = new AnchorSite[3];
+ sourceAnchorSites[0] = AnchorSite.TOP;
+ sourceAnchorSites[1] = AnchorSite.LEFT;
+ sourceAnchorSites[2] = AnchorSite.RIGHT;
+ }
+ else {
+ sourceAnchorSites = new AnchorSite[1];
+ sourceAnchorSites[0] = AnchorSite.TOP;
+ }
+ }
+ else if (sPos.getY()+sSize.getHeight() < movedBendpoint.getY()) {
+ // bendpoint is below shape
+ if (expandSourceSites) {
+ sourceAnchorSites = new AnchorSite[3];
+ sourceAnchorSites[0] = AnchorSite.BOTTOM;
+ sourceAnchorSites[1] = AnchorSite.LEFT;
+ sourceAnchorSites[2] = AnchorSite.RIGHT;
+ }
+ else {
+ sourceAnchorSites = new AnchorSite[1];
+ sourceAnchorSites[0] = AnchorSite.BOTTOM;
+ }
+ }
+ else {
+ // bendpoint is inside shape
+ sourceAnchorSites = new AnchorSite[0];
+ }
+ }
+ }
+ if (targetAnchorSites==null) {
+ if (movedBendpoint.getX() < tPos.getX()) {
+ // bendpoint is left of shape
+ if (movedBendpoint.getY() < tPos.getY()) {
+ // bendpoint is above shape
+ targetAnchorSites = new AnchorSite[2];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ targetAnchorSites[1] = AnchorSite.TOP;
+ }
+ else if (tPos.getY()+tSize.getHeight() < movedBendpoint.getY()) {
+ // bendpoint is below shape
+ targetAnchorSites = new AnchorSite[2];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ targetAnchorSites[1] = AnchorSite.BOTTOM;
+ }
+ else {
+ // bendpoint is directly left of shape
+ if (expandTargetSites) {
+ targetAnchorSites = new AnchorSite[3];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ targetAnchorSites[1] = AnchorSite.TOP;
+ targetAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ else {
+ targetAnchorSites = new AnchorSite[1];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ }
+ }
+ }
+ else if (tPos.getX()+tSize.getWidth() < movedBendpoint.getX()) {
+ // bendpoint is right of shape
+ if (movedBendpoint.getY() < tPos.getY()) {
+ // bendpoint is above shape
+ targetAnchorSites = new AnchorSite[2];
+ targetAnchorSites[0] = AnchorSite.RIGHT;
+ targetAnchorSites[1] = AnchorSite.TOP;
+ }
+ else if (tPos.getY()+tSize.getHeight() < movedBendpoint.getY()) {
+ // bendpoint is below shape
+ targetAnchorSites = new AnchorSite[2];
+ targetAnchorSites[0] = AnchorSite.RIGHT;
+ targetAnchorSites[1] = AnchorSite.BOTTOM;
+ }
+ else {
+ // bendpoint is directly right of shape
+ if (expandTargetSites) {
+ targetAnchorSites = new AnchorSite[3];
+ targetAnchorSites[0] = AnchorSite.RIGHT;
+ targetAnchorSites[1] = AnchorSite.TOP;
+ targetAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ else {
+ targetAnchorSites = new AnchorSite[1];
+ targetAnchorSites[0] = AnchorSite.RIGHT;
+ }
+ }
+ }
+ else {
+ // bendpoint is directly above or below shape
+ if (movedBendpoint.getY() < tPos.getY()) {
+ // bendpoint is above shape
+ if (expandTargetSites) {
+ targetAnchorSites = new AnchorSite[3];
+ targetAnchorSites[0] = AnchorSite.TOP;
+ targetAnchorSites[1] = AnchorSite.LEFT;
+ targetAnchorSites[2] = AnchorSite.RIGHT;
+ }
+ else {
+ targetAnchorSites = new AnchorSite[1];
+ targetAnchorSites[0] = AnchorSite.TOP;
+ }
+ }
+ else if (tPos.getY()+tSize.getHeight() < movedBendpoint.getY()) {
+ // bendpoint is below shape
+ if (expandTargetSites) {
+ targetAnchorSites = new AnchorSite[3];
+ targetAnchorSites[0] = AnchorSite.BOTTOM;
+ targetAnchorSites[1] = AnchorSite.LEFT;
+ targetAnchorSites[2] = AnchorSite.RIGHT;
+ }
+ else {
+ targetAnchorSites = new AnchorSite[1];
+ targetAnchorSites[0] = AnchorSite.BOTTOM;
+ }
+ }
+ else {
+ // bendpoint is inside shape
+ targetAnchorSites = new AnchorSite[0];
+ }
+ }
+ }
+ return;
+ }
+
+ // find relative locations
+ if (sPos.getX()+sSize.getWidth() < tPos.getX()) {
+ // source shape is to left of target
+ if (sPos.getY()+sSize.getHeight() < tPos.getY()) {
+ // source shape is to left and above target:
+ // omit the two opposite sides of both source and target
+ if (sourceAnchorSites==null) {
+ sourceAnchorSites = new AnchorSite[2];
+ sourceAnchorSites[0] = AnchorSite.RIGHT;
+ sourceAnchorSites[1] = AnchorSite.BOTTOM;
+ }
+ if (targetAnchorSites==null) {
+ targetAnchorSites = new AnchorSite[2];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ targetAnchorSites[1] = AnchorSite.TOP;
+ }
+ }
+ else if(sPos.getY() > tPos.getY()+tSize.getHeight()) {
+ // source shape is to left and below target
+ if (sourceAnchorSites==null) {
+ sourceAnchorSites = new AnchorSite[2];
+ sourceAnchorSites[0] = AnchorSite.RIGHT;
+ sourceAnchorSites[1] = AnchorSite.TOP;
+ }
+ if (targetAnchorSites==null) {
+ targetAnchorSites = new AnchorSite[2];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ targetAnchorSites[1] = AnchorSite.BOTTOM;
+ }
+ }
+ else {
+ if (sourceAnchorSites==null) {
+ sourceAnchorSites = new AnchorSite[3];
+ sourceAnchorSites[0] = AnchorSite.RIGHT;
+ sourceAnchorSites[1] = AnchorSite.TOP;
+ sourceAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ if (targetAnchorSites==null) {
+ targetAnchorSites = new AnchorSite[3];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ targetAnchorSites[1] = AnchorSite.TOP;
+ targetAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ }
+ }
+ else if (sPos.getX() > tPos.getX()+tSize.getWidth()) {
+ // source shape is to right of target
+ if (sPos.getY()+sSize.getHeight() < tPos.getY()) {
+ // source shape is to right and above target
+ if (sourceAnchorSites==null) {
+ sourceAnchorSites = new AnchorSite[2];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ sourceAnchorSites[1] = AnchorSite.BOTTOM;
+ }
+ if (targetAnchorSites==null) {
+ targetAnchorSites = new AnchorSite[2];
+ targetAnchorSites[0] = AnchorSite.RIGHT;
+ targetAnchorSites[1] = AnchorSite.TOP;
+ }
+ }
+ else if(sPos.getY() > tPos.getY()+tSize.getHeight()) {
+ // source shape is to right and below target
+ if (sourceAnchorSites==null) {
+ sourceAnchorSites = new AnchorSite[2];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ sourceAnchorSites[1] = AnchorSite.TOP;
+ }
+ if (targetAnchorSites==null) {
+ targetAnchorSites = new AnchorSite[2];
+ targetAnchorSites[0] = AnchorSite.RIGHT;
+ targetAnchorSites[1] = AnchorSite.BOTTOM;
+ }
+ }
+ else {
+ if (sourceAnchorSites==null) {
+ sourceAnchorSites = new AnchorSite[3];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ sourceAnchorSites[1] = AnchorSite.TOP;
+ sourceAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ if (targetAnchorSites==null) {
+ targetAnchorSites = new AnchorSite[3];
+ targetAnchorSites[0] = AnchorSite.RIGHT;
+ targetAnchorSites[1] = AnchorSite.TOP;
+ targetAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ }
+ }
+ else if (sPos.getY()+sSize.getHeight() < tPos.getY()) {
+ // source shape is above target
+ if (sourceAnchorSites==null) {
+ sourceAnchorSites = new AnchorSite[3];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ sourceAnchorSites[1] = AnchorSite.RIGHT;
+ sourceAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ if (targetAnchorSites==null) {
+ targetAnchorSites = new AnchorSite[3];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ targetAnchorSites[1] = AnchorSite.RIGHT;
+ targetAnchorSites[2] = AnchorSite.TOP;
+ }
+ }
+ else if(sPos.getY() > tPos.getY()+tSize.getHeight()) {
+ // source shape is below target
+ if (sourceAnchorSites==null) {
+ sourceAnchorSites = new AnchorSite[3];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ sourceAnchorSites[1] = AnchorSite.RIGHT;
+ sourceAnchorSites[2] = AnchorSite.TOP;
+ }
+ if (targetAnchorSites==null) {
+ targetAnchorSites = new AnchorSite[3];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ targetAnchorSites[1] = AnchorSite.RIGHT;
+ targetAnchorSites[2] = AnchorSite.BOTTOM;
+ }
+ }
+ else {
+ // source and target overlap
+ if (sourceAnchorSites==null) {
+ sourceAnchorSites = new AnchorSite[4];
+ sourceAnchorSites[0] = AnchorSite.LEFT;
+ sourceAnchorSites[1] = AnchorSite.RIGHT;
+ sourceAnchorSites[2] = AnchorSite.TOP;
+ sourceAnchorSites[3] = AnchorSite.BOTTOM;
+ }
+ if (targetAnchorSites==null) {
+ targetAnchorSites = new AnchorSite[4];
+ targetAnchorSites[0] = AnchorSite.LEFT;
+ targetAnchorSites[1] = AnchorSite.RIGHT;
+ targetAnchorSites[2] = AnchorSite.TOP;
+ targetAnchorSites[3] = AnchorSite.BOTTOM;
+ }
+ }
+ }
+
+ protected AnchorSite[] calculateBoundaryEventAnchorSites(Shape shape) {
+ AnchorSite sites[];
+ PositionOnLine pol = BoundaryEventPositionHelper.getPositionOnLineProperty(shape);
+ switch (pol.getLocationType()) {
+ case BOTTOM:
+ sites = new AnchorSite[1];
+ sites[0] = AnchorSite.BOTTOM;
+ break;
+ case BOTTOM_LEFT:
+ sites = new AnchorSite[2];
+ sites[0] = AnchorSite.BOTTOM;
+ sites[1] = AnchorSite.LEFT;
+ break;
+ case BOTTOM_RIGHT:
+ sites = new AnchorSite[2];
+ sites[0] = AnchorSite.BOTTOM;
+ sites[1] = AnchorSite.RIGHT;
+ break;
+ case LEFT:
+ sites = new AnchorSite[1];
+ sites[0] = AnchorSite.LEFT;
+ break;
+ case RIGHT:
+ sites = new AnchorSite[1];
+ sites[0] = AnchorSite.RIGHT;
+ break;
+ case TOP:
+ sites = new AnchorSite[1];
+ sites[0] = AnchorSite.TOP;
+ break;
+ case TOP_LEFT:
+ sites = new AnchorSite[2];
+ sites[0] = AnchorSite.TOP;
+ sites[1] = AnchorSite.LEFT;
+ break;
+ case TOP_RIGHT:
+ sites = new AnchorSite[2];
+ sites[0] = AnchorSite.TOP;
+ sites[1] = AnchorSite.RIGHT;
+ break;
+ default:
+ sites = new AnchorSite[4];
+ sites[0] = AnchorSite.TOP;
+ sites[1] = AnchorSite.LEFT;
+ sites[2] = AnchorSite.BOTTOM;
+ sites[3] = AnchorSite.RIGHT;
+ break;
+ }
+ return sites;
+ }
+
+ protected boolean shouldCalculate(AnchorSite sourceSite, AnchorSite targetSite) {
+ for (int i=0; i<sourceAnchorSites.length; ++i) {
+ if (sourceSite == sourceAnchorSites[i]) {
+ for (int j=0; j<targetAnchorSites.length; ++j) {
+ if (targetSite == targetAnchorSites[j]) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
/**
* Calculate route.
*
@@ -130,12 +568,12 @@
Point end = GraphicsUtil.createPoint(targetAnchor);
route.add(start);
- for (int i=1; i<oldPoints.size() -1; ++i) {
- route.add(oldPoints.get(i));
+ for (int i=1; i<oldPoints.length -1; ++i) {
+ route.add(oldPoints[i]);
}
route.add(end);
- oldPoints.clear();
+ oldPoints = null;
return route;
}
@@ -221,11 +659,11 @@
protected boolean isRouteChanged(ConnectionRoute route) {
if (route==null || route.size()==0)
return false;
- if (oldPoints.size()!=route.size()) {
+ if (oldPoints.length!=route.size()) {
return true;
}
- for (int i=0; i<oldPoints.size(); ++i) {
- Point p1 = oldPoints.get(i);
+ for (int i=0; i<oldPoints.length; ++i) {
+ Point p1 = oldPoints[i];
Point p2 = route.get(i);
if (!GraphicsUtil.pointsEqual(p1, p2)) {
return true;
@@ -290,8 +728,8 @@
* @param connection the connection
* @param index the index
*/
- public static void setRemovedBendpoint(Connection connection, int index) {
- setInterestingBendpoint(connection, "removed.", index); //$NON-NLS-1$
+ public static void setRemovedBendpoint(Connection connection, Point p) {
+ AbstractConnectionRouter.setRoutingInfo(connection, "removed."+ROUTING_INFO_BENDPOINT, p.getX() + "." + p.getY());
}
/**
@@ -304,6 +742,10 @@
setInterestingBendpoint(connection, "fixed."+index+".", index); //$NON-NLS-1$ //$NON-NLS-2$
}
+ public static void setOldBendpointLocation(Connection connection, Point p) {
+ AbstractConnectionRouter.setRoutingInfo(connection, "oldloc."+ROUTING_INFO_BENDPOINT, p.getX() + "." + p.getY());
+ }
+
/**
* Sets the interesting bendpoint.
*
@@ -353,7 +795,14 @@
* @return the removed bendpoint
*/
public static Point getRemovedBendpoint(Connection connection) {
- return getInterestingBendpoint(connection, "removed."); //$NON-NLS-1$
+ String value = AbstractConnectionRouter.getRoutingInfo(connection, "removed."+ROUTING_INFO_BENDPOINT);
+ if (value!=null && !value.isEmpty()) {
+ String b[] = value.split("\\.");
+ int x = Integer.parseInt(b[0]);
+ int y = Integer.parseInt(b[1]);
+ return GraphicsUtil.createPoint(x, y);
+ }
+ return null;
}
/**
@@ -366,7 +815,18 @@
public static Point getFixedBendpoint(Connection connection, int index) {
return getInterestingBendpoint(connection, "fixed."+index+"."); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
+ public static Point getOldBendpointLocation(Connection connection) {
+ String value = AbstractConnectionRouter.getRoutingInfo(connection, "oldloc."+ROUTING_INFO_BENDPOINT);
+ if (value!=null && !value.isEmpty()) {
+ String b[] = value.split("\\.");
+ int x = Integer.parseInt(b[0]);
+ int y = Integer.parseInt(b[1]);
+ return GraphicsUtil.createPoint(x, y);
+ }
+ return null;
+ }
+
/**
* Gets the interesting bendpoint.
*
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ConnectionRoute.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ConnectionRoute.java
index d5ec163..4e530ab 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ConnectionRoute.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ConnectionRoute.java
@@ -21,613 +21,673 @@
import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
import org.eclipse.graphiti.mm.algorithms.styles.Point;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.mm.pictograms.FixPointAnchor;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
/**
* The Class ConnectionRoute.
*/
public class ConnectionRoute implements Comparable<ConnectionRoute>, Comparator<ConnectionRoute> {
-
- /**
- * Records a collision of a line segment with a shape.
- */
- class Collision {
-
- /** The shape. */
- Shape shape;
- /** The line segment start point. */
- Point start;
- /** The line segment end point. */
- Point end;
-
- /**
- * Instantiates a new collision.
- *
- * @param shape the collision shape
- * @param start the line segment start point
- * @param end the line segment end point
- */
- public Collision(Shape shape, Point start, Point end) {
- this.shape = shape;
- this.start = start;
- this.end = end;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- Object o = BusinessObjectUtil.getFirstBaseElement(shape);
- return ModelUtil.getTextValue(o);
- }
- }
-
- /**
- * Records the crossing of a line segment with an existing connection.
- */
- class Crossing {
-
- /** The connection. */
- Connection connection;
- /** The line segment start point. */
- Point start;
- /** The line segment end point. */
- Point end;
-
- /**
- * Instantiates a new crossing.
- *
- * @param connection the crossed connection
- * @param start the line segment start point
- * @param end the line segment end point
- */
- public Crossing(Connection connection, Point start, Point end) {
- this.connection = connection;
- this.start = start;
- this.end = end;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- Object o = BusinessObjectUtil.getFirstBaseElement(connection);
- return ModelUtil.getTextValue(o);
- }
- }
-
- /** The router. */
- private DefaultConnectionRouter router;
- /** The route id. */
- private int id;
- private List<Point> points = new ArrayList<Point>();
- private List<Point> special = new ArrayList<Point>();
-
- /** The list of shape collisions. */
- private List<Collision> collisions = new ArrayList<Collision>();
-
- /** The list of connection crossings. */
- private List<Crossing> crossings = new ArrayList<Crossing>();
-
- /** The source shape of the route being calculated. */
- private Shape source;
-
- /** The Source Anchor Location for this Route */
- private AnchorSite sourceAnchorSite;
- private Point sourceAnchorLocation;
-
- /** The target shape of the route being calculated. */
- private Shape target;
- /** The Target Anchor Location for this Route */
- private AnchorSite targetAnchorSite;
- private Point targetAnchorLocation;
-
- private boolean valid = true;
- private int rank = 0;
-
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
+ /**
+ * Records a collision of a line segment with a shape.
+ */
+ class Collision {
+
+ /** The shape. */
+ Shape shape;
+ /** The line segment start point. */
+ Point start;
+ /** The line segment end point. */
+ Point end;
/**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
-
- /**
- * Instantiates a new connection route.
+ * Instantiates a new collision.
*
- * @param router the router
- * @param id the id
- * @param source the source
- * @param target the target
+ * @param shape the collision shape
+ * @param start the line segment start point
+ * @param end the line segment end point
*/
- public ConnectionRoute(DefaultConnectionRouter router, int id, Shape source, Shape target) {
- this.router = router;
- this.setId(id);
- this.source = source;
- this.target = target;
+ public Collision(Shape shape, Point start, Point end) {
+ this.shape = shape;
+ this.start = start;
+ this.end = end;
}
- /**
- * Apply.
- *
- * @param ffc the ffc
- */
- public void apply(FreeFormConnection ffc) {
- apply(ffc,null,null);
- }
-
- /**
- * Apply.
- *
- * @param ffc the ffc
- * @param sourceAnchor the source anchor
- * @param targetAnchor the target anchor
- */
- public void apply(FreeFormConnection ffc, FixPointAnchor sourceAnchor, FixPointAnchor targetAnchor) {
-
- // set connection's source and target anchors
- Point p = get(0);
- if (sourceAnchor==null) {
- sourceAnchor = AnchorUtil.createAnchor(source, p);
- ffc.setStart(sourceAnchor);
- }
- else {
- AnchorUtil.moveAnchor(sourceAnchor, p);
- if (sourceAnchorSite!=null) {
- AnchorUtil.moveAnchor(sourceAnchor, sourceAnchorLocation);
- AnchorSite.setSite(sourceAnchor, sourceAnchorSite);
- AnchorUtil.adjustAnchors(source);
- }
- }
-
- p = get(size() - 1);
- if (targetAnchor==null) {
- // NOTE: a route with only a starting point indicates that it could not be calculated.
- // In this case, make the connection a straight line from source to target.
- targetAnchor = AnchorUtil.createAnchor(target, p);
- ffc.setEnd(targetAnchor);
- }
- else {
- AnchorUtil.moveAnchor(targetAnchor, p);
- if (targetAnchorSite!=null) {
- AnchorUtil.moveAnchor(targetAnchor, targetAnchorLocation);
- AnchorSite.setSite(targetAnchor, targetAnchorSite);
- AnchorUtil.adjustAnchors(target);
- }
- }
-
- // add the bendpoints
- ffc.getBendpoints().clear();
- for (int i=1; i<this.size()-1; ++i) {
- ffc.getBendpoints().add(this.get(i));
- }
- }
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#toString()
*/
public String toString() {
- String text;
- int size = getPoints().size();
- Point p0 = size==0 ? null : getPoints().get(0);
- Point p1 = size==0 ? null : getPoints().get(size-1);
- String start = p0==null ? "null" : p0.getX()+","+p0.getY(); //$NON-NLS-1$ //$NON-NLS-2$
- String end = p1==null ? "null" : p1.getX()+","+p1.getY(); //$NON-NLS-1$ //$NON-NLS-2$
-
- text = getId()+(valid?" :" : "X:")+ //$NON-NLS-1$ //$NON-NLS-2$
- " rank="+rank+ //$NON-NLS-1$
- " length="+getLength()+ //$NON-NLS-1$
- " points="+getPoints().size() + //$NON-NLS-1$ //$NON-NLS-2$
- " source="+sourceAnchorSite+" "+start+ //$NON-NLS-1$ //$NON-NLS-2$
- " target="+targetAnchorSite+" "+end; //$NON-NLS-1$ //$NON-NLS-2$
- if (collisions.size()>0) {
- text += " collisions="; //$NON-NLS-1$
- Iterator<Collision> iter=collisions.iterator();
- while (iter.hasNext()) {
- Collision c = iter.next();
- text += "'" + c.toString() + "'"; //$NON-NLS-1$ //$NON-NLS-2$
- if (iter.hasNext())
- text += ", "; //$NON-NLS-1$
- }
+ Object o = BusinessObjectUtil.getFirstBaseElement(shape);
+ return ModelUtil.getTextValue(o);
+ }
+ }
+
+ /**
+ * Records the crossing of a line segment with an existing connection.
+ */
+ class Crossing {
+
+ /** The connection. */
+ Connection connection;
+ /** The line segment start point. */
+ Point start;
+ /** The line segment end point. */
+ Point end;
+
+ /**
+ * Instantiates a new crossing.
+ *
+ * @param connection the crossed connection
+ * @param start the line segment start point
+ * @param end the line segment end point
+ */
+ public Crossing(Connection connection, Point start, Point end) {
+ this.connection = connection;
+ this.start = start;
+ this.end = end;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ Object o = BusinessObjectUtil.getFirstBaseElement(connection);
+ return ModelUtil.getTextValue(o);
+ }
+ }
+
+ /** The router. */
+ private DefaultConnectionRouter router;
+ /** The route id. */
+ private int id;
+ private List<Point> points = new ArrayList<Point>();
+ private List<Point> special = new ArrayList<Point>();
+
+ /** The list of shape collisions. */
+ private List<Collision> collisions = new ArrayList<Collision>();
+
+ /** The list of connection crossings. */
+ private List<Crossing> crossings = new ArrayList<Crossing>();
+
+ /** The source shape of the route being calculated. */
+ private Shape source;
+
+ /** The Source Anchor Location for this Route */
+ private AnchorSite sourceAnchorSite;
+ private Point sourceAnchorLocation;
+
+ /** The target shape of the route being calculated. */
+ private Shape target;
+
+ /** The Target Anchor Location for this Route */
+ private AnchorSite targetAnchorSite;
+ private Point targetAnchorLocation;
+
+ private boolean valid = true;
+ private int rank = 0;
+
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * Instantiates a new connection route.
+ *
+ * @param router the router
+ * @param id the id
+ * @param source the source
+ * @param target the target
+ */
+ public ConnectionRoute(DefaultConnectionRouter router, int id, Shape source, Shape target) {
+ this.router = router;
+ this.setId(id);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * Apply.
+ *
+ * @param ffc the ffc
+ */
+ public void apply(FreeFormConnection ffc) {
+ apply(ffc, null, null);
+ }
+
+ /**
+ * Apply.
+ *
+ * @param ffc the ffc
+ * @param sourceAnchor the source anchor
+ * @param targetAnchor the target anchor
+ */
+ public void apply(FreeFormConnection ffc, FixPointAnchor sourceAnchor, FixPointAnchor targetAnchor) {
+
+ // set connection's source and target anchors
+ Point p = get(0);
+ if (sourceAnchor == null) {
+ sourceAnchor = AnchorUtil.createAnchor(source, p);
+ ffc.setStart(sourceAnchor);
+ } else {
+ AnchorUtil.moveAnchor(sourceAnchor, p);
+ if (sourceAnchorSite != null) {
+ AnchorUtil.moveAnchor(sourceAnchor, sourceAnchorLocation);
+ AnchorSite.setSite(sourceAnchor, sourceAnchorSite);
+ AnchorUtil.adjustAnchors(source);
}
- if (crossings.size()>0) {
- text += " crossings="; //$NON-NLS-1$
- Iterator<Crossing> iter=crossings.iterator();
- while (iter.hasNext()) {
- Crossing c = iter.next();
- text += "'" + c.toString() + "'"; //$NON-NLS-1$ //$NON-NLS-2$
- if (iter.hasNext())
- text += ", "; //$NON-NLS-1$
- }
+ }
+
+ p = get(size() - 1);
+ if (targetAnchor == null) {
+ // NOTE: a route with only a starting point indicates that it could
+ // not be calculated.
+ // In this case, make the connection a straight line from source to
+ // target.
+ targetAnchor = AnchorUtil.createAnchor(target, p);
+ ffc.setEnd(targetAnchor);
+ } else {
+ AnchorUtil.moveAnchor(targetAnchor, p);
+ if (targetAnchorSite != null) {
+ AnchorUtil.moveAnchor(targetAnchor, targetAnchorLocation);
+ AnchorSite.setSite(targetAnchor, targetAnchorSite);
+ AnchorUtil.adjustAnchors(target);
}
- return text;
}
- public void setSourceAnchor(FixPointAnchor sourceAnchor) {
- this.sourceAnchorSite = AnchorSite.getSite(sourceAnchor);
- this.sourceAnchorLocation = GraphicsUtil.createPoint(sourceAnchor);
-
+ // add the bendpoints
+ ffc.getBendpoints().clear();
+ for (int i = 1; i < this.size() - 1; ++i) {
+ ffc.getBendpoints().add(this.get(i));
}
+ }
- public void setTargetAnchor(FixPointAnchor targetAnchor) {
- this.targetAnchorSite = AnchorSite.getSite(targetAnchor);
- this.targetAnchorLocation = GraphicsUtil.createPoint(targetAnchor);
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ String text;
+ int size = getPoints().size();
+ Point p0 = size == 0 ? null : getPoints().get(0);
+ Point p1 = size == 0 ? null : getPoints().get(size - 1);
+ String start = p0 == null ? "null" : p0.getX() + "," + p0.getY(); //$NON-NLS-1$ //$NON-NLS-2$
+ String end = p1 == null ? "null" : p1.getX() + "," + p1.getY(); //$NON-NLS-1$ //$NON-NLS-2$
- public AnchorSite getSourceAnchorSite() {
- return sourceAnchorSite;
- }
-
- public AnchorSite getTargetAnchorSite() {
- return targetAnchorSite;
- }
-
- /**
- * Adds the.
- *
- * @param newPoint the new point
- * @return true, if successful
- */
- public boolean add(Point newPoint) {
- for (Point p : getPoints()) {
- if (GraphicsUtil.pointsEqual(newPoint, p)) {
- setValid(false);
- return false;
- }
+ text = String.format("%3d",getId()) + (valid ? " :" : "X:") + //$NON-NLS-1$ //$NON-NLS-2$
+ " rank=" + rank + //$NON-NLS-1$
+ " length=" + getLength() + //$NON-NLS-1$
+ " points=" + getPoints().size() + //$NON-NLS-1$ //$NON-NLS-2$
+ " source=" + sourceAnchorSite + " " + start + //$NON-NLS-1$ //$NON-NLS-2$
+ " target=" + targetAnchorSite + " " + end; //$NON-NLS-1$ //$NON-NLS-2$
+ if (collisions.size() > 0) {
+ text += " collisions="; //$NON-NLS-1$
+ Iterator<Collision> iter = collisions.iterator();
+ while (iter.hasNext()) {
+ Collision c = iter.next();
+ text += "'" + c.toString() + "'"; //$NON-NLS-1$ //$NON-NLS-2$
+ if (iter.hasNext())
+ text += ", "; //$NON-NLS-1$
}
- getPoints().add(GraphicsUtil.createPoint(newPoint));
- return true;
}
-
- public boolean contains(Point newPoint) {
- for (Point p : getPoints()) {
- if (GraphicsUtil.pointsEqual(newPoint, p)) {
- return true;
- }
+ if (crossings.size() > 0) {
+ text += " crossings="; //$NON-NLS-1$
+ Iterator<Crossing> iter = crossings.iterator();
+ while (iter.hasNext()) {
+ Crossing c = iter.next();
+ text += "'" + c.toString() + "'"; //$NON-NLS-1$ //$NON-NLS-2$
+ if (iter.hasNext())
+ text += ", "; //$NON-NLS-1$
}
- return false;
}
-
- public void addSpecial(Point p) {
- if (p!=null)
- special.add(p);
- }
-
- public boolean isSpecial(Point p) {
- return special.contains(p);
- }
-
- /**
- * Gets the.
- *
- * @param index the index
- * @return the point
- */
- public Point get(int index) {
- return getPoints().get(index);
- }
-
- /**
- * Size.
- *
- * @return the int
- */
- public int size() {
- return getPoints().size();
- }
-
- /**
- * Adds the collision.
- *
- * @param shape the shape
- * @param start the start
- * @param end the end
- */
- public void addCollision(Shape shape, Point start, Point end) {
- collisions.add( new Collision(shape, start, end) );
- }
-
- /**
- * Adds the crossing.
- *
- * @param connection the connection
- * @param start the start
- * @param end the end
- */
- public void addCrossing(Connection connection, Point start, Point end) {
- crossings.add( new Crossing(connection, start, end) );
- }
-
- /**
- * Sets the valid.
- */
- public void setValid(boolean valid) {
- this.valid = valid;
- }
-
- /**
- * Checks if is valid.
- *
- * @return true, if is valid
- */
- public boolean isValid() {
- if (valid)
- return getLength() < Integer.MAX_VALUE;
- return false;
- }
-
- /**
- * Gets the length.
- *
- * @return the length
- */
- public int getLength() {
- int length = 0;
- if (getPoints().size()>1) {
- Point p1 = getPoints().get(0);
- for (int i=1; i<getPoints().size(); ++i) {
- Point p2 = getPoints().get(i);
-// if (isHorizontal(p1,p2) || isVertical(p1,p2))
- length += (int)GraphicsUtil.getLength(p1, p2);
-// else
-// return Integer.MAX_VALUE;
- p1 = p2;
- }
- }
- else {
- // this route could not be calculated
- return Integer.MAX_VALUE;
- }
- return length;
- }
+ return text;
+ }
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- @Override
- public int compareTo(ConnectionRoute arg0) {
- return compare(this,arg0);
- }
+ public void setSourceAnchor(FixPointAnchor sourceAnchor) {
+ this.sourceAnchorSite = AnchorSite.getSite(sourceAnchor);
+ this.sourceAnchorLocation = GraphicsUtil.createPoint(sourceAnchor);
- /* (non-Javadoc)
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- @Override
- public int compare(ConnectionRoute o1, ConnectionRoute o2) {
- int i = 0;
- int v1 = o1.isValid() ? 1 : 0;
- int v2 = o2.isValid() ? 1 : 0;
- i = v2 - v1;
- if (i==0) {
- i = o1.collisions.size() - o2.collisions.size();
- if (i==0) {
- i = o1.getRank() - o2.getRank();
- if (i==0) {
- i = o1.crossings.size() - o2.crossings.size();
- if (i==0) {
+ }
+
+ public void setTargetAnchor(FixPointAnchor targetAnchor) {
+ this.targetAnchorSite = AnchorSite.getSite(targetAnchor);
+ this.targetAnchorLocation = GraphicsUtil.createPoint(targetAnchor);
+ }
+
+ public AnchorSite getSourceAnchorSite() {
+ return sourceAnchorSite;
+ }
+
+ public AnchorSite getTargetAnchorSite() {
+ return targetAnchorSite;
+ }
+
+ /**
+ * Adds a new point to the route. If the point is already in the route, the
+ * route is marked as invalid and the new point is not added.
+ *
+ * @param newPoint the new point
+ * @return true, if successful
+ */
+ public boolean add(Point newPoint) {
+ for (Point p : getPoints()) {
+ if (GraphicsUtil.pointsEqual(newPoint, p)) {
+ setValid(false);
+ return false;
+ }
+ }
+ getPoints().add(GraphicsUtil.createPoint(newPoint));
+ return true;
+ }
+
+ public boolean addAll(List<Point> list) {
+ for (Point p : list) {
+ add(p);
+ }
+ return isValid();
+ }
+
+ public boolean contains(Point newPoint) {
+ for (Point p : getPoints()) {
+ if (GraphicsUtil.pointsEqual(newPoint, p)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void addSpecial(Point p) {
+ if (p != null)
+ special.add(p);
+ }
+
+ public boolean isSpecial(Point p) {
+ return special.contains(p);
+ }
+
+ /**
+ * Gets the point at the given index.
+ *
+ * @param index the index
+ * @return the point
+ */
+ public Point get(int index) {
+ return getPoints().get(index);
+ }
+
+ /**
+ * Returns the number of points in the route.
+ *
+ * @return the route size
+ */
+ public int size() {
+ return getPoints().size();
+ }
+
+ /**
+ * Adds collision information to the route.
+ *
+ * @param shape the shape
+ * @param start the start
+ * @param end the end
+ */
+ public void addCollision(Shape shape, Point start, Point end) {
+ if (shape != null) {
+ for (Collision c : collisions) {
+ if (c.shape == shape)
+ return;
+ }
+ collisions.add(new Collision(shape, start, end));
+ }
+ }
+
+ /**
+ * Returns a list of shapes that are intersected by the current route.
+ *
+ * @return a list of shape collisions.
+ */
+ public List<Collision> getCollisions() {
+ return collisions;
+ }
+
+ /**
+ * Adds line crossing information to the route.
+ *
+ * @param connection the connection being intersected
+ * @param start the start
+ * @param end the end
+ */
+ public void addCrossing(Connection connection, Point start, Point end) {
+ crossings.add(new Crossing(connection, start, end));
+ }
+
+ /**
+ * Returns a list of connection lines that the current route intersects.
+ *
+ * @return a list of connections
+ */
+ public List<Crossing> getCrossings() {
+ return crossings;
+ }
+
+ /**
+ * Sets a flag indicating if the route is valid.
+ */
+ public void setValid(boolean valid) {
+ this.valid = valid;
+ }
+
+ /**
+ * Checks if is valid.
+ *
+ * @return true, if is valid
+ */
+ public boolean isValid() {
+ if (valid)
+ return getLength() < Integer.MAX_VALUE;
+ return false;
+ }
+
+ /**
+ * Gets the length of the route calculated as the sum of the lengths of all
+ * line segments formed by the routing points.
+ *
+ * @return the length
+ */
+ public int getLength() {
+ int length = 0;
+ if (getPoints().size() > 1) {
+ Point p1 = getPoints().get(0);
+ for (int i = 1; i < getPoints().size(); ++i) {
+ Point p2 = getPoints().get(i);
+ // if (isHorizontal(p1,p2) || isVertical(p1,p2))
+ length += (int) GraphicsUtil.getLength(p1, p2);
+ // else
+ // return Integer.MAX_VALUE;
+ p1 = p2;
+ }
+ } else {
+ // this route could not be calculated
+ return Integer.MAX_VALUE;
+ }
+ return length;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ @Override
+ public int compareTo(ConnectionRoute arg0) {
+ return compare(this, arg0);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public int compare(ConnectionRoute o1, ConnectionRoute o2) {
+ int i = 0;
+ int v1 = o1.isValid() ? 1 : 0;
+ int v2 = o2.isValid() ? 1 : 0;
+ i = v2 - v1;
+ if (i == 0) {
+ i = o1.collisions.size() - o2.collisions.size();
+ if (i == 0) {
+ i = o1.getRank() - o2.getRank();
+ if (i == 0) {
+ i = o1.crossings.size() - o2.crossings.size();
+ if (i == 0) {
+ i = o1.getPoints().size() - o2.getPoints().size();
+ if (i == 0) {
i = o1.getLength() - o2.getLength();
- if (i==0)
- {
+ if (i == 0) {
i = o1.getPoints().size() - o2.getPoints().size();
}
}
}
-// else {
-// // pick the shorter route
-// float dl = Math.abs(o1.getLength() - o2.getLength());
-// float sl = (o1.getLength() + o2.getLength()) / 2;
-// dl = dl/sl;
-// if ( dl > 0.5)
-// return o1.getLength() - o2.getLength();
-// }
+ }
+ // else {
+ // // pick the shorter route
+ // float dl = Math.abs(o1.getLength() - o2.getLength());
+ // float sl = (o1.getLength() + o2.getLength()) / 2;
+ // dl = dl/sl;
+ // if ( dl > 0.5)
+ // return o1.getLength() - o2.getLength();
+ // }
+ }
+ } else {
+ // pick the shorter route
+ float dl = Math.abs(o1.getLength() - o2.getLength());
+ float sl = (o1.getLength() + o2.getLength()) / 2;
+ dl = dl / sl;
+ if (dl > 0.5)
+ return o1.getLength() - o2.getLength();
+ }
+ return i;
+ }
+
+ private boolean removeUnusedPoints() {
+ boolean changed = false;
+
+ Point p1 = getPoints().get(0);
+ for (int i = 1; i < getPoints().size() - 1; ++i) {
+ Point p2 = getPoints().get(i);
+ if (!isSpecial(p2) && i + 1 < getPoints().size()) {
+ boolean remove = false;
+ if (GraphicsUtil.pointsEqual(p1, p2)) {
+ remove = true;
+ } else {
+ // remove unnecessary bendpoints: two consecutive
+ // horizontal or vertical line segments
+ Point p3 = getPoints().get(i + 1);
+ int x1 = p1.getX();
+ int x2 = p2.getX();
+ int x3 = p3.getX();
+ int y1 = p1.getY();
+ int y2 = p2.getY();
+ int y3 = p3.getY();
+ if (
+ (
+ GraphicsUtil.isVertical(p1, p2) &&
+ GraphicsUtil.isVertical(p2, p3) && (
+ (y1 < y2 && y2 < y3) ||
+ (y1 > y2 && y2 > y3)
+ )
+ )
+ || (
+ GraphicsUtil.isHorizontal(p1, p2) &&
+ GraphicsUtil.isHorizontal(p2, p3) && (
+ (x1 < x2 && x2 < x3) ||
+ (x1 > x2 && x2 > x3)
+ )
+ )
+ ) {
+ if (router.getCollision(p1, p3) == null)
+ remove = true;
+ }
+ }
+ if (remove) {
+ getPoints().remove(i);
+ // look at these set of points again
+ --i;
+ changed = true;
}
}
- else {
- // pick the shorter route
- float dl = Math.abs(o1.getLength() - o2.getLength());
- float sl = (o1.getLength() + o2.getLength()) / 2;
- dl = dl/sl;
- if ( dl > 0.5)
- return o1.getLength() - o2.getLength();
+ p1 = p2;
+ }
+ return changed;
+ }
+
+ private boolean removeUnusedSegments() {
+ boolean changed = false;
+
+ // remove unnecessary "U" shapes
+ Point p1 = getPoints().get(1);
+ for (int i=2; i<getPoints().size()-2; ++i) {
+ Point p2 = getPoints().get(i);
+ if (!isSpecial(p2) && i+2 < getPoints().size()) {
+ Point p3 = getPoints().get(i+1);
+ if (!isSpecial(p3)) {
+ Point p4 = getPoints().get(i+2);
+ if (GraphicsUtil.isHorizontal(p1,p2) && GraphicsUtil.isVertical(p2,p3) && GraphicsUtil.isHorizontal(p3,p4)) {
+ Point p = GraphicsUtil.createPoint(p1.getX(), p3.getY());
+ if (router.getCollision(p1,p)==null) {
+ getPoints().set(i+1, p);
+ getPoints().remove(p2);
+ getPoints().remove(p3);
+ --i;
+ changed = true;
+ }
+
+// int x1 = p1.getX();
+// int x2 = p2.getX();
+// int x4 = p4.getX();
+// if ((x1 < x4 && x4 < x2) || (x1 > x4 && x4 > x2)) {
+// // this forms a horizontal "U" - remove if the new configuration does not cause a collision
+// Point p = GraphicsUtil.createPoint(x4, p2.getY());
+// if (router.getCollision(p,p4)==null) {
+// getPoints().set(i, p);
+// getPoints().remove(p3);
+// --i;
+// changed = true;
+// }
+// }
+ }
+ else if (GraphicsUtil.isVertical(p1,p2) && GraphicsUtil.isHorizontal(p2,p3) && GraphicsUtil.isVertical(p3,p4)) {
+ Point p = GraphicsUtil.createPoint(p3.getX(), p1.getY());
+ if (router.getCollision(p1,p)==null) {
+ getPoints().set(i+1, p);
+ getPoints().remove(p2);
+ getPoints().remove(p3);
+ --i;
+ changed = true;
+ }
+
+// int y1 = p1.getY();
+// int y2 = p2.getY();
+// int y4 = p4.getY();
+// if ((y1 < y4 && y4 < y2) || (y1 > y4 && y4 > y2)) {
+// // this forms a vertical "U"
+// p = GraphicsUtil.createPoint(p2.getX(), y4);
+// if (router.getCollision(p,p4)==null) {
+// getPoints().set(i, p);
+// getPoints().remove(p3);
+// --i;
+// changed = true;
+// }
+// }
+ }
+ }
}
- return i;
+ p1 = p2;
}
- private boolean removeUnusedPoints() {
- boolean changed = false;
-
- Point p1 = getPoints().get(0);
- for (int i=1; i<getPoints().size()-1; ++i) {
- Point p2 = getPoints().get(i);
- if (!isSpecial(p2) && i+1 < getPoints().size()) {
- boolean remove = false;
- if (GraphicsUtil.pointsEqual(p1, p2)) {
- remove = true;
+ /*
+ * Remove "T" shapes. These may be created by "overshoot" of the
+ * departure and approach route segments calculated by the Manhattan
+ * router.
+ */
+ p1 = getPoints().get(0);
+ for (int i = 1; i < getPoints().size() - 1; ++i) {
+ Point p2 = getPoints().get(i);
+ if (i + 1 < getPoints().size()) {
+ Point p3 = getPoints().get(i + 1);
+ if (p1.getX() == p2.getX() && p2.getX() == p3.getX()) {
+ if ((p2.getY() < p1.getY() && p2.getY() < p3.getY())
+ || (p2.getY() > p1.getY() && p2.getY() > p3.getY())) {
+ getPoints().remove(p2);
+ --i;
+ changed = true;
}
- else {
- // remove unnecessary bendpoints: two consecutive
- // horizontal or vertical line segments
- Point p3 = getPoints().get(i+1);
- int x1 = p1.getX();
- int x2 = p2.getX();
- int x3 = p3.getX();
- int y1 = p1.getY();
- int y2 = p2.getY();
- int y3 = p3.getY();
- if (
- (GraphicsUtil.isVertical(p1,p2) && GraphicsUtil.isVertical(p2,p3) && ((y1<y2 && y2<y3) || y1>y2 && y2>y3)) ||
- (GraphicsUtil.isHorizontal(p1,p2) && GraphicsUtil.isHorizontal(p2,p3) && ((x1<x2 && x2<x3) || x1>x2 && x2>x3))
- ) {
- remove = true;
- }
- }
- if (remove) {
- getPoints().remove(i);
- // look at these set of points again
+ } else if (p1.getY() == p2.getY() && p2.getY() == p3.getY()) {
+ if ((p2.getX() < p1.getX() && p2.getX() < p3.getX())
+ || (p2.getX() > p1.getX() && p2.getX() > p3.getX())) {
+ getPoints().remove(p2);
--i;
changed = true;
}
}
- p1 = p2;
}
- return changed;
+ p1 = p2;
}
-
- private boolean removeUnusedSegments() {
- boolean changed = false;
-
- // remove unnecessary "U" shapes
- Point p1 = getPoints().get(1);
- for (int i=2; i<getPoints().size()-2; ++i) {
- Point p2 = getPoints().get(i);
- if (!isSpecial(p2) && i+2 < getPoints().size()) {
- Point p3 = getPoints().get(i+1);
- if (!isSpecial(p3)) {
- Point p4 = getPoints().get(i+2);
- if (GraphicsUtil.isHorizontal(p1,p2) && GraphicsUtil.isVertical(p2,p3) && GraphicsUtil.isHorizontal(p3,p4)) {
- Point p = GraphicsUtil.createPoint(p1.getX(), p3.getY());
- if (router.getCollision(p1,p)==null) {
- getPoints().set(i+1, p);
- getPoints().remove(p2);
- getPoints().remove(p3);
- --i;
- changed = true;
- }
-
- // int x1 = p1.getX();
- // int x2 = p2.getX();
- // int x4 = p4.getX();
- // if ((x1 < x4 && x4 < x2) || (x1 > x4 && x4 > x2)) {
- // // this forms a horizontal "U" - remove if the new configuration does not cause a collision
- // Point p = GraphicsUtil.createPoint(x4, p2.getY());
- // if (router.getCollision(p,p4)==null) {
- // getPoints().set(i, p);
- // getPoints().remove(p3);
- // --i;
- // changed = true;
- // }
- // }
- }
- else if (GraphicsUtil.isVertical(p1,p2) && GraphicsUtil.isHorizontal(p2,p3) && GraphicsUtil.isVertical(p3,p4)) {
- Point p = GraphicsUtil.createPoint(p3.getX(), p1.getY());
- if (router.getCollision(p1,p)==null) {
- getPoints().set(i+1, p);
- getPoints().remove(p2);
- getPoints().remove(p3);
- --i;
- changed = true;
- }
-
- // int y1 = p1.getY();
- // int y2 = p2.getY();
- // int y4 = p4.getY();
- // if ((y1 < y4 && y4 < y2) || (y1 > y4 && y4 > y2)) {
- // // this forms a vertical "U"
- // p = GraphicsUtil.createPoint(p2.getX(), y4);
- // if (router.getCollision(p,p4)==null) {
- // getPoints().set(i, p);
- // getPoints().remove(p3);
- // --i;
- // changed = true;
- // }
- // }
- }
- }
- }
- p1 = p2;
- }
-
- // remove "T" shapes
- p1 = getPoints().get(0);
- for (int i=1; i<getPoints().size()-1; ++i) {
- Point p2 = getPoints().get(i);
- if (i+1 < getPoints().size()) {
- Point p3 = getPoints().get(i+1);
- if (p1.getX() == p2.getX() && p2.getX() == p3.getX()) {
- if ( (p2.getY() < p1.getY() && p2.getY() < p3.getY()) ||
- (p2.getY() > p1.getY() && p2.getY() > p3.getY())
- ) {
- getPoints().remove(p2);
- --i;
- changed = true;
- }
- }
- else if (p1.getY() == p2.getY() && p2.getY() == p3.getY()) {
- if ( (p2.getX() < p1.getX() && p2.getX() < p3.getX()) ||
- (p2.getX() > p1.getX() && p2.getX() > p3.getX())
- ) {
- getPoints().remove(p2);
- --i;
- changed = true;
- }
- }
- }
- p1 = p2;
- }
- return changed;
- }
-
- /**
- * Optimize.
- *
- * @return true, if successful
- */
- public boolean optimize() {
- boolean changed = removeUnusedPoints();
- if (removeUnusedSegments()) {
- // this may cause some unused points to be left over
- removeUnusedPoints();
- changed = true;
- }
- return changed;
- }
-
- /**
- * Gets the rank.
- *
- * @return the rank
- */
- public int getRank() {
- return rank;
- }
-
- /**
- * Sets the rank.
- *
- * @param rank the new rank
- */
- public void setRank(int rank) {
- this.rank = rank;
- }
-
- /**
- * Gets the points.
- *
- * @return the points
- */
- public List<Point> getPoints() {
- return points;
- }
-
- /**
- * Sets the points.
- *
- * @param points the new points
- */
- public void setPoints(List<Point> points) {
- this.points = points;
- }
+ return changed;
}
+
+ /**
+ * Optimize the routing points by removing unnecessary and overlapping line
+ * segments in the route.
+ *
+ * @return true, if successful
+ */
+ public boolean optimize() {
+ boolean changed = false;
+ changed = removeUnusedPoints();
+ if (removeUnusedSegments())
+ {
+ // this may cause some unused points to be left over
+ removeUnusedPoints();
+ changed = true;
+ }
+ return changed;
+ }
+
+ /**
+ * Gets the ranking of this route, used during comparison to other routes.
+ * This is an indication of the "quality" or desirability of the route when
+ * compared to other routes; the higher the rank, the less desirable is the
+ * route.
+ *
+ * @return the rank
+ */
+ public int getRank() {
+ return rank;
+ }
+
+ /**
+ * Sets the rank.
+ *
+ * @param rank the new rank
+ */
+ public void setRank(int rank) {
+ this.rank = rank;
+ }
+
+ /**
+ * Gets the points.
+ *
+ * @return the points
+ */
+ public List<Point> getPoints() {
+ return points;
+ }
+
+ /**
+ * Sets the points.
+ *
+ * @param points the new points
+ */
+ public void setPoints(List<Point> points) {
+ this.points = points;
+ }
+}
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultConnectionRouter.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultConnectionRouter.java
index 51ac9ac..ee5b51f 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultConnectionRouter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultConnectionRouter.java
@@ -18,22 +18,16 @@
import java.util.List;
import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.BoundaryEvent;
import org.eclipse.bpmn2.FlowElementsContainer;
import org.eclipse.bpmn2.Lane;
import org.eclipse.bpmn2.di.BPMNShape;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorSite;
import org.eclipse.bpmn2.modeler.core.utils.AnchorType;
import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
-import org.eclipse.bpmn2.modeler.core.utils.BoundaryEventPositionHelper;
-import org.eclipse.bpmn2.modeler.core.utils.BoundaryEventPositionHelper.PositionOnLine;
import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.datatypes.IDimension;
-import org.eclipse.graphiti.datatypes.ILocation;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.IAddConnectionContext;
import org.eclipse.graphiti.features.context.IAddContext;
@@ -68,7 +62,7 @@
protected List<ContainerShape> allShapes;
/** The connection. */
- protected Connection connection;
+ protected Connection connection = null;
/** The source. */
protected Shape source;
@@ -78,10 +72,6 @@
/** The target anchor. */
protected FixPointAnchor sourceAnchor, targetAnchor;
-
- AnchorSite sourceAnchorSites[];
-
- AnchorSite targetAnchorSites[];
/**
* Instantiates a new default connection router.
@@ -93,19 +83,6 @@
}
/* (non-Javadoc)
- * @see org.eclipse.bpmn2.modeler.core.features.AbstractConnectionRouter#route(org.eclipse.graphiti.mm.pictograms.Connection)
- */
- @Override
- public boolean route(Connection connection) {
- this.connection = connection;
- this.sourceAnchor = (FixPointAnchor) connection.getStart();
- this.targetAnchor = (FixPointAnchor) connection.getEnd();
- this.source = (Shape) AnchorUtil.getAnchorContainer(sourceAnchor);
- this.target = (Shape) AnchorUtil.getAnchorContainer(targetAnchor);
- return false;
- }
-
- /* (non-Javadoc)
* @see org.eclipse.bpmn2.modeler.core.features.IConnectionRouter#canRoute(org.eclipse.graphiti.mm.pictograms.Connection)
*/
@Override
@@ -125,13 +102,32 @@
*/
@Override
public boolean routingNeeded(Connection connection) {
+ if (this.connection==null) {
+ return true;
+ }
return false;
}
- /**
- * Initialize.
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractConnectionRouter#initialize(org.eclipse.graphiti.mm.pictograms.Connection)
*/
- protected void initialize() {
+ @Override
+ protected void initialize(Connection connection) {
+ if (this.connection!=connection) {
+ this.connection = connection;
+ this.sourceAnchor = (FixPointAnchor) connection.getStart();
+ this.targetAnchor = (FixPointAnchor) connection.getEnd();
+ this.source = (Shape) AnchorUtil.getAnchorContainer(sourceAnchor);
+ this.target = (Shape) AnchorUtil.getAnchorContainer(targetAnchor);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.features.AbstractConnectionRouter#route(org.eclipse.graphiti.mm.pictograms.Connection)
+ */
+ @Override
+ public boolean route(Connection connection) {
+ return false;
}
/* (non-Javadoc)
@@ -160,6 +156,8 @@
* @return the list
*/
protected List<ContainerShape> findAllShapes() {
+ if (allShapes!=null)
+ return allShapes;
allShapes = new ArrayList<ContainerShape>();
Diagram diagram = fp.getDiagramTypeProvider().getDiagram();
TreeIterator<EObject> iter = diagram.eAllContents();
@@ -187,7 +185,7 @@
allShapes.add(shape);
}
}
- GraphicsUtil.dump("All Shapes", allShapes); //$NON-NLS-1$
+// GraphicsUtil.dump("All Shapes", allShapes); //$NON-NLS-1$
return allShapes;
}
@@ -235,7 +233,7 @@
if (allShapes==null)
findAllShapes();
for (ContainerShape shape : allShapes) {
- if (!FeatureSupport.isGroupShape(shape) && !FeatureSupport.isLabelShape(shape) && !FeatureSupport.isParticipant(shape)) {
+ if (!FeatureSupport.isGroupShape(shape) && !FeatureSupport.isLabelShape(shape) ) {
EObject bo = BusinessObjectUtil.getBusinessObjectForPictogramElement(shape);
if (bo instanceof FlowElementsContainer) {
// it's not a collision if the shape is a SubProcess and
@@ -246,6 +244,19 @@
if (GraphicsUtil.intersectsLine(shape, p1, p2))
collisions.add(shape);
+// else {
+// int min = 2;
+// ILocation loc = this.peService.getLocationRelativeToDiagram(shape);
+// IDimension size = GraphicsUtil.calculateSize(shape);
+// if (GraphicsUtil.isVertical(p1, p2)) {
+// if (Math.abs(p1.getX() - loc.getX()) < min || Math.abs(p1.getX() - (loc.getX() + size.getWidth())) < min)
+// collisions.add(shape);
+// }
+// else if (GraphicsUtil.isHorizontal(p1, p2)) {
+// if (Math.abs(p1.getY() - loc.getY()) < min || Math.abs(p1.getY() - (loc.getY() + size.getHeight())) < min)
+// collisions.add(shape);
+// }
+// }
}
}
// if (collisions.size()>0)
@@ -355,229 +366,6 @@
}
}
}
-
- protected void calculateAllowedAnchorSites() {
-
- EObject bo = BusinessObjectUtil.getBusinessObjectForPictogramElement(source);
- if (bo instanceof BoundaryEvent) {
- sourceAnchorSites = calculateBoundaryEventAnchorSites(source);
- }
- bo = BusinessObjectUtil.getBusinessObjectForPictogramElement(target);
- if (bo instanceof BoundaryEvent) {
- targetAnchorSites = calculateBoundaryEventAnchorSites(target);
- }
- if (AnchorType.getType(source) == AnchorType.CONNECTION) {
- sourceAnchorSites = new AnchorSite[1];
- sourceAnchorSites[0] = AnchorSite.CENTER;
- }
- if (AnchorType.getType(target) == AnchorType.CONNECTION) {
- targetAnchorSites = new AnchorSite[1];
- targetAnchorSites[0] = AnchorSite.CENTER;
- }
- ILocation sPos = Graphiti.getPeService().getLocationRelativeToDiagram(source);
- IDimension sSize = GraphicsUtil.calculateSize(source);
- ILocation tPos = Graphiti.getPeService().getLocationRelativeToDiagram(target);
- IDimension tSize = GraphicsUtil.calculateSize(target);
- // find relative locations
- if (sPos.getX()+sSize.getWidth() < tPos.getX()) {
- // source shape is to left of target
- if (sPos.getY()+sSize.getHeight() < tPos.getY()) {
- // source shape is to left and above target:
- // omit the two opposite sides of both source and target
- if (sourceAnchorSites==null) {
- sourceAnchorSites = new AnchorSite[2];
- sourceAnchorSites[0] = AnchorSite.RIGHT;
- sourceAnchorSites[1] = AnchorSite.BOTTOM;
- }
- if (targetAnchorSites==null) {
- targetAnchorSites = new AnchorSite[2];
- targetAnchorSites[0] = AnchorSite.LEFT;
- targetAnchorSites[1] = AnchorSite.TOP;
- }
- }
- else if(sPos.getY() > tPos.getY()+tSize.getHeight()) {
- // source shape is to left and below target
- if (sourceAnchorSites==null) {
- sourceAnchorSites = new AnchorSite[2];
- sourceAnchorSites[0] = AnchorSite.RIGHT;
- sourceAnchorSites[1] = AnchorSite.TOP;
- }
- if (targetAnchorSites==null) {
- targetAnchorSites = new AnchorSite[2];
- targetAnchorSites[0] = AnchorSite.LEFT;
- targetAnchorSites[1] = AnchorSite.BOTTOM;
- }
- }
- else {
- if (sourceAnchorSites==null) {
- sourceAnchorSites = new AnchorSite[3];
- sourceAnchorSites[0] = AnchorSite.RIGHT;
- sourceAnchorSites[1] = AnchorSite.TOP;
- sourceAnchorSites[2] = AnchorSite.BOTTOM;
- }
- if (targetAnchorSites==null) {
- targetAnchorSites = new AnchorSite[3];
- targetAnchorSites[0] = AnchorSite.LEFT;
- targetAnchorSites[1] = AnchorSite.TOP;
- targetAnchorSites[2] = AnchorSite.BOTTOM;
- }
- }
- }
- else if (sPos.getX() > tPos.getX()+tSize.getWidth()) {
- // source shape is to right of target
- if (sPos.getY()+sSize.getHeight() < tPos.getY()) {
- // source shape is to right and above target
- if (sourceAnchorSites==null) {
- sourceAnchorSites = new AnchorSite[2];
- sourceAnchorSites[0] = AnchorSite.LEFT;
- sourceAnchorSites[1] = AnchorSite.BOTTOM;
- }
- if (targetAnchorSites==null) {
- targetAnchorSites = new AnchorSite[2];
- targetAnchorSites[0] = AnchorSite.RIGHT;
- targetAnchorSites[1] = AnchorSite.TOP;
- }
- }
- else if(sPos.getY() > tPos.getY()+tSize.getHeight()) {
- // source shape is to right and below target
- if (sourceAnchorSites==null) {
- sourceAnchorSites = new AnchorSite[2];
- sourceAnchorSites[0] = AnchorSite.LEFT;
- sourceAnchorSites[1] = AnchorSite.TOP;
- }
- if (targetAnchorSites==null) {
- targetAnchorSites = new AnchorSite[2];
- targetAnchorSites[0] = AnchorSite.RIGHT;
- targetAnchorSites[1] = AnchorSite.BOTTOM;
- }
- }
- else {
- if (sourceAnchorSites==null) {
- sourceAnchorSites = new AnchorSite[3];
- sourceAnchorSites[0] = AnchorSite.LEFT;
- sourceAnchorSites[1] = AnchorSite.TOP;
- sourceAnchorSites[2] = AnchorSite.BOTTOM;
- }
- if (targetAnchorSites==null) {
- targetAnchorSites = new AnchorSite[3];
- targetAnchorSites[0] = AnchorSite.RIGHT;
- targetAnchorSites[1] = AnchorSite.TOP;
- targetAnchorSites[2] = AnchorSite.BOTTOM;
- }
- }
- }
- else if (sPos.getY()+sSize.getHeight() < tPos.getY()) {
- // source shape is above target
- if (sourceAnchorSites==null) {
- sourceAnchorSites = new AnchorSite[3];
- sourceAnchorSites[0] = AnchorSite.LEFT;
- sourceAnchorSites[1] = AnchorSite.RIGHT;
- sourceAnchorSites[2] = AnchorSite.BOTTOM;
- }
- if (targetAnchorSites==null) {
- targetAnchorSites = new AnchorSite[3];
- targetAnchorSites[0] = AnchorSite.LEFT;
- targetAnchorSites[1] = AnchorSite.RIGHT;
- targetAnchorSites[2] = AnchorSite.TOP;
- }
- }
- else if(sPos.getY() > tPos.getY()+tSize.getHeight()) {
- // source shape is below target
- if (sourceAnchorSites==null) {
- sourceAnchorSites = new AnchorSite[3];
- sourceAnchorSites[0] = AnchorSite.LEFT;
- sourceAnchorSites[1] = AnchorSite.RIGHT;
- sourceAnchorSites[2] = AnchorSite.TOP;
- }
- if (targetAnchorSites==null) {
- targetAnchorSites = new AnchorSite[3];
- targetAnchorSites[0] = AnchorSite.LEFT;
- targetAnchorSites[1] = AnchorSite.RIGHT;
- targetAnchorSites[2] = AnchorSite.BOTTOM;
- }
- }
- else {
- // source and target overlap
- if (sourceAnchorSites==null) {
- sourceAnchorSites = new AnchorSite[4];
- sourceAnchorSites[0] = AnchorSite.LEFT;
- sourceAnchorSites[1] = AnchorSite.RIGHT;
- sourceAnchorSites[2] = AnchorSite.TOP;
- sourceAnchorSites[3] = AnchorSite.BOTTOM;
- }
- if (targetAnchorSites==null) {
- targetAnchorSites = new AnchorSite[4];
- targetAnchorSites[0] = AnchorSite.LEFT;
- targetAnchorSites[1] = AnchorSite.RIGHT;
- targetAnchorSites[2] = AnchorSite.TOP;
- targetAnchorSites[3] = AnchorSite.BOTTOM;
- }
- }
- }
-
- protected AnchorSite[] calculateBoundaryEventAnchorSites(Shape shape) {
- AnchorSite sites[];
- PositionOnLine pol = BoundaryEventPositionHelper.getPositionOnLineProperty(shape);
- switch (pol.getLocationType()) {
- case BOTTOM:
- sites = new AnchorSite[1];
- sites[0] = AnchorSite.BOTTOM;
- break;
- case BOTTOM_LEFT:
- sites = new AnchorSite[2];
- sites[0] = AnchorSite.BOTTOM;
- sites[1] = AnchorSite.LEFT;
- break;
- case BOTTOM_RIGHT:
- sites = new AnchorSite[2];
- sites[0] = AnchorSite.BOTTOM;
- sites[1] = AnchorSite.RIGHT;
- break;
- case LEFT:
- sites = new AnchorSite[1];
- sites[0] = AnchorSite.LEFT;
- break;
- case RIGHT:
- sites = new AnchorSite[1];
- sites[0] = AnchorSite.RIGHT;
- break;
- case TOP:
- sites = new AnchorSite[1];
- sites[0] = AnchorSite.TOP;
- break;
- case TOP_LEFT:
- sites = new AnchorSite[2];
- sites[0] = AnchorSite.TOP;
- sites[1] = AnchorSite.LEFT;
- break;
- case TOP_RIGHT:
- sites = new AnchorSite[2];
- sites[0] = AnchorSite.TOP;
- sites[1] = AnchorSite.RIGHT;
- break;
- default:
- sites = new AnchorSite[4];
- sites[0] = AnchorSite.TOP;
- sites[1] = AnchorSite.LEFT;
- sites[2] = AnchorSite.BOTTOM;
- sites[3] = AnchorSite.RIGHT;
- break;
- }
- return sites;
- }
-
- protected boolean shouldCalculate(AnchorSite sourceSite, AnchorSite targetSite) {
- for (int i=0; i<sourceAnchorSites.length; ++i) {
- if (sourceSite == sourceAnchorSites[i]) {
- for (int j=0; j<targetAnchorSites.length; ++j) {
- if (targetSite == targetAnchorSites[j]) {
- return true;
- }
- }
- }
- }
- return false;
- }
/**
* The Class AddRoutingConnectionFeature.
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultLayoutBPMNConnectionFeature.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultLayoutBPMNConnectionFeature.java
index b193072..5489a4b 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultLayoutBPMNConnectionFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultLayoutBPMNConnectionFeature.java
@@ -101,7 +101,8 @@
do {
repeat = false;
IConnectionRouter router = getRouter(connection);
- hasDoneChanges |= router.route(connection);
+ if (router.canRoute(connection) && router.routingNeeded(connection))
+ hasDoneChanges |= router.route(connection);
UpdateContext uc = new UpdateContext(connection);
getFeatureProvider().updateIfPossible(uc);
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultMoveBPMNShapeFeature.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultMoveBPMNShapeFeature.java
index a881554..1b6a194 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultMoveBPMNShapeFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/DefaultMoveBPMNShapeFeature.java
@@ -27,6 +27,7 @@
import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
import org.eclipse.graphiti.mm.algorithms.styles.Point;
import org.eclipse.graphiti.mm.pictograms.Anchor;
+import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
@@ -42,6 +43,7 @@
/** The shape's location before the move. */
protected ILocation preMoveLoc;
+ protected PictogramElement[] selectedShapes = null;
/**
* Instantiates a new default MoveShapeFature.
@@ -50,6 +52,7 @@
*/
public DefaultMoveBPMNShapeFeature(IFeatureProvider fp) {
super(fp);
+ selectedShapes = fp.getDiagramTypeProvider().getDiagramBehavior().getDiagramContainer().getSelectedPictogramElements();
}
/* (non-Javadoc)
@@ -120,14 +123,16 @@
Shape shape = context.getShape();
Point p = null;
+ ILocation postMoveLoc = Graphiti.getPeService().getLocationRelativeToDiagram(shape);
+ int deltaX = postMoveLoc.getX()-preMoveLoc.getX();
+ int deltaY = postMoveLoc.getY()-preMoveLoc.getY();
/*
* If the shape being moved has a Label and the Label is
* {@link org.eclipse.bpmn2.modeler.core.preferences.ShapeStyle.LabelPosition.MOVABLE}
* then adjust the Label position by the move offset.
*/
if (!FeatureSupport.isLabelShape(shape)) {
- ILocation postMoveLoc = Graphiti.getPeService().getLocationRelativeToDiagram(shape);
- p = GraphicsUtil.createPoint(postMoveLoc.getX()-preMoveLoc.getX(), postMoveLoc.getY()-preMoveLoc.getY());
+ p = GraphicsUtil.createPoint(deltaX, deltaY);
DIUtils.updateDIShape(shape);
FeatureSupport.updateLabel(getFeatureProvider(), shape, p);
}
@@ -140,7 +145,14 @@
}
}
- FeatureSupport.updateConnections(getFeatureProvider(), shape);
+ // if multiple shapes are being moved, only update the connections
+ // after all of them have been moved. This is to avoid relocating
+ // connections unnecessarily as each shape is moved.
+ if (shape==selectedShapes[ selectedShapes.length-1 ]) {
+ for (int i=0; i<selectedShapes.length; ++i) {
+ FeatureSupport.updateConnections(getFeatureProvider(), (AnchorContainer)selectedShapes[i]);
+ }
+ }
for (Connection connection : getDiagram().getConnections()) {
if (GraphicsUtil.intersects(shape, connection)) {
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ManhattanConnectionRouter.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ManhattanConnectionRouter.java
index ad6f05b..1c23813 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ManhattanConnectionRouter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/ManhattanConnectionRouter.java
@@ -16,19 +16,18 @@
import java.util.Collections;
import java.util.List;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
-import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences.BPMNDIAttributeDefault;
import org.eclipse.bpmn2.modeler.core.utils.AnchorSite;
import org.eclipse.bpmn2.modeler.core.utils.AnchorType;
import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil.LineSegment;
+import org.eclipse.graphiti.datatypes.IDimension;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.mm.algorithms.styles.Point;
+import org.eclipse.graphiti.mm.pictograms.Anchor;
import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.Shape;
/**
* A Connection Router that constrains all line segments of a connection to be either
@@ -42,20 +41,165 @@
public class ManhattanConnectionRouter extends BendpointConnectionRouter {
/** The Constant offset. */
- static final int offset = 10;
+ static final int margin = 20;
/** The test route solver. */
static boolean testRouteSolver = false;
- Orientation orientation;
/**
- * The Orientation of next line segment being calculated.
+ * The connection routing directions.
*/
- enum Orientation {
- HORIZONTAL,
- VERTICAL,
- NONE
- };
+ public enum Direction {
+ NONE, UP, DOWN, LEFT, RIGHT;
+
+ /**
+ * Determine the direction of the vector defined by the points [start,end].
+ * If the vector is diagonal, return the direction of the longest horizontal
+ * or vertical component.
+ *
+ * @param start
+ * @param end
+ * @return
+ */
+ public static Direction get(Point start, Point end) {
+ int dx = start.getX() - end.getX();
+ int dy = start.getY() - end.getY();
+ if (dy == 0) {
+ if (dx > 0)
+ return LEFT;
+ if (dx < 0)
+ return RIGHT;
+ } else if (dx == 0) {
+ if (dy > 0)
+ return UP;
+ if (dy < 0)
+ return DOWN;
+ } else if (dy > 0) {
+ if (dx > 0) {
+ if (Math.abs(dx)>Math.abs(dy))
+ return LEFT;
+ return UP;
+ }
+ if (dx < 0) {
+ if (Math.abs(dx)>Math.abs(dy))
+ return RIGHT;
+ return UP;
+ }
+ } else if (dy < 0) {
+ if (dx > 0) {
+ if (Math.abs(dx)>Math.abs(dy))
+ return LEFT;
+ return DOWN;
+
+ }
+ if (dx < 0) {
+ if (Math.abs(dx)>Math.abs(dy))
+ return RIGHT;
+ return DOWN;
+ }
+ }
+ return Direction.NONE;
+ }
+
+ /**
+ * Calculate a new direction for the vector defined by the points
+ * [start,end]. If the vector is diagonal, return the old direction
+ * value if possible. That is, if the old direction is the same as one
+ * of the horizontal or vertical components of the vector.
+ *
+ * @param oldDirection an arbitrary Direction
+ * @param start origin of the vector
+ * @param end endpoint of the vector
+ * @return a new Direction
+ */
+ public static Direction get(Direction oldDirection, Point start, Point end) {
+ int dx = start.getX() - end.getX();
+ int dy = start.getY() - end.getY();
+ if (dy == 0) {
+ if (dx > 0)
+ return LEFT;
+ if (dx < 0)
+ return RIGHT;
+ } else if (dx == 0) {
+ if (dy > 0)
+ return UP;
+ if (dy < 0)
+ return DOWN;
+ } else if (dy > 0) {
+ if (dx > 0) {
+ if (oldDirection==LEFT || oldDirection==UP)
+ return oldDirection;
+ if (Math.abs(dx)>Math.abs(dy))
+ return LEFT;
+ return UP;
+ }
+ if (dx < 0) {
+ if (oldDirection==RIGHT || oldDirection==UP)
+ return oldDirection;
+ if (Math.abs(dx)>Math.abs(dy))
+ return RIGHT;
+ return UP;
+ }
+ } else if (dy < 0) {
+ if (dx > 0) {
+ if (oldDirection==LEFT || oldDirection==DOWN)
+ return oldDirection;
+ if (Math.abs(dx)>Math.abs(dy))
+ return LEFT;
+ return DOWN;
+
+ }
+ if (dx < 0) {
+ if (oldDirection==RIGHT || oldDirection==DOWN)
+ return oldDirection;
+ if (Math.abs(dx)>Math.abs(dy))
+ return RIGHT;
+ return DOWN;
+ }
+ }
+ return Direction.NONE;
+ }
+
+ /**
+ * Translate an AnchorSite to a Direction.
+ *
+ * @param site the AnchorSite
+ * @return the Direction that corresponds to the AnchorSite
+ */
+ public static Direction get(AnchorSite site) {
+ switch (site) {
+ case TOP:
+ return UP;
+ case BOTTOM:
+ return DOWN;
+ case LEFT:
+ return LEFT;
+ case RIGHT:
+ return RIGHT;
+ }
+ return NONE;
+ }
+
+ /**
+ * Reverse the given direction by 180 degrees.
+ *
+ * @param direction the original direction
+ * @return the original direction transposed 180 degrees
+ */
+ public static Direction reverse(Direction direction) {
+ switch (direction) {
+ case DOWN:
+ return UP;
+ case UP:
+ return DOWN;
+ case RIGHT:
+ return LEFT;
+ case LEFT:
+ return RIGHT;
+ }
+ return NONE;
+ }
+ }
/**
* Instantiates a new manhattan connection router.
@@ -65,35 +209,30 @@
public ManhattanConnectionRouter(IFeatureProvider fp) {
super(fp);
}
-
- @Override
- protected void initialize() {
- super.initialize();
-
- // prefer HORIZONTAL or VERTICAL layout?
- Bpmn2Preferences preferences = Bpmn2Preferences.getInstance(ffc);
- orientation = (preferences.getIsHorizontal() == BPMNDIAttributeDefault.ALWAYS_FALSE) ?
- Orientation.VERTICAL :
- Orientation.HORIZONTAL;
- }
@Override
public boolean routingNeeded(Connection connection) {
if (connection instanceof FreeFormConnection) {
- FreeFormConnection ffc = (FreeFormConnection) connection;
-
- Point p0 = GraphicsUtil.createPoint(ffc.getStart());
- Point p1;
- for (int i=0; i<ffc.getBendpoints().size(); ++i) {
- p1 = ffc.getBendpoints().get(i);
- if (!(GraphicsUtil.isHorizontal(p0, p1) || GraphicsUtil.isVertical(p0, p1))) {
- return true;
- }
- p0 = p1;
- }
- p1 = GraphicsUtil.createPoint(ffc.getEnd());
- if (!(GraphicsUtil.isHorizontal(p0, p1) || GraphicsUtil.isVertical(p0, p1))) {
+ if (peService.getPropertyValue(connection, GraphitiConstants.INITIAL_UPDATE) != null)
return true;
+ if (forceRouting(connection))
+ return true;
+
+ initialize(connection);
+
+ int length = oldPoints.length;
+ int i = 0;
+ Point p1 = oldPoints[i++];
+ Point p2;
+ while (i<length) {
+ p2 = oldPoints[i++];
+ if (!isHorizontal(p1, p2) && !isVertical(p1, p2))
+ return true;
+ if (getCollision(p1,p2)!=null)
+ return true;
+ if (GraphicsUtil.getLength(p1, p2) < margin)
+ return true;
+ p1 = p2;
}
}
return false;
@@ -108,101 +247,243 @@
if (isSelfConnection())
return super.calculateRoute();
-GraphicsUtil.debug = false;
+ GraphicsUtil.debug = false;
boolean initialUpdate = (peService.getPropertyValue(ffc, GraphitiConstants.INITIAL_UPDATE) != null);
+ if (initialUpdate) {
+ peService.removeProperty(ffc, GraphitiConstants.INITIAL_UPDATE);
+ }
+
Point start = null;
Point end = null;
- Point middle = null;
- if (movedBendpoint!=null) {
- middle = movedBendpoint;
- }
if (testRouteSolver) {
RouteSolver solver = new RouteSolver(fp, allShapes);
boolean b = solver.solve(source, target);
-// if (b) return null;
+ if (b) return null;
}
// The list of all possible routes. The shortest will be used.
List<ConnectionRoute> allRoutes = new ArrayList<ConnectionRoute>();
-
- // Calculate all possible routes: this iterates over every permutation
- // of 4 sides for both source and target shape
AnchorSite sourceSite = AnchorSite.getSite(sourceAnchor);
AnchorSite targetSite = AnchorSite.getSite(targetAnchor);
AnchorSite initialSourceSite = sourceSite;
AnchorSite initialTargetSite = targetSite;
- Point initialSourceLocation = GraphicsUtil.createPoint(sourceAnchor);
- Point initialTargetLocation = GraphicsUtil.createPoint(targetAnchor);
- for (int i=0; i<16; ++i) {
- if (shouldCalculate(sourceSite, targetSite)) {
- AnchorUtil.moveAnchor(sourceAnchor, initialSourceLocation);
- AnchorUtil.moveAnchor(targetAnchor, initialTargetLocation);
- AnchorSite.setSite(sourceAnchor, sourceSite);
- AnchorUtil.adjustAnchors(source);
- AnchorSite.setSite(targetAnchor, targetSite);
- AnchorUtil.adjustAnchors(target);
-
- ConnectionRoute route = new ConnectionRoute(this, allRoutes.size()+1, source,target);
+ Point initialSourceLocation = createPoint(sourceAnchor);
+ Point initialTargetLocation = createPoint(targetAnchor);
+ int length = oldPoints.length;
- // Introduce some hysteresis by favoring routes that do not have
- // to change the Anchor Site. Changing Anchor Sites from
- // one edge of an Activity shape to another may cause a relocation
- // of existing anchors on the Activity which may result in having
- // to recalculate the route for those connections.
-// if (sourceSite!=initialSourceSite) {
-// if (targetSite!=initialTargetSite)
-// route.setRank(1);
-// else
-// route.setRank(1);
-// }
-// else if (targetSite!=initialTargetSite) {
-// route.setRank(1);
-// }
-
- // Get the starting and ending points on the (possibly relocated)
- // source and target anchors.
- start = GraphicsUtil.createPoint(sourceAnchor);
- end = GraphicsUtil.createPoint(targetAnchor);
-
- // If either the source or target anchor is a "Pool" anchor
- // (i.e. attached to a Pool) then try to move it so it lines
- // up either vertically or horizontally with the other anchor.
- // This is only done for these conditions:
- // 1. this is an initial update, i.e. the Connection has just been created
- // 2. the Connection was manually moved
- // 3. the edge to which the Connection was attached has changed
- if (initialUpdate || middle!=null ||
- sourceSite!=initialSourceSite || targetSite!=initialTargetSite) {
- int rank = 0;
- if (AnchorType.getType(targetAnchor) == AnchorType.POOL) {
- if (middle!=null)
- AnchorUtil.moveAnchor(targetAnchor, middle);
- else
- AnchorUtil.moveAnchor(targetAnchor, sourceAnchor);
- end = GraphicsUtil.createPoint(targetAnchor);
- if (targetSite!=initialTargetSite)
- ++rank;
- }
- if (AnchorType.getType(sourceAnchor) == AnchorType.POOL) {
- if (middle!=null)
- AnchorUtil.moveAnchor(sourceAnchor, middle);
- else
- AnchorUtil.moveAnchor(sourceAnchor, targetAnchor);
- start = GraphicsUtil.createPoint(sourceAnchor);
- if (sourceSite!=initialSourceSite)
- ++rank;
- }
- route.setRank(rank);
+ if (movedBendpoint==null && length>2) {
+ // Can we fix the existing route (assuming some segments are already orthogonal)?
+ IDimension size = GraphicsUtil.calculateSize(source);
+ int width = size.getWidth() + margin;
+ int height = size.getHeight() + margin;
+ int d;
+ int dx = 0;
+ int dy = 0;
+ boolean canFix = true;
+
+ Point p = oldPoints[1];
+ if (sourceSite==AnchorSite.LEFT) {
+ d = initialSourceLocation.getX() - p.getX();
+ if (d < margin) {
+ if (d + width < margin)
+ canFix = false;
+ else
+ dx = d - margin;
}
- route.setSourceAnchor(sourceAnchor);
- route.setTargetAnchor(targetAnchor);
-
- calculateRoute(route, source,start,middle,target,end, orientation);
-
- allRoutes.add(route);
}
+ else if (sourceSite==AnchorSite.RIGHT) {
+ d = p.getX() - initialSourceLocation.getX();
+ if (d < margin) {
+ if (d + width < margin)
+ canFix = false;
+ else
+ dx = margin - d;
+ }
+ }
+ else if (sourceSite==AnchorSite.TOP) {
+ d = initialSourceLocation.getY() - p.getY();
+ if (d < margin) {
+ if (d + height < margin)
+ canFix = false;
+ else
+ dy = d - margin;
+ }
+ }
+ else if (sourceSite==AnchorSite.BOTTOM) {
+ d = p.getY() - initialSourceLocation.getY();
+ if (d < margin) {
+ if (d + height < margin)
+ canFix = false;
+ else
+ dy = margin - d;
+ }
+ }
+
+ p = oldPoints[length-2];
+ size = GraphicsUtil.calculateSize(target);
+ width = size.getWidth() + margin;
+ height = size.getHeight() + margin;
+
+ if (targetSite==AnchorSite.LEFT) {
+ d = initialTargetLocation.getX() - p.getX();
+ if (d < margin) {
+ if (d + width < margin || dx!=0)
+ canFix = false;
+ else
+ dx = d - margin;
+ }
+ }
+ else if (targetSite==AnchorSite.RIGHT) {
+ d = p.getX() - initialTargetLocation.getX();
+ if (d < margin) {
+ if (d + width < margin || dx!=0)
+ canFix = false;
+ else
+ dx = margin - d;
+ }
+ }
+ else if (targetSite==AnchorSite.TOP) {
+ d = initialTargetLocation.getY() - p.getY();
+ if (d < margin) {
+ if (d + height < margin || dy!=0)
+ canFix = false;
+ else
+ dy = d - margin;
+ }
+ }
+ else if (targetSite==AnchorSite.BOTTOM) {
+ d = p.getY() - initialTargetLocation.getY();
+ if (d < margin) {
+ if (d + height < margin || dy!=0)
+ canFix = false;
+ else
+ dy = margin - d;
+ }
+ }
+
+ if (canFix) {
+ Point p1;
+ Point p2;
+ Point p3;
+ if (dx!=0 || dy!=0) {
+ for (int i=1; i<length-1; ++i) {
+ p1 = oldPoints[i];
+ p1.setX( p1.getX() + dx );
+ p1.setY( p1.getY() + dy );
+ }
+ }
+
+ for (int loop=0; loop<2; ++loop) {
+ ConnectionRoute route = new ConnectionRoute(this, 0, source,target);
+ route.setSourceAnchor(sourceAnchor);
+ route.setTargetAnchor(targetAnchor);
+
+ int i = 0;
+ p1 = oldPoints[i++];
+ route.add(p1);
+ while (true) {
+ p2 = oldPoints[i++];
+ if (i==length)
+ break;
+ if (!isHorizontal(p1, p2) && !isVertical(p1, p2)) {
+ p3 = oldPoints[i];
+ if (isHorizontal(p2, p3)) {
+ p2.setX(p1.getX());
+ }
+ else {
+ p2.setY(p1.getY());
+ }
+ }
+ route.add(p2);
+ ContainerShape shape = getCollision(p1,p2);
+ if (shape!=null)
+ route.addCollision(shape, p1,p2);
+ p1 = p2;
+ }
+ // check the last segment just before the target shape
+ if (!isHorizontal(p1, p2) && !isVertical(p1, p2)) {
+ // since we can't change the target point (it is connected
+ // to an anchor on the shape) we have to change the
+ p3 = oldPoints[length-2];
+ if (isHorizontal(p3, p1)) {
+ p1.setX(p2.getX());
+ }
+ else {
+ p1.setY(p2.getY());
+ }
+ }
+ else {
+ route.addCollision(getCollision(p1,p2), p1,p2);
+ if (route.getCollisions().size()==0) {
+ route.add(p2);
+ allRoutes.add(route);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Calculate all possible routes: this iterates over every permutation
+ // of 4 sides for both source and target shape
+ for (int i=0; i<16; ++i) {
+ int rank = 1;
+ if (!shouldCalculate(sourceSite, targetSite)) {
+ ++rank;
+ }
+ AnchorUtil.moveAnchor(sourceAnchor, initialSourceLocation);
+ AnchorUtil.moveAnchor(targetAnchor, initialTargetLocation);
+ AnchorSite.setSite(sourceAnchor, sourceSite);
+ AnchorUtil.adjustAnchors(source);
+ AnchorSite.setSite(targetAnchor, targetSite);
+ AnchorUtil.adjustAnchors(target);
+
+ ConnectionRoute route = new ConnectionRoute(this, allRoutes.size()+1, source,target);
+
+ // Get the starting and ending points on the (possibly relocated)
+ // source and target anchors.
+ start = createPoint(sourceAnchor);
+ end = createPoint(targetAnchor);
+
+ // If either the source or target anchor is a "Pool" anchor
+ // (i.e. attached to a Pool) then try to move it so it lines
+ // up either vertically or horizontally with the other anchor.
+ // This is only done for these conditions:
+ // 1. this is an initial update, i.e. the Connection has just been created
+ // 2. the Connection was manually moved
+ // 3. the edge to which the Connection was attached has changed
+ if (initialUpdate || movedBendpoint!=null ||
+ sourceSite!=initialSourceSite || targetSite!=initialTargetSite) {
+ if (AnchorType.getType(targetAnchor) == AnchorType.POOL) {
+ if (movedBendpoint!=null)
+ AnchorUtil.moveAnchor(targetAnchor, movedBendpoint);
+ else
+ AnchorUtil.moveAnchor(targetAnchor, sourceAnchor);
+ end = createPoint(targetAnchor);
+ if (targetSite!=initialTargetSite)
+ ++rank;
+ }
+ if (AnchorType.getType(sourceAnchor) == AnchorType.POOL) {
+ if (movedBendpoint!=null)
+ AnchorUtil.moveAnchor(sourceAnchor, movedBendpoint);
+ else
+ AnchorUtil.moveAnchor(sourceAnchor, targetAnchor);
+ start = createPoint(sourceAnchor);
+ if (sourceSite!=initialSourceSite)
+ ++rank;
+ }
+ }
+ if ((sourceSite!=initialSourceSite || targetSite!=initialTargetSite))
+ ++rank;
+ route.setRank(rank);
+ route.setSourceAnchor(sourceAnchor);
+ route.setTargetAnchor(targetAnchor);
+
+ calculateRoute(route, sourceSite, start, targetSite, end);
+
+ allRoutes.add(route);
if ((i % 4)==0) {
sourceSite = getNextAnchorSite(sourceSite);
@@ -212,9 +493,7 @@
}
}
-// System.out.println("# Routes="+allRoutes.size());
-
- // pick the shortest route
+ // pick the "best" route
ConnectionRoute route = null;
if (allRoutes.size()==1) {
route = allRoutes.get(0);
@@ -232,9 +511,9 @@
// we don't actually try to correct a route crossing a connection.
for (ConnectionRoute r : allRoutes) {
if (r.getPoints().size()>1) {
- Point p1 = r.getPoints().get(0);
+ Point p1 = r.get(0);
for (int i=1; i<r.getPoints().size(); ++i) {
- Point p2 = r.getPoints().get(i);
+ Point p2 = r.get(i);
List<Connection> crossings = findCrossings(connection, p1, p2);
for (Connection c : crossings) {
if (c!=this.connection)
@@ -269,61 +548,40 @@
* @param allRoutes the all routes
* @param source the source
* @param start the start
- * @param middle the middle
* @param target the target
* @param end the end
- * @param orientation the orientation
* @return the connection route
*/
- protected ConnectionRoute calculateRoute(ConnectionRoute route, Shape source, Point start, Point middle, Shape target, Point end, Orientation orientation) {
+ ConnectionRoute calculateRoute(ConnectionRoute route, AnchorSite sourceSite, Point start, AnchorSite targetSite, Point end) {
- if (middle!=null) {
- List<Point> departure = calculateDeparture(source, start, middle);
- List<Point> approach = calculateApproach(middle, target, end);
+ if (movedBendpoint!=null) {
+ List<Point> departure = calculateDeparture(sourceSite, start, movedBendpoint);
+ List<Point> approach = calculateApproach(targetSite, movedBendpoint, end);
route.getPoints().addAll(departure);
- if (calculateEnroute(route, departure.get(departure.size()-1), middle, orientation)) {
- route.getPoints().add(middle);
- if (calculateEnroute(route, middle,approach.get(0),orientation)) {
+ if (calculateEnroute(route, departure.get(departure.size()-1), movedBendpoint)) {
+ route.add(movedBendpoint);
+ if (calculateEnroute(route, movedBendpoint,approach.get(0))) {
route.getPoints().addAll(approach);
}
else
- route.getPoints().add(end);
+ route.add(end);
}
else
- route.getPoints().add(end);
+ route.add(end);
}
else {
- List<Point> departure = calculateDeparture(source, start, end);
- List<Point> approach = calculateApproach(start, target, end);
- if (departure.size()==2 && approach.size()==2 &&
- GraphicsUtil.pointsEqual(departure.get(1), approach.get(0))) {
- route.getPoints().add(start);
- route.getPoints().add(end);
- }
- else {
- route.getPoints().addAll(departure);
- calculateEnroute(route, departure.get(departure.size()-1), approach.get(0), orientation);
- route.getPoints().addAll(approach);
- }
+ List<Point> departure = calculateDeparture(sourceSite, start, end);
+ List<Point> approach = calculateApproach(targetSite, start, end);
+ route.getPoints().addAll(departure);
+ start = departure.get(departure.size()-1);
+ end = approach.get(0);
+ calculateEnroute(route, start, end);
+ route.getPoints().addAll(approach);
}
return route;
}
-
- private Point getVertMidpoint(Point start, Point end, double fract) {
- Point m = GraphicsUtil.createPoint(start);
- int d = (int)(fract * (double)(end.getY() - start.getY()));
- m.setY(start.getY()+d);
- return m;
- }
-
- private Point getHorzMidpoint(Point start, Point end, double fract) {
- Point m = GraphicsUtil.createPoint(start);
- int d = (int)(fract * (double)(end.getX() - start.getX()));
- m.setX(start.getX()+d);
- return m;
- }
/**
* Calculate departure.
@@ -333,27 +591,28 @@
* @param end the end
* @return the list
*/
- protected List<Point> calculateDeparture(Shape source, Point start, Point end) {
- AnchorSite sourceEdge = AnchorSite.getNearestEdge(source, start, end);
+ List<Point> calculateDeparture(AnchorSite sourceSite, Point start, Point end) {
List<Point> points = new ArrayList<Point>();
- Point p = GraphicsUtil.createPoint(start);
- Point m = end;
+ Point p = createPoint(start);
+ Point m = createPoint(end);
ContainerShape shape;
- switch (sourceEdge) {
+ switch (sourceSite) {
case TOP:
case BOTTOM:
+ m.setX(start.getX());
for (;;) {
- m = getVertMidpoint(start,m,0.45);
+ m = getVertMidpoint(start,m,0.5);
+ adjustPoint(sourceSite, m, start);
shape = getCollision(start,m);
- if (shape==null || Math.abs(m.getY()-start.getY())<=offset) {
+ if (shape==null || Math.abs(m.getY()-start.getY())<=margin) {
if (shape!=null) {
// still collision?
- if (sourceEdge==AnchorSite.BOTTOM)
- m.setY(start.getY() + offset);
+ if (sourceSite==AnchorSite.BOTTOM)
+ m.setY(start.getY() + margin);
else
- m.setY(start.getY() - offset);
+ m.setY(start.getY() - margin);
}
break;
}
@@ -362,16 +621,18 @@
break;
case LEFT:
case RIGHT:
+ m.setY(start.getY());
for (;;) {
- m = getHorzMidpoint(start,m,0.45);
+ m = getHorzMidpoint(start,m,0.5);
+ adjustPoint(sourceSite, m, start);
shape = getCollision(start,m);
- if (shape==null || Math.abs(m.getX()-start.getX())<=offset) {
+ if (shape==null || Math.abs(m.getX()-start.getX())<=margin) {
if (shape!=null) {
// still collision?
- if (sourceEdge==AnchorSite.RIGHT)
- m.setX(start.getX() + offset);
+ if (sourceSite==AnchorSite.RIGHT)
+ m.setX(start.getX() + margin);
else
- m.setX(start.getX() - offset);
+ m.setX(start.getX() - margin);
}
break;
}
@@ -390,32 +651,33 @@
/**
* Calculate approach.
- *
* @param start the start
- * @param target the target
* @param end the end
+ * @param target the target
+ *
* @return the list
*/
- protected List<Point> calculateApproach(Point start, Shape target, Point end) {
- AnchorSite targetSite = AnchorSite.getNearestEdge(target, start, end);
+ List<Point> calculateApproach(AnchorSite targetSite, Point start, Point end) {
List<Point> points = new ArrayList<Point>();
- Point p = GraphicsUtil.createPoint(end);
- Point m = start;
+ Point p = createPoint(end);
+ Point m = createPoint(start);
switch (targetSite) {
case TOP:
case BOTTOM:
+ m.setX(end.getX());
for (;;) {
- m = getVertMidpoint(m,end,0.45);
+ m = getVertMidpoint(m,end,0.5);
+ adjustPoint(m, end, targetSite);
ContainerShape shape = getCollision(m,end);
- if (shape==null || shape==target || Math.abs(m.getY()-end.getY())<=offset) {
+ if (shape==null || Math.abs(m.getY()-end.getY())<=margin) {
if (shape!=null) {
// still collision?
if (targetSite==AnchorSite.BOTTOM)
- m.setY(end.getY() + offset);
+ m.setY(end.getY() + margin);
else
- m.setY(end.getY() - offset);
+ m.setY(end.getY() - margin);
}
break;
}
@@ -424,16 +686,18 @@
break;
case LEFT:
case RIGHT:
+ m.setY(end.getY());
for (;;) {
- m = getHorzMidpoint(m,end,0.45);
+ m = getHorzMidpoint(m,end,0.5);
+ adjustPoint(m, end, targetSite);
ContainerShape shape = getCollision(m,end);
- if (shape==null || shape==target || Math.abs(m.getX()-end.getX())<=offset) {
+ if (shape==null || Math.abs(m.getX()-end.getX())<=margin) {
if (shape!=null) {
// still collision?
if (targetSite==AnchorSite.RIGHT)
- m.setX(end.getX() + offset);
+ m.setX(end.getX() + margin);
else
- m.setX(end.getX() - offset);
+ m.setX(end.getX() - margin);
}
break;
}
@@ -450,9 +714,170 @@
return points;
}
+
+ /**
+ * Calculate enroute.
+ *
+ * @param route the route
+ * @param start the start
+ * @param end the end
+ * @return true, if successful
+ */
+ boolean calculateEnroute(ConnectionRoute route, Point start, Point end) {
+ if (GraphicsUtil.pointsEqual(start, end))
+ return false;
+
+ // special case: if start and end can be connected with a horizontal or vertical line
+ // check if there's a collision in the way. If so, we need to navigate around it.
+ if (!GraphicsUtil.isSlanted(start,end) && getCollision(start,end)==null) {
+ return true;
+ }
+
+ Point nextPoint = createPoint(end);
+ Point p0 = route.get(route.size()-2);
+ Point p1 = route.get(route.size()-1);
+ Direction oldDirection = Direction.get(p0,p1);
+ Direction newDirection = Direction.get(oldDirection, start,end);
+
+ switch (newDirection) {
+ case UP:
+ nextPoint = createPoint(start.getX(), end.getY());
+ if (!calculateDetour(route, newDirection, start, nextPoint, end))
+ route.add(nextPoint);
+ break;
+ case DOWN:
+ nextPoint = createPoint(start.getX(), end.getY());
+ if (!calculateDetour(route, newDirection, start, nextPoint, end))
+ route.add(nextPoint);
+ break;
+ case LEFT:
+ nextPoint = createPoint(end.getX(), start.getY());
+ if (!calculateDetour(route, newDirection, start, nextPoint, end))
+ route.add(nextPoint);
+ break;
+ case RIGHT:
+ nextPoint = createPoint(end.getX(), start.getY());
+ if (!calculateDetour(route, newDirection, start, nextPoint, end))
+ route.add(nextPoint);
+ break;
+ }
+
+ if (route.isValid()){
+ nextPoint = route.get(route.size()-1);
+ if (!calculateEnroute(route,nextPoint,end))
+ return false;
+ }
+
+ return route.isValid();
+ }
+
+ boolean calculateDetour(ConnectionRoute route, Direction direction, Point start, Point nextPoint, Point end) {
+
+ ContainerShape shape = getCollision(start,nextPoint);
+ if (shape!=null) {
+ int d0, d1;
+ DetourPoints detour = getDetourPoints(shape);
+
+ switch (direction) {
+ case UP:
+ // approach from bottom of shape: go left or right?
+ d0 = Math.abs(nextPoint.getX()-detour.bottomLeft.getX());
+ d1 = Math.abs(nextPoint.getX()-detour.bottomRight.getX());
+ if (d0 < d1) {
+ // go left
+ nextPoint.setY( detour.bottomLeft.getY() );
+ route.add(nextPoint);
+ route.add(detour.bottomLeft);
+// route.add(detour.topLeft);
+ }
+ else {
+ // go right
+ nextPoint.setY( detour.bottomRight.getY() );
+ route.add(nextPoint);
+ route.add(detour.bottomRight);
+// route.add(detour.topRight);
+ }
+ break;
+ case DOWN:
+ // approach from top of shape: go left or right?
+ d0 = Math.abs(nextPoint.getX()-detour.topLeft.getX());
+ d1 = Math.abs(nextPoint.getX()-detour.topRight.getX());
+ if (d0 < d1) {
+ // go left
+ nextPoint.setY( detour.topLeft.getY() );
+ route.add(nextPoint);
+ route.add(detour.topLeft);
+// route.add(detour.bottomLeft);
+ }
+ else {
+ // go right
+ nextPoint.setY( detour.topRight.getY() );
+ route.add(nextPoint);
+ route.add(detour.topRight);
+// route.add(detour.bottomRight);
+ }
+ break;
+ case LEFT:
+ // approach from right of shape: go up or down?
+ d0 = Math.abs(nextPoint.getY()-detour.topRight.getY());
+ d1 = Math.abs(nextPoint.getY()-detour.bottomRight.getY());
+ if (d0 < d1) {
+ // go up
+ nextPoint.setX( detour.topRight.getX() );
+ route.add(nextPoint);
+ route.add(detour.topRight);
+// route.add(detour.topLeft);
+ }
+ else {
+ // go down
+ nextPoint.setX( detour.bottomRight.getX() );
+ route.add(nextPoint);
+ route.add(detour.bottomRight);
+// route.add(detour.bottomLeft);
+ }
+ break;
+ case RIGHT:
+ // approach from left of shape: go up or down?
+ d0 = Math.abs(nextPoint.getY()-detour.topLeft.getY());
+ d1 = Math.abs(nextPoint.getY()-detour.bottomLeft.getY());
+ if (d0 < d1) {
+ // go up
+ nextPoint.setX( detour.topLeft.getX() );
+ route.add(nextPoint);
+ route.add(detour.topLeft);
+// route.add(detour.topRight);
+ }
+ else {
+ // go down
+ nextPoint.setX( detour.bottomLeft.getX() );
+ route.add(nextPoint);
+ route.add(detour.bottomLeft);
+// route.add(detour.bottomRight);
+ }
+ break;
+ default:
+ return false;
+ }
+ }
+ return shape!=null;
+ }
+
+ Point getVertMidpoint(Point start, Point end, double fract) {
+ Point m = createPoint(start);
+ int d = (int)(fract * (double)(end.getY() - start.getY()));
+ m.setY(start.getY()+d);
+ return m;
+ }
+
+ Point getHorzMidpoint(Point start, Point end, double fract) {
+ Point m = createPoint(start);
+ int d = (int)(fract * (double)(end.getX() - start.getX()));
+ m.setX(start.getX()+d);
+ return m;
+ }
/**
- * Creates the point.
+ * Convenience method to create a point given x,y coordinates.
*
* @param x the x
* @param y the y
@@ -462,164 +887,32 @@
return GraphicsUtil.createPoint(x, y);
}
- /**
- * Calculate enroute.
- *
- * @param route the route
- * @param start the start
- * @param end the end
- * @param orientation the orientation
- * @return true, if successful
- */
- protected boolean calculateEnroute(ConnectionRoute route, Point start, Point end, Orientation orientation) {
- if (GraphicsUtil.pointsEqual(start, end))
- return false;
-
- Point p;
-
- // special case: if start and end can be connected with a horizontal or vertical line
- // check if there's a collision in the way. If so, we need to navigate around it.
- if (!GraphicsUtil.isSlanted(start,end)) {
- ContainerShape shape = getCollision(start,end);
- if (shape==null) {
- return true;
- }
- }
-
-// Point horzPoint = createPoint(end.getX(), start.getY());
-// ContainerShape horzCollision = getCollision(start,horzPoint);
-// Point vertPoint = createPoint(start.getX(), end.getY());
-// ContainerShape vertCollision = getCollision(start,vertPoint);
- int dx = Math.abs(end.getX() - start.getX());
- int dy = Math.abs(end.getY() - start.getY());
- if (orientation==Orientation.NONE) {
- if (dx>dy) {
- orientation = Orientation.HORIZONTAL;
-// if (horzCollision!=null && vertCollision==null)
-// orientation = Orientation.VERTICAL;
- }
- else {
- orientation = Orientation.VERTICAL;
-// if (vertCollision!=null && horzCollision==null)
-// orientation = Orientation.HORIZONTAL;
- }
- }
-
- if (orientation == Orientation.HORIZONTAL) {
- p = createPoint(end.getX(), start.getY());
- ContainerShape shape = getCollision(start,p);
- if (shape!=null) {
-// route.addCollision(shape, start, p);
- DetourPoints detour = getDetourPoints(shape);
- // this should be a vertical segment - navigate around the shape
- // go up or down from here?
- boolean detourUp = end.getY() - start.getY() < 0;
-// int dyTop = Math.abs(p.getY() - detour.topLeft.getY());
-// int dyBottom = Math.abs(p.getY() - detour.bottomLeft.getY());
-// if (dy<dyTop || dy<dyBottom)
-// detourUp = dyTop < dyBottom;
-
- if (p.getX() > start.getX()) {
- p.setX( detour.topLeft.getX() );
- route.add(p);
- if (detourUp) {
- route.add(detour.topLeft);
- route.add(detour.topRight);
- }
- else {
- route.add(detour.bottomLeft);
- route.add(detour.bottomRight);
- }
-// p = createPoint(detour.topRight.getX(), p.getY());
-// route.add(p);
- }
- else {
- p.setX( detour.topRight.getX() );
- route.add(p);
- if (detourUp) {
- route.add(detour.topRight);
- route.add(detour.topLeft);
- }
- else {
- route.add(detour.bottomRight);
- route.add(detour.bottomLeft);
- }
-// p = createPoint(detour.topLeft.getX(), p.getY());
-// route.add(p);
- }
- p = route.get(route.size()-1);
- }
- else
- route.add(p);
- }
- else {
- p = createPoint(start.getX(), end.getY());
- ContainerShape shape = getCollision(start,p);
- if (shape!=null) {
-// route.addCollision(shape, start, p);
- DetourPoints detour = getDetourPoints(shape);
- // this should be a horizontal segment - navigate around the shape
- // go left or right from here?
- boolean detourLeft = end.getX() - start.getX() < 0;
-// int dxLeft = Math.abs(p.getX() - detour.topLeft.getX());
-// int dxRight = Math.abs(p.getX() - detour.topRight.getX());
-// if (dx<dxLeft || dx<dxRight)
-// detourLeft = dxLeft < dxRight;
-
- if (p.getY() > start.getY()) {
- p.setY( detour.topLeft.getY() );
- route.add(p);
- if (detourLeft) {
- // go around to the left
- route.add(detour.topLeft);
- route.add(detour.bottomLeft);
- }
- else {
- // go around to the right
- route.add(detour.topRight);
- route.add(detour.bottomRight);
- }
-// p = createPoint(p.getX(), detour.bottomLeft.getY());
-// route.add(p);
- }
- else {
- p.setY( detour.bottomLeft.getY() );
- route.add(p);
- if (detourLeft) {
- route.add(detour.bottomLeft);
- route.add(detour.topLeft);
- }
- else {
- route.add(detour.bottomRight);
- route.add(detour.topRight);
- }
-// p = createPoint(p.getX(), detour.topLeft.getY());
-// route.add(p);
- }
- p = route.get(route.size()-1);
- }
- else
- route.add(p);
- }
-
- if (route.isValid()){
- if (!calculateEnroute(route,p,end,orientation))
- return false;
- }
-
- return route.isValid();
+ Point createPoint(Point p) {
+ return GraphicsUtil.createPoint(p);
}
- protected DetourPoints getDetourPoints(ContainerShape shape) {
- DetourPoints detour = new DetourPoints(shape, offset);
+ Point createPoint(Anchor a) {
+ return GraphicsUtil.createPoint(a);
+ }
+
+ boolean isHorizontal(Point p1, Point p2) {
+ return GraphicsUtil.isHorizontal(p1, p2);
+ }
+
+ boolean isVertical(Point p1, Point p2) {
+ return GraphicsUtil.isVertical(p1, p2);
+ }
+
+ DetourPoints getDetourPoints(ContainerShape shape) {
+ DetourPoints detour = new DetourPoints(shape, margin);
if (allShapes==null)
findAllShapes();
for (int i=0; i<allShapes.size(); ++i) {
ContainerShape s = allShapes.get(i);
- if (shape==s)
+ if (shape==s || shape==source || shape==target)
continue;
- DetourPoints d = new DetourPoints(s, offset);
+ DetourPoints d = new DetourPoints(s, margin);
if (detour.intersects(d) && !detour.contains(d)) {
detour.merge(d);
i = -1;
@@ -628,69 +921,128 @@
return detour;
}
+
+ boolean adjustPoint(AnchorSite site, Point p1, Point p2) {
+ return adjustPoint(Direction.get(site), p1, p2);
+ }
+
+ boolean adjustPoint(Point p1, Point p2, AnchorSite site) {
+ return adjustPoint(Direction.reverse(Direction.get(site)), p1, p2);
+ }
- protected void optimize(ConnectionRoute route) {
+ boolean adjustPoint(Direction direction, Point p1, Point p2) {
+
+ switch (Direction.get(p1,p2)) {
+ case UP:
+ if (p1.getY() - p2.getY() < margin) {
+ p1.setY( p2.getY() - margin );
+ return true;
+ }
+ break;
+ case DOWN:
+ if (p2.getY() - p1.getY() < margin) {
+ p1.setY( p2.getY() - margin );
+ return true;
+ }
+ break;
+ case LEFT:
+ if (p1.getX() - p2.getX() < margin) {
+ p1.setX( p2.getX() - margin );
+ return true;
+ }
+ break;
+ case RIGHT:
+ if (p2.getX() - p1.getX() < margin) {
+ p1.setX( p2.getX() + margin );
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
+ void optimize(ConnectionRoute route) {
route.addSpecial(movedBendpoint);
+ Point p1;
+ Point p2;
+
+ /*
+ * Adjust differences of 1 pixel between two consecutive points
+ * to account for round-off errors.
+ */
+ p1 = route.get(0);
+ for (int i = 1; i < route.size(); ++i) {
+ p2 = route.get(i);
+ if (Math.abs(p1.getX() - p2.getX()) <= 1)
+ p2.setX(p1.getX());
+ if (Math.abs(p1.getY() - p2.getY()) <= 1)
+ p2.setY(p1.getY());
+ if (GraphicsUtil.isSlanted(p1, p2))
+ route.setRank(5);
+ p1 = p2;
+ }
+
+ // remove unnecessary line segments
route.optimize();
- int size = route.getPoints().size();
+ int size = route.size();
if (size>1) {
// Discourage routes containing starting or ending segments that touch
// the source or target shape - it just looks ugly.
LineSegment sourceEdges[] = GraphicsUtil.getEdges(source);
- Point p0 = route.getPoints().get(0);
- Point p1 = route.getPoints().get(1);
+ p1 = route.get(0);
+ p2 = route.get(1);
AnchorSite sourceSite = route.getSourceAnchorSite();
if (sourceSite==AnchorSite.LEFT || sourceSite==AnchorSite.RIGHT) {
int x = sourceEdges[sourceSite.ordinal()].getStart().getX();
- if (GraphicsUtil.isVertical(p0, p1) && p0.getX()==x)
- route.setRank(3);
+ if (isVertical(p1, p2) && p1.getX()==x)
+ route.setRank(4);
}
else if (sourceSite==AnchorSite.TOP || sourceSite==AnchorSite.BOTTOM) {
int y = sourceEdges[sourceSite.ordinal()].getStart().getY();
- if (GraphicsUtil.isHorizontal(p0, p1) && p0.getY()==y)
- route.setRank(3);
+ if (isHorizontal(p1, p2) && p1.getY()==y)
+ route.setRank(4);
}
if (size>2) {
- if (GraphicsUtil.getLength(p0, p1) < offset) {
- p0 = route.getPoints().get(1);
- p1 = route.getPoints().get(2);
+ if (GraphicsUtil.getLength(p1, p2) < margin) {
+ p1 = route.get(1);
+ p2 = route.get(2);
if (sourceSite==AnchorSite.LEFT || sourceSite==AnchorSite.RIGHT) {
- if (GraphicsUtil.isVertical(p0, p1))
- route.setRank(3);
+ if (isVertical(p1, p2))
+ route.setRank(4);
}
else if (sourceSite==AnchorSite.TOP || sourceSite==AnchorSite.BOTTOM) {
- if (GraphicsUtil.isHorizontal(p0, p1))
- route.setRank(3);
+ if (isHorizontal(p1, p2))
+ route.setRank(4);
}
}
// Same as above, but for the target shape
LineSegment targetEdges[] = GraphicsUtil.getEdges(target);
- p0 = route.getPoints().get(size-2);
- p1 = route.getPoints().get(size-1);
+ p1 = route.get(size-2);
+ p2 = route.get(size-1);
AnchorSite targetSite = route.getTargetAnchorSite();
if (targetSite==AnchorSite.LEFT || targetSite==AnchorSite.RIGHT) {
int x = targetEdges[targetSite.ordinal()].getStart().getX();
- if (GraphicsUtil.isVertical(p0, p1) && p0.getX()==x)
- route.setRank(3);
+ if (isVertical(p1, p2) && p1.getX()==x)
+ route.setRank(4);
}
else if (targetSite==AnchorSite.TOP || targetSite==AnchorSite.BOTTOM) {
int y = targetEdges[targetSite.ordinal()].getStart().getY();
- if (GraphicsUtil.isHorizontal(p0, p1) && p0.getY()==y)
- route.setRank(3);
+ if (isHorizontal(p1, p2) && p1.getY()==y)
+ route.setRank(4);
}
- if (GraphicsUtil.getLength(p0, p1) < offset) {
- p0 = route.getPoints().get(size-3);
- p1 = route.getPoints().get(size-2);
+ if (GraphicsUtil.getLength(p1, p2) < margin) {
+ p1 = route.get(size-3);
+ p2 = route.get(size-2);
if (targetSite==AnchorSite.LEFT || targetSite==AnchorSite.RIGHT) {
- if (GraphicsUtil.isVertical(p0, p1))
- route.setRank(3);
+ if (isVertical(p1, p2))
+ route.setRank(4);
}
else if (targetSite==AnchorSite.TOP || targetSite==AnchorSite.BOTTOM) {
- if (GraphicsUtil.isHorizontal(p0, p1))
- route.setRank(3);
+ if (isHorizontal(p1, p2))
+ route.setRank(4);
}
}
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/AddBendpointFeature.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/AddBendpointFeature.java
index 886cb94..7e2cce8 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/AddBendpointFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/AddBendpointFeature.java
@@ -20,10 +20,12 @@
import org.eclipse.bpmn2.modeler.core.features.BendpointConnectionRouter;
import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
+import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
import org.eclipse.dd.dc.DcFactory;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.IAddBendpointContext;
import org.eclipse.graphiti.features.impl.DefaultAddBendpointFeature;
+import org.eclipse.graphiti.mm.algorithms.styles.Point;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
public class AddBendpointFeature extends DefaultAddBendpointFeature {
@@ -48,21 +50,33 @@
@Override
public void addBendpoint(IAddBendpointContext context) {
+ FreeFormConnection connection = context.getConnection();
+ int index = context.getBendpointIndex();
+ Point bp1;
+ if (index<=0)
+ bp1 = GraphicsUtil.createPoint(connection.getStart());
+ else
+ bp1 = connection.getBendpoints().get(index-1);
+ Point bp2;
+ if (index>=connection.getBendpoints().size())
+ bp2 = GraphicsUtil.createPoint(connection.getEnd());
+ else
+ bp2 = connection.getBendpoints().get(index);
+ Point m = GraphicsUtil.getMidpoint(bp1, bp2);
+ BendpointConnectionRouter.setOldBendpointLocation(connection, m);
+
super.addBendpoint(context);
+
try {
-
- FreeFormConnection connection = context.getConnection();
BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
-
org.eclipse.dd.dc.Point p = DcFactory.eINSTANCE.createPoint();
p.setX(context.getX());
p.setY(context.getY());
BPMNDiagram bpmnDiagram = DIUtils.findBPMNDiagram(connection);
BPMNEdge edge = DIUtils.findBPMNEdge(bpmnDiagram, element);
- int index = context.getBendpointIndex() + 1;
- edge.getWaypoint().add(index, p);
- BendpointConnectionRouter.setAddedBendpoint(connection, context.getBendpointIndex());
+ edge.getWaypoint().add(index+1, p);
+ BendpointConnectionRouter.setAddedBendpoint(connection, index);
FeatureSupport.updateConnection(getFeatureProvider(), connection);
} catch (Exception e) {
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/MoveBendpointFeature.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/MoveBendpointFeature.java
index 95db1b9..6e14b59 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/MoveBendpointFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/MoveBendpointFeature.java
@@ -18,16 +18,13 @@
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.di.DIUtils;
import org.eclipse.bpmn2.modeler.core.features.BendpointConnectionRouter;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.dd.dc.Point;
-import org.eclipse.dd.di.DiagramElement;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.IMoveBendpointContext;
import org.eclipse.graphiti.features.impl.DefaultMoveBendpointFeature;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.Shape;
public class MoveBendpointFeature extends DefaultMoveBendpointFeature {
@@ -38,18 +35,21 @@
@Override
public boolean moveBendpoint(IMoveBendpointContext context) {
boolean moved = super.moveBendpoint(context);
+
try {
FreeFormConnection connection = context.getConnection();
+ int index = context.getBendpointIndex();
+
BPMNDiagram bpmnDiagram = DIUtils.findBPMNDiagram(connection);
BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
BPMNEdge edge = DIUtils.findBPMNEdge(bpmnDiagram, element);
if (edge!=null) {
- int index = context.getBendpointIndex() + 1;
- Point p = edge.getWaypoint().get(index);
+ BendpointConnectionRouter.setOldBendpointLocation(connection, context.getBendpoint());
+
+ Point p = edge.getWaypoint().get(index+1);
p.setX(context.getX());
p.setY(context.getY());
-
- BendpointConnectionRouter.setMovedBendpoint(connection, context.getBendpointIndex());
+ BendpointConnectionRouter.setMovedBendpoint(connection, index);
FeatureSupport.updateConnection(getFeatureProvider(), connection);
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/RemoveBendpointFeature.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/RemoveBendpointFeature.java
index 03ee6fd..8701a1f 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/RemoveBendpointFeature.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/bendpoint/RemoveBendpointFeature.java
@@ -18,14 +18,12 @@
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.di.DIUtils;
import org.eclipse.bpmn2.modeler.core.features.BendpointConnectionRouter;
-import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.IRemoveBendpointContext;
import org.eclipse.graphiti.features.impl.DefaultRemoveBendpointFeature;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.Shape;
public class RemoveBendpointFeature extends DefaultRemoveBendpointFeature {
@@ -46,7 +44,7 @@
Activator.logError(e);
}
- BendpointConnectionRouter.setRemovedBendpoint(connection, context.getBendpointIndex());
+ BendpointConnectionRouter.setRemovedBendpoint(connection, context.getBendpoint());
FeatureSupport.updateConnection(getFeatureProvider(), connection);
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/AbstractDetailComposite.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/AbstractDetailComposite.java
index d908835..01c7f02 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/AbstractDetailComposite.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/AbstractDetailComposite.java
@@ -626,6 +626,7 @@
@Override
public void notifyChanged(Notification notification) {
super.notifyChanged(notification);
+ setBusinessObject(businessObject);
refresh();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceImpl.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceImpl.java
index d764954..29da793 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerResourceImpl.java
@@ -27,6 +27,7 @@
import org.eclipse.bpmn2.BaseElement;
import org.eclipse.bpmn2.Bpmn2Factory;
import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CompensateEventDefinition;
import org.eclipse.bpmn2.DataAssociation;
import org.eclipse.bpmn2.Definitions;
import org.eclipse.bpmn2.Documentation;
@@ -37,6 +38,7 @@
import org.eclipse.bpmn2.ItemDefinition;
import org.eclipse.bpmn2.Lane;
import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.RootElement;
import org.eclipse.bpmn2.di.BPMNDiagram;
import org.eclipse.bpmn2.di.BPMNEdge;
@@ -1041,7 +1043,7 @@
}
}
}
-
+
@Override
protected boolean shouldSaveFeature(EObject o, EStructuralFeature f) {
if (o instanceof BPMNShape && f==BpmnDiPackage.eINSTANCE.getBPMNShape_IsHorizontal()) {
@@ -1055,6 +1057,13 @@
return true;
}
+ if (o instanceof Process && f==Bpmn2Package.eINSTANCE.getProcess_IsExecutable())
+ return true;
+ if (o instanceof ItemDefinition && f==Bpmn2Package.eINSTANCE.getItemDefinition_IsCollection())
+ return true;
+ if (o instanceof CompensateEventDefinition && f==Bpmn2Package.eINSTANCE.getCompensateEventDefinition_WaitForCompletion())
+ return true;
+
// empty Expressions should not be saved
if (f!=null && (f.getEType() == Bpmn2Package.eINSTANCE.getExpression() ||
f.getEType() == Bpmn2Package.eINSTANCE.getFormalExpression())) {
@@ -1119,28 +1128,31 @@
if (f == Bpmn2Package.eINSTANCE.getBaseElement_ExtensionValues()) {
// check if this element is (or should be) empty
- boolean shouldSave = true;
+ int entryCount = 0;
for (ExtensionAttributeValue ev : (EList<ExtensionAttributeValue>)o.eGet(f)) {
BasicFeatureMap map = (BasicFeatureMap) ev.getValue();
Iterator<FeatureMap.Entry> mi = map.iterator();
while (mi.hasNext()) {
FeatureMap.Entry entry = mi.next();
Object v = entry.getValue();
+ boolean entryCounted = false;
if (v instanceof EObject) {
Iterator<Adapter> ai = ((EObject)v).eAdapters().iterator();
while (ai.hasNext()) {
Adapter a = ai.next();
if (a instanceof IExtensionValueAdapter) {
- if (!((IExtensionValueAdapter)a).shouldSaveElement((EObject)v)) {
- shouldSave = false;
- break;
+ if (((IExtensionValueAdapter)a).shouldSaveElement((EObject)v)) {
+ ++entryCount;
}
+ entryCounted = true;
}
}
}
+ if (!entryCounted)
+ ++entryCount;
}
}
- return shouldSave;
+ return entryCount>0;
}
Iterator<Adapter> ai = o.eAdapters().iterator();
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/ModelDecorator.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/ModelDecorator.java
index 0f2017f..02ce66f 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/ModelDecorator.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/ModelDecorator.java
@@ -26,6 +26,7 @@
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.di.BPMNDiagram;
import org.eclipse.bpmn2.di.BpmnDiPackage;
+import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.EDataTypeConversionFactory;
import org.eclipse.bpmn2.modeler.core.adapters.AdapterRegistry;
import org.eclipse.bpmn2.modeler.core.adapters.AdapterUtil;
@@ -1178,6 +1179,10 @@
if (object instanceof ExtensionAttributeValue)
object = object.eContainer();
EStructuralFeature evf = object.eClass().getEStructuralFeature("extensionValues"); //$NON-NLS-1$
+ if (evf==null) {
+ Activator.logError(new Exception("Object type "+object.eClass().getName()+" is not a BaseElement"));
+ return;
+ }
EList<EObject> list = (EList<EObject>)object.eGet(evf);
if (list.size()==0) {
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/FeatureSupport.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/FeatureSupport.java
index 781e432..92f000a 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/FeatureSupport.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/FeatureSupport.java
@@ -765,6 +765,15 @@
// }
return layoutChanged || updateChanged;
}
+
+ public static List<Connection> getConnections(AnchorContainer ac) {
+ List<Connection> connections = new ArrayList<Connection>();
+ for (Anchor a : ac.getAnchors()) {
+ connections.addAll(a.getIncomingConnections());
+ connections.addAll(a.getOutgoingConnections());
+ }
+ return connections;
+ }
public static boolean updateConnection(IFeatureProvider fp, Connection connection, boolean force) {
AbstractConnectionRouter.setForceRouting(connection, force);
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/GraphicsUtil.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/GraphicsUtil.java
index 0cac72b..779bb78 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/GraphicsUtil.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/GraphicsUtil.java
@@ -153,14 +153,9 @@
return end;
}
public Point getMiddle() {
- if (isHorizontal()) {
- int x = Math.abs(end.getX() - start.getX()) / 2;
- return Graphiti.getCreateService().createPoint(x, start.getY());
- }
- else {
- int y = Math.abs(end.getY() - start.getY()) / 2;
- return Graphiti.getCreateService().createPoint(start.getX(), y);
- }
+ int x = (start.getX() + end.getX()) / 2;
+ int y = (start.getY() + end.getY()) / 2;
+ return Graphiti.getCreateService().createPoint(x,y);
}
public double getDistance(Point p) {
@@ -584,7 +579,7 @@
}
}
- public static String getDebugText(ContainerShape shape) {
+ public static String getDebugText(Shape shape) {
EObject be = BusinessObjectUtil.getBusinessObjectForPictogramElement(shape);
String id = ""; //$NON-NLS-1$
if (be instanceof BaseElement) {
@@ -730,6 +725,14 @@
return lx-dist <= x && x <= lx+dist && ly-dist <= y && y <= ly+dist;
}
+ public static boolean isPointNear(Point p1, Point p2, int dist) {
+ int x = p1.getX();
+ int y = p1.getY();
+ int lx = p2.getX();
+ int ly = p2.getY();
+ return lx-dist <= x && x <= lx+dist && ly-dist <= y && y <= ly+dist;
+ }
+
public static Rectangle getBoundingRectangle(List<PictogramElement> pes) {
int xMin = Integer.MAX_VALUE;
int yMin = Integer.MAX_VALUE;
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/drools.ecore b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/drools.ecore
index 6219697..b993894 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/drools.ecore
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/drools.ecore
@@ -24,21 +24,21 @@
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="metadata" upperBound="-2"
- eType="#//MetadataType" volatile="true" transient="true" derived="true" containment="true"
+ <eStructuralFeatures xsi:type="ecore:EReference" name="metaData" upperBound="-2"
+ eType="#//MetaDataType" volatile="true" transient="true" derived="true" containment="true"
resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
- <details key="name" value="metadata"/>
+ <details key="name" value="metaData"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="metaentry" upperBound="-2"
- eType="#//MetaentryType" volatile="true" transient="true" derived="true" containment="true"
+ <eStructuralFeatures xsi:type="ecore:EReference" name="metaValue" upperBound="-2"
+ eType="#//MetaValueType" volatile="true" transient="true" derived="true" containment="true"
resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
- <details key="name" value="metaentry"/>
+ <details key="name" value="metaValue"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
@@ -136,40 +136,43 @@
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="MetadataType">
+ <eClassifiers xsi:type="ecore:EClass" name="MetaDataType">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="metadata_._type"/>
- <details key="kind" value="elementOnly"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="metaentry" lowerBound="1"
- upperBound="-1" eType="#//MetaentryType" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="metaentry"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="MetaentryType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="metaentry_._type"/>
+ <details key="name" value="metaData_._type"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
+ <details key="kind" value="attribute"/>
<details key="name" value="name"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="metaValue" lowerBound="1"
+ eType="#//MetaValueType" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
- <details key="name" value="value"/>
+ <details key="name" value="metaValue"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="MetaValueType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="metaValue_._type"/>
+ <details key="kind" value="mixed"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="elementWildcard"/>
+ <details key="name" value=":mixed"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" ordered="false"
+ lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ volatile="true" derived="true"/>
+ </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="OnEntryScriptType">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="onEntry-script_._type"/>
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/drools.genmodel b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/drools.genmodel
index 8d72516..b5b67b9 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/drools.genmodel
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/model/drools.genmodel
@@ -15,11 +15,11 @@
<genClasses ecoreClass="drools.ecore#//DocumentRoot">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/global"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/importType"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/metadata"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/metaentry"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/metaData"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/metaValue"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/onEntryScript"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/onExitScript"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/processAnalysisData"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//DocumentRoot/bpsimData"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//DocumentRoot/packageName"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//DocumentRoot/priority"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//DocumentRoot/ruleFlowGroup"/>
@@ -33,13 +33,11 @@
<genClasses ecoreClass="drools.ecore#//ImportType">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//ImportType/name"/>
</genClasses>
- <genClasses ecoreClass="drools.ecore#//MetadataType">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//MetadataType/metaentry"/>
+ <genClasses ecoreClass="drools.ecore#//MetaDataType">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//MetaDataType/name"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference drools.ecore#//MetaDataType/metaValue"/>
</genClasses>
- <genClasses ecoreClass="drools.ecore#//MetaentryType">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//MetaentryType/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//MetaentryType/value"/>
- </genClasses>
+ <genClasses ecoreClass="drools.ecore#//MetaValueType"/>
<genClasses ecoreClass="drools.ecore#//OnEntryScriptType">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//OnEntryScriptType/script"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//OnEntryScriptType/scriptFormat"/>
@@ -48,10 +46,8 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//OnExitScriptType/script"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute drools.ecore#//OnExitScriptType/scriptFormat"/>
</genClasses>
- <genClasses ecoreClass="drools.ecore#//ProcessAnalysisDataType">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute drools.ecore#//ProcessAnalysisDataType/group"/>
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference drools.ecore#//ProcessAnalysisDataType/scenario"/>
- </genClasses>
+ <genClasses ecoreClass="drools.ecore#//BPSimDataType"/>
+ <genClasses ecoreClass="drools.ecore#//ExternalProcess"/>
</genPackages>
<genPackages prefix="Bpsim" basePackage="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model"
resource="XML" disposableProviderFactory="true" ecorePackage="bpsim.ecore#/">
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties
index 3dfb78b..44a9111 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties
@@ -21,6 +21,7 @@
propertyTab.label.General = General
propertyTab.label.Process = Process
propertyTab.label.Interfaces = Interfaces
+propertyTab.label.Interface = Interface
propertyTab.label.Definitions = Definitions
propertyTab.label.DataItems = Data Items
propertyTab.label.CustomTask = Custom Task
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml
index 1faf29c..849e356 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml
@@ -10,6 +10,28 @@
</package>
</extension>
+ <extension point="org.eclipse.emf.ecore.extension_parser">
+ <!-- @generated drools -->
+ <parser
+ type="drools"
+ class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.util.DroolsResourceFactoryImpl"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated drools -->
+ <package
+ uri="http://www.bpsim.org/schemas/1.0"
+ class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.BpsimPackage"
+ genModel="model/drools.genmodel"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.extension_parser">
+ <!-- @generated drools -->
+ <parser
+ type="bpsim"
+ class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.util.BpsimResourceFactoryImpl"/>
+ </extension>
+
<extension point="org.eclipse.bpmn2.modeler.runtime">
<runtime name="%runtime.name" versions="5.1,5.2,5.3"
id="org.jboss.runtime.jbpm5"
@@ -41,17 +63,25 @@
</propertyTab>
<propertyTab
- id="bpmn2.jbpm.interface.tab"
- replaceTab="org.eclipse.bpmn2.modeler.interface.tab"
+ id="bpmn2.jbpm.interfaces.tab"
+ replaceTab="org.eclipse.bpmn2.modeler.interfaces.tab"
+ afterTab="org.eclipse.bpmn2.modeler.process.diagram.tab"
+ class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmInterfacesPropertySection"
+ label="%propertyTab.label.Interfaces">
+ </propertyTab>
+
+ <propertyTab
+ id="bpmn2.jbpm.interface.details.tab"
+ replaceTab="org.eclipse.bpmn2.modeler.interface.details.tab"
afterTab="org.eclipse.bpmn2.modeler.process.diagram.tab"
class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmInterfacePropertySection"
- label="%propertyTab.label.Interfaces">
+ label="%propertyTab.label.Interface">
</propertyTab>
<propertyTab
id="bpmn2.jbpm.definitions.tab"
replaceTab="org.eclipse.bpmn2.modeler.definitions.tab"
- afterTab="org.eclipse.bpmn2.modeler.interface.tab"
+ afterTab="org.eclipse.bpmn2.modeler.interfaces.tab"
class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmDefinitionsPropertySection"
type="org.eclipse.bpmn2.Definitions"
label="%propertyTab.label.Definitions">
@@ -934,6 +964,8 @@
<enable object="Message" feature="id"/>
<enable object="Message" feature="itemRef"/>
<enable object="MessageEventDefinition" feature="messageRef"/>
+ <enable object="MetaDataType" feature="name"/>
+ <enable object="MetaValueType" feature="value"/>
<enable object="MultiInstanceLoopCharacteristics" feature="inputDataItem"/>
<enable object="MultiInstanceLoopCharacteristics" feature="loopDataInputRef"/>
<enable object="OnEntryScriptType"/>
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5RuntimeExtension.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5RuntimeExtension.java
index 93b1b9b..284d0ae 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5RuntimeExtension.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/JBPM5RuntimeExtension.java
@@ -23,11 +23,7 @@
import org.eclipse.bpmn2.Activity;
import org.eclipse.bpmn2.DataInput;
-import org.eclipse.bpmn2.DataInputAssociation;
-import org.eclipse.bpmn2.DataObject;
import org.eclipse.bpmn2.DataOutput;
-import org.eclipse.bpmn2.Error;
-import org.eclipse.bpmn2.Escalation;
import org.eclipse.bpmn2.Event;
import org.eclipse.bpmn2.Expression;
import org.eclipse.bpmn2.Gateway;
@@ -40,9 +36,7 @@
import org.eclipse.bpmn2.ScriptTask;
import org.eclipse.bpmn2.SendTask;
import org.eclipse.bpmn2.SequenceFlow;
-import org.eclipse.bpmn2.Signal;
import org.eclipse.bpmn2.Task;
-import org.eclipse.bpmn2.UserTask;
import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
import org.eclipse.bpmn2.modeler.core.LifecycleEvent;
import org.eclipse.bpmn2.modeler.core.LifecycleEvent.EventType;
@@ -52,11 +46,11 @@
import org.eclipse.bpmn2.modeler.core.runtime.CustomTaskImageProvider;
import org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.Property;
import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
-import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.features.JbpmCustomTaskFeatureContainer;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.GlobalType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ImportType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmActivityDetailComposite;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmCommonEventDetailComposite;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmDataAssociationDetailComposite;
@@ -80,18 +74,19 @@
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WIDHandler;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.wid.WorkItemDefinition;
import org.eclipse.bpmn2.modeler.ui.DefaultBpmn2RuntimeExtension.RootElementParser;
+import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
import org.eclipse.bpmn2.modeler.ui.wizards.FileService;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
import org.xml.sax.InputSource;
@@ -164,13 +159,16 @@
// TODO: if file was opened from a Guvnor Repository view (or git in jBPM 6)
// we may want to explicitly make the editor read-only
- IProject project = Bpmn2Preferences.getActiveProject();
- if (project != null) {
+ IFile inputFile = ((BPMN2Editor) event.target).getModelFile();
+ if (inputFile!=null) {
+ IContainer folder = inputFile.getParent();
+
+ // initialize workItemDefinitions list if necessary
getWorkItemDefinitions();
workItemDefinitions.clear();
try {
final WIDResourceVisitor visitor = new WIDResourceVisitor();
- project.accept(visitor, IResource.DEPTH_INFINITE, false);
+ folder.accept(visitor, IResource.DEPTH_INFINITE, false);
if (visitor.getWIDFiles().size() > 0) {
Iterator<IFile> fileIter = visitor.getWIDFiles().iterator();
while (fileIter.hasNext()) {
@@ -200,12 +198,11 @@
public void run() {
MessageDialog.openError(Display.getDefault().getActiveShell(),
Messages.JBPM5RuntimeExtension_Duplicate_Task_Title,
- Messages.JBPM5RuntimeExtension_Duplicate_Task_Message+
- ctd.getId()+
- "' was already defined.\n"+ //$NON-NLS-1$
- "The new Custom Task defined in the file: "+ //$NON-NLS-1$
- wid.getDefinitionFile().getFullPath().toString()+"\n"+ //$NON-NLS-1$
- "will be ignored."); //$NON-NLS-1$
+ NLS.bind(
+ Messages.JBPM5RuntimeExtension_Duplicate_Task_Message,
+ ctd.getId(),
+ wid.getDefinitionFile().getFullPath().toString())
+ );
}
});
}
@@ -226,17 +223,10 @@
// Add a name change adapter to every one of these objects.
// See my rant in ProcessVariableNameChangeAdapter...
if (ProcessVariableNameChangeAdapter.appliesTo(object)) {
- boolean found = false;
- for (Adapter a : ((EObject)object).eAdapters()) {
- if (a instanceof ProcessVariableNameChangeAdapter) {
- found = true;
- break;
- }
- }
- if (!found) {
- ProcessVariableNameChangeAdapter a = new ProcessVariableNameChangeAdapter();
- object.eAdapters().add(a);
- }
+ ProcessVariableNameChangeAdapter.adapt(object);
+ }
+ else if (MetaDataTypeAdapter.appliesTo(object)) {
+ MetaDataTypeAdapter.adapt(object);
}
}
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/MetaDataTypeAdapter.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/MetaDataTypeAdapter.java
new file mode 100644
index 0000000..854de87
--- /dev/null
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/MetaDataTypeAdapter.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012, 2013, 2014 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * @author Bob Brodt
+ ******************************************************************************/
+
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5;
+
+import org.eclipse.bpmn2.modeler.core.adapters.IExtensionValueAdapter;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+public class MetaDataTypeAdapter extends AdapterImpl implements IExtensionValueAdapter {
+
+ public static MetaDataTypeAdapter adapt(EObject object) {
+ if (appliesTo(object)) {
+ for (Adapter a : ((EObject)object).eAdapters()) {
+ if (a instanceof MetaDataTypeAdapter) {
+ return (MetaDataTypeAdapter)a;
+ }
+ }
+ MetaDataTypeAdapter a = new MetaDataTypeAdapter();
+ object.eAdapters().add(a);
+ return a;
+ }
+ return null;
+ }
+
+ public static boolean appliesTo(EObject object) {
+ return object instanceof MetaDataType;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.adapters.IExtensionValueAdapter#shouldSaveElement(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public boolean shouldSaveElement(EObject o) {
+ if (((MetaDataType)o).getName()==null || ((MetaDataType)o).getName().isEmpty())
+ return false;
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.bpmn2.modeler.core.adapters.IExtensionValueAdapter#shouldSaveFeature(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature)
+ */
+ @Override
+ public boolean shouldSaveFeature(EObject o, EStructuralFeature f) {
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/ProcessVariableNameChangeAdapter.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/ProcessVariableNameChangeAdapter.java
index ee18afc..83de9e4 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/ProcessVariableNameChangeAdapter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/ProcessVariableNameChangeAdapter.java
@@ -43,6 +43,23 @@
*/
public class ProcessVariableNameChangeAdapter implements Adapter {
+ private ProcessVariableNameChangeAdapter() {
+ }
+
+ public static ProcessVariableNameChangeAdapter adapt(EObject object) {
+ if (appliesTo(object)) {
+ for (Adapter a : ((EObject)object).eAdapters()) {
+ if (a instanceof ProcessVariableNameChangeAdapter) {
+ return (ProcessVariableNameChangeAdapter)a;
+ }
+ }
+ ProcessVariableNameChangeAdapter a = new ProcessVariableNameChangeAdapter();
+ object.eAdapters().add(a);
+ return a;
+ }
+ return null;
+ }
+
public static boolean appliesTo(EObject object) {
return (object instanceof org.eclipse.bpmn2.Property ||
object instanceof DataObject ||
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/BpsimFactory.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/BpsimFactory.java
index 7454d41..7661e0a 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/BpsimFactory.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/BpsimFactory.java
@@ -166,10 +166,10 @@
ErlangDistributionType createErlangDistributionType();
/**
- * Returns a new object of class '<em>SingleAssignment Parameter Type</em>'.
+ * Returns a new object of class '<em>Expression Parameter Type</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return a new object of class '<em>SingleAssignment Parameter Type</em>'.
+ * @return a new object of class '<em>Expression Parameter Type</em>'.
* @generated
*/
ExpressionParameterType createExpressionParameterType();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/BpsimPackage.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/BpsimPackage.java
index 862feea..694745d 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/BpsimPackage.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/BpsimPackage.java
@@ -781,7 +781,7 @@
int DOCUMENT_ROOT__ERLANG_DISTRIBUTION = 11;
/**
- * The feature id for the '<em><b>SingleAssignment Parameter</b></em>' containment reference.
+ * The feature id for the '<em><b>Expression Parameter</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -1335,7 +1335,7 @@
int ERLANG_DISTRIBUTION_TYPE_FEATURE_COUNT = DISTRIBUTION_PARAMETER_FEATURE_COUNT + 2;
/**
- * The meta object id for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.ExpressionParameterTypeImpl <em>SingleAssignment Parameter Type</em>}' class.
+ * The meta object id for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.ExpressionParameterTypeImpl <em>Expression Parameter Type</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.ExpressionParameterTypeImpl
@@ -1381,7 +1381,7 @@
int EXPRESSION_PARAMETER_TYPE__VALUE = PARAMETER_VALUE_FEATURE_COUNT + 0;
/**
- * The number of structural features of the '<em>SingleAssignment Parameter Type</em>' class.
+ * The number of structural features of the '<em>Expression Parameter Type</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -3661,10 +3661,10 @@
EReference getDocumentRoot_ErlangDistribution();
/**
- * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getExpressionParameter <em>SingleAssignment Parameter</em>}'.
+ * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getExpressionParameter <em>Expression Parameter</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>SingleAssignment Parameter</em>'.
+ * @return the meta object for the containment reference '<em>Expression Parameter</em>'.
* @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getExpressionParameter()
* @see #getDocumentRoot()
* @generated
@@ -4041,10 +4041,10 @@
EAttribute getErlangDistributionType_Mean();
/**
- * Returns the meta object for class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.ExpressionParameterType <em>SingleAssignment Parameter Type</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.ExpressionParameterType <em>Expression Parameter Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for class '<em>SingleAssignment Parameter Type</em>'.
+ * @return the meta object for class '<em>Expression Parameter Type</em>'.
* @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.ExpressionParameterType
* @generated
*/
@@ -5605,7 +5605,7 @@
EReference DOCUMENT_ROOT__ERLANG_DISTRIBUTION = eINSTANCE.getDocumentRoot_ErlangDistribution();
/**
- * The meta object literal for the '<em><b>SingleAssignment Parameter</b></em>' containment reference feature.
+ * The meta object literal for the '<em><b>Expression Parameter</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -5895,7 +5895,7 @@
EAttribute ERLANG_DISTRIBUTION_TYPE__MEAN = eINSTANCE.getErlangDistributionType_Mean();
/**
- * The meta object literal for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.ExpressionParameterTypeImpl <em>SingleAssignment Parameter Type</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.ExpressionParameterTypeImpl <em>Expression Parameter Type</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.ExpressionParameterTypeImpl
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/DocumentRoot.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/DocumentRoot.java
index eadcc58..f3a7c2c 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/DocumentRoot.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/DocumentRoot.java
@@ -26,7 +26,7 @@
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getDurationParameter <em>Duration Parameter</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getEnumParameter <em>Enum Parameter</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getErlangDistribution <em>Erlang Distribution</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getExpressionParameter <em>SingleAssignment Parameter</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getExpressionParameter <em>Expression Parameter</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getFloatingParameter <em>Floating Parameter</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getGammaDistribution <em>Gamma Distribution</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getLogNormalDistribution <em>Log Normal Distribution</em>}</li>
@@ -346,14 +346,14 @@
void setErlangDistribution(ErlangDistributionType value);
/**
- * Returns the value of the '<em><b>SingleAssignment Parameter</b></em>' containment reference.
+ * Returns the value of the '<em><b>Expression Parameter</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>SingleAssignment Parameter</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>SingleAssignment Parameter</em>' containment reference.
+ * @return the value of the '<em>Expression Parameter</em>' containment reference.
* @see #setExpressionParameter(ExpressionParameterType)
* @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.BpsimPackage#getDocumentRoot_ExpressionParameter()
* @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
@@ -363,10 +363,10 @@
ExpressionParameterType getExpressionParameter();
/**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getExpressionParameter <em>SingleAssignment Parameter</em>}' containment reference.
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.DocumentRoot#getExpressionParameter <em>Expression Parameter</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>SingleAssignment Parameter</em>' containment reference.
+ * @param value the new value of the '<em>Expression Parameter</em>' containment reference.
* @see #getExpressionParameter()
* @generated
*/
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/ResultType.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/ResultType.java
index d8b6eff..ae2a822 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/ResultType.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/ResultType.java
@@ -26,7 +26,7 @@
* @generated
* @ordered
*/
- MIN(0, Messages.ResultType_0, Messages.ResultType_1),
+ MIN(0, "min", "min"),
/**
* The '<em><b>Max</b></em>' literal object.
@@ -36,7 +36,7 @@
* @generated
* @ordered
*/
- MAX(1, Messages.ResultType_2, Messages.ResultType_3),
+ MAX(1, "max", "max"),
/**
* The '<em><b>Mean</b></em>' literal object.
@@ -46,7 +46,7 @@
* @generated
* @ordered
*/
- MEAN(2, Messages.ResultType_4, Messages.ResultType_5),
+ MEAN(2, "mean", "mean"),
/**
* The '<em><b>Count</b></em>' literal object.
@@ -56,7 +56,7 @@
* @generated
* @ordered
*/
- COUNT(3, Messages.ResultType_6, Messages.ResultType_7),
+ COUNT(3, "count", "count"),
/**
* The '<em><b>Sum</b></em>' literal object.
@@ -66,7 +66,7 @@
* @generated
* @ordered
*/
- SUM(4, Messages.ResultType_8, Messages.ResultType_9);
+ SUM(4, "sum", "sum");
/**
* The '<em><b>Min</b></em>' literal value.
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BPSimDataTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BPSimDataTypeImpl.java
index daadea1..51a4813 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BPSimDataTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BPSimDataTypeImpl.java
@@ -178,7 +178,7 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (group: "); //$NON-NLS-1$
+ result.append(" (group: ");
result.append(group);
result.append(')');
return result.toString();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BinomialDistributionTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BinomialDistributionTypeImpl.java
index af0977c..5c668d1 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BinomialDistributionTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BinomialDistributionTypeImpl.java
@@ -270,10 +270,10 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (probability: "); //$NON-NLS-1$
- if (probabilityESet) result.append(probability); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", trials: "); //$NON-NLS-1$
- if (trialsESet) result.append(trials); else result.append("<unset>"); //$NON-NLS-1$
+ result.append(" (probability: ");
+ if (probabilityESet) result.append(probability); else result.append("<unset>");
+ result.append(", trials: ");
+ if (trialsESet) result.append(trials); else result.append("<unset>");
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BpsimFactoryImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BpsimFactoryImpl.java
index 53dfa68..a6580a8 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BpsimFactoryImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/BpsimFactoryImpl.java
@@ -71,7 +71,7 @@
*/
public static BpsimFactory init() {
try {
- BpsimFactory theBpsimFactory = (BpsimFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.bpsim.org/schemas/1.0");
+ BpsimFactory theBpsimFactory = (BpsimFactory)EPackage.Registry.INSTANCE.getEFactory(BpsimPackage.eNS_URI);
if (theBpsimFactory != null) {
return theBpsimFactory;
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/CalendarImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/CalendarImpl.java
index 704165e..8a484bd 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/CalendarImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/CalendarImpl.java
@@ -255,11 +255,11 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (value: "); //$NON-NLS-1$
+ result.append(" (value: ");
result.append(value);
- result.append(", id: "); //$NON-NLS-1$
+ result.append(", id: ");
result.append(id);
- result.append(", name: "); //$NON-NLS-1$
+ result.append(", name: ");
result.append(name);
result.append(')');
return result.toString();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/DocumentRootImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/DocumentRootImpl.java
index 8d6bd43..7db2414 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/DocumentRootImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/DocumentRootImpl.java
@@ -60,7 +60,7 @@
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.DocumentRootImpl#getDurationParameter <em>Duration Parameter</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.DocumentRootImpl#getEnumParameter <em>Enum Parameter</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.DocumentRootImpl#getErlangDistribution <em>Erlang Distribution</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.DocumentRootImpl#getExpressionParameter <em>SingleAssignment Parameter</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.DocumentRootImpl#getExpressionParameter <em>Expression Parameter</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.DocumentRootImpl#getFloatingParameter <em>Floating Parameter</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.DocumentRootImpl#getGammaDistribution <em>Gamma Distribution</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.impl.DocumentRootImpl#getLogNormalDistribution <em>Log Normal Distribution</em>}</li>
@@ -1211,7 +1211,7 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (mixed: "); //$NON-NLS-1$
+ result.append(" (mixed: ");
result.append(mixed);
result.append(')');
return result.toString();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/DurationParameterTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/DurationParameterTypeImpl.java
index 0e531e4..78b3e2c 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/DurationParameterTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/DurationParameterTypeImpl.java
@@ -152,7 +152,7 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (value: "); //$NON-NLS-1$
+ result.append(" (value: ");
result.append(value);
result.append(')');
return result.toString();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ElementParametersImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ElementParametersImpl.java
index 1ecd992..15bb218 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ElementParametersImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ElementParametersImpl.java
@@ -662,9 +662,9 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (elementRef: "); //$NON-NLS-1$
+ result.append(" (elementRef: ");
result.append(elementRef);
- result.append(", id: "); //$NON-NLS-1$
+ result.append(", id: ");
result.append(id);
result.append(')');
return result.toString();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/EnumParameterTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/EnumParameterTypeImpl.java
index 72998bd..8b7eee3 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/EnumParameterTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/EnumParameterTypeImpl.java
@@ -200,7 +200,7 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (group: "); //$NON-NLS-1$
+ result.append(" (group: ");
result.append(group);
result.append(')');
return result.toString();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ErlangDistributionTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ErlangDistributionTypeImpl.java
index 10538df..412ffc9 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ErlangDistributionTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ErlangDistributionTypeImpl.java
@@ -270,10 +270,10 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (k: "); //$NON-NLS-1$
- if (kESet) result.append(k); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", mean: "); //$NON-NLS-1$
- if (meanESet) result.append(mean); else result.append("<unset>"); //$NON-NLS-1$
+ result.append(" (k: ");
+ if (kESet) result.append(k); else result.append("<unset>");
+ result.append(", mean: ");
+ if (meanESet) result.append(mean); else result.append("<unset>");
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/LogNormalDistributionTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/LogNormalDistributionTypeImpl.java
index a1bf398..45f45c1 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/LogNormalDistributionTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/LogNormalDistributionTypeImpl.java
@@ -270,10 +270,10 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (mean: "); //$NON-NLS-1$
- if (meanESet) result.append(mean); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", standardDeviation: "); //$NON-NLS-1$
- if (standardDeviationESet) result.append(standardDeviation); else result.append("<unset>"); //$NON-NLS-1$
+ result.append(" (mean: ");
+ if (meanESet) result.append(mean); else result.append("<unset>");
+ result.append(", standardDeviation: ");
+ if (standardDeviationESet) result.append(standardDeviation); else result.append("<unset>");
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/PoissonDistributionTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/PoissonDistributionTypeImpl.java
index c30c50b..abb820d 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/PoissonDistributionTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/PoissonDistributionTypeImpl.java
@@ -184,8 +184,8 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (mean: "); //$NON-NLS-1$
- if (meanESet) result.append(mean); else result.append("<unset>"); //$NON-NLS-1$
+ result.append(" (mean: ");
+ if (meanESet) result.append(mean); else result.append("<unset>");
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/PropertyTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/PropertyTypeImpl.java
index f88a2f7..93218fe 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/PropertyTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/PropertyTypeImpl.java
@@ -150,7 +150,7 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: "); //$NON-NLS-1$
+ result.append(" (name: ");
result.append(name);
result.append(')');
return result.toString();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ScenarioParametersImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ScenarioParametersImpl.java
index 8204ad3..29c9329 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ScenarioParametersImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/ScenarioParametersImpl.java
@@ -624,14 +624,14 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (baseCurrencyUnit: "); //$NON-NLS-1$
+ result.append(" (baseCurrencyUnit: ");
result.append(baseCurrencyUnit);
- result.append(", baseTimeUnit: "); //$NON-NLS-1$
- if (baseTimeUnitESet) result.append(baseTimeUnit); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", replication: "); //$NON-NLS-1$
- if (replicationESet) result.append(replication); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", seed: "); //$NON-NLS-1$
- if (seedESet) result.append(seed); else result.append("<unset>"); //$NON-NLS-1$
+ result.append(", baseTimeUnit: ");
+ if (baseTimeUnitESet) result.append(baseTimeUnit); else result.append("<unset>");
+ result.append(", replication: ");
+ if (replicationESet) result.append(replication); else result.append("<unset>");
+ result.append(", seed: ");
+ if (seedESet) result.append(seed); else result.append("<unset>");
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/TruncatedNormalDistributionTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/TruncatedNormalDistributionTypeImpl.java
index b980b22..accf925 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/TruncatedNormalDistributionTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/TruncatedNormalDistributionTypeImpl.java
@@ -442,14 +442,14 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (max: "); //$NON-NLS-1$
- if (maxESet) result.append(max); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", mean: "); //$NON-NLS-1$
- if (meanESet) result.append(mean); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", min: "); //$NON-NLS-1$
- if (minESet) result.append(min); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", standardDeviation: "); //$NON-NLS-1$
- if (standardDeviationESet) result.append(standardDeviation); else result.append("<unset>"); //$NON-NLS-1$
+ result.append(" (max: ");
+ if (maxESet) result.append(max); else result.append("<unset>");
+ result.append(", mean: ");
+ if (meanESet) result.append(mean); else result.append("<unset>");
+ result.append(", min: ");
+ if (minESet) result.append(min); else result.append("<unset>");
+ result.append(", standardDeviation: ");
+ if (standardDeviationESet) result.append(standardDeviation); else result.append("<unset>");
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/UserDistributionDataPointTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/UserDistributionDataPointTypeImpl.java
index 1d24a81..847647d 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/UserDistributionDataPointTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/UserDistributionDataPointTypeImpl.java
@@ -279,10 +279,10 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (parameterValueGroup: "); //$NON-NLS-1$
+ result.append(" (parameterValueGroup: ");
result.append(parameterValueGroup);
- result.append(", probability: "); //$NON-NLS-1$
- if (probabilityESet) result.append(probability); else result.append("<unset>"); //$NON-NLS-1$
+ result.append(", probability: ");
+ if (probabilityESet) result.append(probability); else result.append("<unset>");
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/UserDistributionTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/UserDistributionTypeImpl.java
index d6c1c55..7f1b665 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/UserDistributionTypeImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/UserDistributionTypeImpl.java
@@ -265,10 +265,10 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (group: "); //$NON-NLS-1$
+ result.append(" (group: ");
result.append(group);
- result.append(", discrete: "); //$NON-NLS-1$
- if (discreteESet) result.append(discrete); else result.append("<unset>"); //$NON-NLS-1$
+ result.append(", discrete: ");
+ if (discreteESet) result.append(discrete); else result.append("<unset>");
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/VendorExtensionImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/VendorExtensionImpl.java
index 9e8949b..a009ea1 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/VendorExtensionImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/impl/VendorExtensionImpl.java
@@ -240,11 +240,11 @@
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (any: "); //$NON-NLS-1$
+ result.append(" (any: ");
result.append(any);
- result.append(", name: "); //$NON-NLS-1$
+ result.append(", name: ");
result.append(name);
- result.append(", anyAttribute: "); //$NON-NLS-1$
+ result.append(", anyAttribute: ");
result.append(anyAttribute);
result.append(')');
return result.toString();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/util/BpsimAdapterFactory.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/util/BpsimAdapterFactory.java
index f773dcf..f4732d5 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/util/BpsimAdapterFactory.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/util/BpsimAdapterFactory.java
@@ -520,7 +520,7 @@
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.ExpressionParameterType <em>SingleAssignment Parameter Type</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.bpsim.ExpressionParameterType <em>Expression Parameter Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/util/BpsimSwitch.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/util/BpsimSwitch.java
index 7ff49ca..47bd9c0 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/util/BpsimSwitch.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/bpsim/util/BpsimSwitch.java
@@ -649,13 +649,13 @@
}
/**
- * Returns the result of interpreting the object as an instance of '<em>SingleAssignment Parameter Type</em>'.
+ * Returns the result of interpreting the object as an instance of '<em>Expression Parameter Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>SingleAssignment Parameter Type</em>'.
+ * @return the result of interpreting the object as an instance of '<em>Expression Parameter Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DocumentRoot.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DocumentRoot.java
index c36428f..707608a 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DocumentRoot.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DocumentRoot.java
@@ -15,8 +15,8 @@
* <ul>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getGlobal <em>Global</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getImportType <em>Import Type</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetadata <em>Metadata</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaentry <em>Metaentry</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaData <em>Meta Data</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaValue <em>Meta Value</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getOnEntryScript <em>On Entry Script</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getOnExitScript <em>On Exit Script</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getBpsimData <em>Bpsim Data</em>}</li>
@@ -88,58 +88,58 @@
void setImportType(ImportType value);
/**
- * Returns the value of the '<em><b>Metadata</b></em>' containment reference.
+ * Returns the value of the '<em><b>Meta Data</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Metadata</em>' containment reference isn't clear,
+ * If the meaning of the '<em>MetaData</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Metadata</em>' containment reference.
- * @see #setMetadata(MetadataType)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getDocumentRoot_Metadata()
+ * @return the value of the '<em>Meta Data</em>' containment reference.
+ * @see #setMetaData(MetaDataType)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getDocumentRoot_MetaData()
* @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
- * extendedMetaData="kind='element' name='metadata' namespace='##targetNamespace'"
+ * extendedMetaData="kind='element' name='metaData' namespace='##targetNamespace'"
* @generated
*/
- MetadataType getMetadata();
+ MetaDataType getMetaData();
/**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetadata <em>Metadata</em>}' containment reference.
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaData <em>Meta Data</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Metadata</em>' containment reference.
- * @see #getMetadata()
+ * @param value the new value of the '<em>Meta Data</em>' containment reference.
+ * @see #getMetaData()
* @generated
*/
- void setMetadata(MetadataType value);
+ void setMetaData(MetaDataType value);
/**
- * Returns the value of the '<em><b>Metaentry</b></em>' containment reference.
+ * Returns the value of the '<em><b>Meta Value</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Metaentry</em>' containment reference isn't clear,
+ * If the meaning of the '<em>MetaValue</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Metaentry</em>' containment reference.
- * @see #setMetaentry(MetaentryType)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getDocumentRoot_Metaentry()
+ * @return the value of the '<em>Meta Value</em>' containment reference.
+ * @see #setMetaValue(MetaValueType)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getDocumentRoot_MetaValue()
* @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
- * extendedMetaData="kind='element' name='metaentry' namespace='##targetNamespace'"
+ * extendedMetaData="kind='element' name='metaValue' namespace='##targetNamespace'"
* @generated
*/
- MetaentryType getMetaentry();
+ MetaValueType getMetaValue();
/**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaentry <em>Metaentry</em>}' containment reference.
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaValue <em>Meta Value</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Metaentry</em>' containment reference.
- * @see #getMetaentry()
+ * @param value the new value of the '<em>Meta Value</em>' containment reference.
+ * @see #getMetaValue()
* @generated
*/
- void setMetaentry(MetaentryType value);
+ void setMetaValue(MetaValueType value);
/**
* Returns the value of the '<em><b>On Entry Script</b></em>' containment reference.
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DroolsFactory.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DroolsFactory.java
index 497a892..2695f9b 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DroolsFactory.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DroolsFactory.java
@@ -49,22 +49,22 @@
ImportType createImportType();
/**
- * Returns a new object of class '<em>Metadata Type</em>'.
+ * Returns a new object of class '<em>Meta Data Type</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return a new object of class '<em>Metadata Type</em>'.
+ * @return a new object of class '<em>Meta Data Type</em>'.
* @generated
*/
- MetadataType createMetadataType();
+ MetaDataType createMetaDataType();
/**
- * Returns a new object of class '<em>Metaentry Type</em>'.
+ * Returns a new object of class '<em>Meta Value Type</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return a new object of class '<em>Metaentry Type</em>'.
+ * @return a new object of class '<em>Meta Value Type</em>'.
* @generated
*/
- MetaentryType createMetaentryType();
+ MetaValueType createMetaValueType();
/**
* Returns a new object of class '<em>On Entry Script Type</em>'.
@@ -94,10 +94,10 @@
BPSimDataType createBPSimDataType();
/**
- * Returns a new object of class '<em>Callable Element Proxy</em>'.
+ * Returns a new object of class '<em>External Process</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return a new object of class '<em>Callable Element Proxy</em>'.
+ * @return a new object of class '<em>External Process</em>'.
* @generated
*/
ExternalProcess createExternalProcess();
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DroolsPackage.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DroolsPackage.java
index 882fc7b..aaaaa88 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DroolsPackage.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/DroolsPackage.java
@@ -132,7 +132,7 @@
int DOCUMENT_ROOT__ARTIFACT = Bpmn2Package.DOCUMENT_ROOT__ARTIFACT;
/**
- * The feature id for the '<em><b>MultipleAssignments</b></em>' containment reference.
+ * The feature id for the '<em><b>Assignment</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -420,7 +420,7 @@
int DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING = Bpmn2Package.DOCUMENT_ROOT__CORRELATION_PROPERTY_BINDING;
/**
- * The feature id for the '<em><b>Correlation Property Retrieval SingleAssignment</b></em>' containment reference.
+ * The feature id for the '<em><b>Correlation Property Retrieval Expression</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -627,7 +627,7 @@
int DOCUMENT_ROOT__EXCLUSIVE_GATEWAY = Bpmn2Package.DOCUMENT_ROOT__EXCLUSIVE_GATEWAY;
/**
- * The feature id for the '<em><b>SingleAssignment</b></em>' containment reference.
+ * The feature id for the '<em><b>Expression</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -663,7 +663,7 @@
int DOCUMENT_ROOT__FLOW_NODE = Bpmn2Package.DOCUMENT_ROOT__FLOW_NODE;
/**
- * The feature id for the '<em><b>Formal SingleAssignment</b></em>' containment reference.
+ * The feature id for the '<em><b>Formal Expression</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -1104,7 +1104,7 @@
int DOCUMENT_ROOT__RESOURCE = Bpmn2Package.DOCUMENT_ROOT__RESOURCE;
/**
- * The feature id for the '<em><b>Resource MultipleAssignments SingleAssignment</b></em>' containment reference.
+ * The feature id for the '<em><b>Resource Assignment Expression</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -1329,22 +1329,22 @@
int DOCUMENT_ROOT__IMPORT_TYPE = Bpmn2Package.DOCUMENT_ROOT_FEATURE_COUNT + 1;
/**
- * The feature id for the '<em><b>Metadata</b></em>' containment reference.
+ * The feature id for the '<em><b>Meta Data</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int DOCUMENT_ROOT__METADATA = Bpmn2Package.DOCUMENT_ROOT_FEATURE_COUNT + 2;
+ int DOCUMENT_ROOT__META_DATA = Bpmn2Package.DOCUMENT_ROOT_FEATURE_COUNT + 2;
/**
- * The feature id for the '<em><b>Metaentry</b></em>' containment reference.
+ * The feature id for the '<em><b>Meta Value</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int DOCUMENT_ROOT__METAENTRY = Bpmn2Package.DOCUMENT_ROOT_FEATURE_COUNT + 3;
+ int DOCUMENT_ROOT__META_VALUE = Bpmn2Package.DOCUMENT_ROOT_FEATURE_COUNT + 3;
/**
* The feature id for the '<em><b>On Entry Script</b></em>' containment reference.
@@ -1556,42 +1556,14 @@
int IMPORT_TYPE_FEATURE_COUNT = 1;
/**
- * The meta object id for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetadataTypeImpl <em>Metadata Type</em>}' class.
+ * The meta object id for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaDataTypeImpl <em>Meta Data Type</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetadataTypeImpl
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DroolsPackageImpl#getMetadataType()
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaDataTypeImpl
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DroolsPackageImpl#getMetaDataType()
* @generated
*/
- int METADATA_TYPE = 3;
-
- /**
- * The feature id for the '<em><b>Metaentry</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int METADATA_TYPE__METAENTRY = 0;
-
- /**
- * The number of structural features of the '<em>Metadata Type</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int METADATA_TYPE_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaentryTypeImpl <em>Metaentry Type</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaentryTypeImpl
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DroolsPackageImpl#getMetaentryType()
- * @generated
- */
- int METAENTRY_TYPE = 4;
+ int META_DATA_TYPE = 3;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1600,7 +1572,44 @@
* @generated
* @ordered
*/
- int METAENTRY_TYPE__NAME = 0;
+ int META_DATA_TYPE__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Meta Value</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int META_DATA_TYPE__META_VALUE = 1;
+
+ /**
+ * The number of structural features of the '<em>Meta Data Type</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int META_DATA_TYPE_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaValueTypeImpl <em>Meta Value Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaValueTypeImpl
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DroolsPackageImpl#getMetaValueType()
+ * @generated
+ */
+ int META_VALUE_TYPE = 4;
+
+ /**
+ * The feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int META_VALUE_TYPE__MIXED = 0;
/**
* The feature id for the '<em><b>Value</b></em>' attribute.
@@ -1609,16 +1618,16 @@
* @generated
* @ordered
*/
- int METAENTRY_TYPE__VALUE = 1;
+ int META_VALUE_TYPE__VALUE = 1;
/**
- * The number of structural features of the '<em>Metaentry Type</em>' class.
+ * The number of structural features of the '<em>Meta Value Type</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int METAENTRY_TYPE_FEATURE_COUNT = 2;
+ int META_VALUE_TYPE_FEATURE_COUNT = 2;
/**
* The meta object id for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.OnEntryScriptTypeImpl <em>On Entry Script Type</em>}' class.
@@ -1732,7 +1741,7 @@
int BP_SIM_DATA_TYPE_FEATURE_COUNT = BpsimPackage.BP_SIM_DATA_TYPE_FEATURE_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.ExternalProcessImpl <em>Callable Element Proxy</em>}' class.
+ * The meta object id for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.ExternalProcessImpl <em>External Process</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.ExternalProcessImpl
@@ -1823,7 +1832,7 @@
int EXTERNAL_PROCESS__NAME = Bpmn2Package.CALLABLE_ELEMENT__NAME;
/**
- * The number of structural features of the '<em>Callable Element Proxy</em>' class.
+ * The number of structural features of the '<em>External Process</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -1915,26 +1924,26 @@
EReference getDocumentRoot_ImportType();
/**
- * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetadata <em>Metadata</em>}'.
+ * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaData <em>Meta Data</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Metadata</em>'.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetadata()
+ * @return the meta object for the containment reference '<em>Meta Data</em>'.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaData()
* @see #getDocumentRoot()
* @generated
*/
- EReference getDocumentRoot_Metadata();
+ EReference getDocumentRoot_MetaData();
/**
- * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaentry <em>Metaentry</em>}'.
+ * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaValue <em>Meta Value</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Metaentry</em>'.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaentry()
+ * @return the meta object for the containment reference '<em>Meta Value</em>'.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getMetaValue()
* @see #getDocumentRoot()
* @generated
*/
- EReference getDocumentRoot_Metaentry();
+ EReference getDocumentRoot_MetaValue();
/**
* Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot#getOnEntryScript <em>On Entry Script</em>}'.
@@ -2078,57 +2087,68 @@
EAttribute getImportType_Name();
/**
- * Returns the meta object for class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType <em>Metadata Type</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType <em>Meta Data Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for class '<em>Metadata Type</em>'.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType
+ * @return the meta object for class '<em>Meta Data Type</em>'.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType
* @generated
*/
- EClass getMetadataType();
+ EClass getMetaDataType();
/**
- * Returns the meta object for the containment reference list '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType#getMetaentry <em>Metaentry</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Metaentry</em>'.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType#getMetaentry()
- * @see #getMetadataType()
- * @generated
- */
- EReference getMetadataType_Metaentry();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType <em>Metaentry Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Metaentry Type</em>'.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType
- * @generated
- */
- EClass getMetaentryType();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType#getName <em>Name</em>}'.
+ * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType#getName()
- * @see #getMetaentryType()
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType#getName()
+ * @see #getMetaDataType()
* @generated
*/
- EAttribute getMetaentryType_Name();
+ EAttribute getMetaDataType_Name();
/**
- * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType#getValue <em>Value</em>}'.
+ * Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType#getMetaValue <em>Meta Value</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Meta Value</em>'.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType#getMetaValue()
+ * @see #getMetaDataType()
+ * @generated
+ */
+ EReference getMetaDataType_MetaValue();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType <em>Meta Value Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Meta Value Type</em>'.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType
+ * @generated
+ */
+ EClass getMetaValueType();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType#getMixed <em>Mixed</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Mixed</em>'.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType#getMixed()
+ * @see #getMetaValueType()
+ * @generated
+ */
+ EAttribute getMetaValueType_Mixed();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType#getValue <em>Value</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType#getValue()
- * @see #getMetaentryType()
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType#getValue()
+ * @see #getMetaValueType()
* @generated
*/
- EAttribute getMetaentryType_Value();
+ EAttribute getMetaValueType_Value();
/**
* Returns the meta object for class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnEntryScriptType <em>On Entry Script Type</em>}'.
@@ -2205,10 +2225,10 @@
EClass getBPSimDataType();
/**
- * Returns the meta object for class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ExternalProcess <em>Callable Element Proxy</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ExternalProcess <em>External Process</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for class '<em>Callable Element Proxy</em>'.
+ * @return the meta object for class '<em>External Process</em>'.
* @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ExternalProcess
* @generated
*/
@@ -2323,20 +2343,20 @@
EReference DOCUMENT_ROOT__IMPORT_TYPE = eINSTANCE.getDocumentRoot_ImportType();
/**
- * The meta object literal for the '<em><b>Metadata</b></em>' containment reference feature.
+ * The meta object literal for the '<em><b>Meta Data</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- EReference DOCUMENT_ROOT__METADATA = eINSTANCE.getDocumentRoot_Metadata();
+ EReference DOCUMENT_ROOT__META_DATA = eINSTANCE.getDocumentRoot_MetaData();
/**
- * The meta object literal for the '<em><b>Metaentry</b></em>' containment reference feature.
+ * The meta object literal for the '<em><b>Meta Value</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- EReference DOCUMENT_ROOT__METAENTRY = eINSTANCE.getDocumentRoot_Metaentry();
+ EReference DOCUMENT_ROOT__META_VALUE = eINSTANCE.getDocumentRoot_MetaValue();
/**
* The meta object literal for the '<em><b>On Entry Script</b></em>' containment reference feature.
@@ -2447,32 +2467,14 @@
EAttribute IMPORT_TYPE__NAME = eINSTANCE.getImportType_Name();
/**
- * The meta object literal for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetadataTypeImpl <em>Metadata Type</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaDataTypeImpl <em>Meta Data Type</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetadataTypeImpl
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DroolsPackageImpl#getMetadataType()
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaDataTypeImpl
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DroolsPackageImpl#getMetaDataType()
* @generated
*/
- EClass METADATA_TYPE = eINSTANCE.getMetadataType();
-
- /**
- * The meta object literal for the '<em><b>Metaentry</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference METADATA_TYPE__METAENTRY = eINSTANCE.getMetadataType_Metaentry();
-
- /**
- * The meta object literal for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaentryTypeImpl <em>Metaentry Type</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaentryTypeImpl
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DroolsPackageImpl#getMetaentryType()
- * @generated
- */
- EClass METAENTRY_TYPE = eINSTANCE.getMetaentryType();
+ EClass META_DATA_TYPE = eINSTANCE.getMetaDataType();
/**
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
@@ -2480,7 +2482,33 @@
* <!-- end-user-doc -->
* @generated
*/
- EAttribute METAENTRY_TYPE__NAME = eINSTANCE.getMetaentryType_Name();
+ EAttribute META_DATA_TYPE__NAME = eINSTANCE.getMetaDataType_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Meta Value</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference META_DATA_TYPE__META_VALUE = eINSTANCE.getMetaDataType_MetaValue();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaValueTypeImpl <em>Meta Value Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaValueTypeImpl
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DroolsPackageImpl#getMetaValueType()
+ * @generated
+ */
+ EClass META_VALUE_TYPE = eINSTANCE.getMetaValueType();
+
+ /**
+ * The meta object literal for the '<em><b>Mixed</b></em>' attribute list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute META_VALUE_TYPE__MIXED = eINSTANCE.getMetaValueType_Mixed();
/**
* The meta object literal for the '<em><b>Value</b></em>' attribute feature.
@@ -2488,7 +2516,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EAttribute METAENTRY_TYPE__VALUE = eINSTANCE.getMetaentryType_Value();
+ EAttribute META_VALUE_TYPE__VALUE = eINSTANCE.getMetaValueType_Value();
/**
* The meta object literal for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.OnEntryScriptTypeImpl <em>On Entry Script Type</em>}' class.
@@ -2553,7 +2581,7 @@
EClass BP_SIM_DATA_TYPE = eINSTANCE.getBPSimDataType();
/**
- * The meta object literal for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.ExternalProcessImpl <em>Callable Element Proxy</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.ExternalProcessImpl <em>External Process</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.ExternalProcessImpl
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetaDataType.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetaDataType.java
new file mode 100644
index 0000000..036161c
--- /dev/null
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetaDataType.java
@@ -0,0 +1,80 @@
+/**
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>MetaData Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType#getMetaValue <em>Meta Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetaDataType()
+ * @model extendedMetaData="name='metaData_._type' kind='elementOnly'"
+ * @generated
+ */
+public interface MetaDataType extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetaDataType_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
+ * extendedMetaData="kind='attribute' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Meta Value</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>MetaValue</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Meta Value</em>' containment reference.
+ * @see #setMetaValue(MetaValueType)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetaDataType_MetaValue()
+ * @model containment="true" required="true"
+ * extendedMetaData="kind='element' name='metaValue' namespace='##targetNamespace'"
+ * @generated
+ */
+ MetaValueType getMetaValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType#getMetaValue <em>Meta Value</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Meta Value</em>' containment reference.
+ * @see #getMetaValue()
+ * @generated
+ */
+ void setMetaValue(MetaValueType value);
+
+} // MetaDataType
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetaValueType.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetaValueType.java
new file mode 100644
index 0000000..07304d4
--- /dev/null
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetaValueType.java
@@ -0,0 +1,70 @@
+/**
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.FeatureMap;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>MetaValue Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType#getMixed <em>Mixed</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType#getValue <em>Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetaValueType()
+ * @model extendedMetaData="name='metaValue_._type' kind='mixed'"
+ * @generated
+ */
+public interface MetaValueType extends EObject {
+
+ /**
+ * Returns the value of the '<em><b>Mixed</b></em>' attribute list.
+ * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mixed</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mixed</em>' attribute list.
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetaValueType_Mixed()
+ * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true"
+ * extendedMetaData="kind='elementWildcard' name=':mixed'"
+ * @generated
+ */
+ FeatureMap getMixed();
+
+ /**
+ * Returns the value of the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Value</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Value</em>' attribute.
+ * @see #setValue(String)
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetaValueType_Value()
+ * @model required="true" volatile="true" derived="true" ordered="false"
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType#getValue <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Value</em>' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+} // MetaValueType
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetadataType.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetadataType.java
deleted file mode 100644
index f7a5ba3..0000000
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetadataType.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Metadata Type</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType#getMetaentry <em>Metaentry</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetadataType()
- * @model extendedMetaData="name='metadata_._type' kind='elementOnly'"
- * @generated
- */
-public interface MetadataType extends EObject {
- /**
- * Returns the value of the '<em><b>Metaentry</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Metaentry</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Metaentry</em>' containment reference list.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetadataType_Metaentry()
- * @model containment="true" required="true"
- * extendedMetaData="kind='element' name='metaentry' namespace='##targetNamespace'"
- * @generated
- */
- EList<MetaentryType> getMetaentry();
-
-} // MetadataType
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetaentryType.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetaentryType.java
deleted file mode 100644
index a69f257..0000000
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/MetaentryType.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Metaentry Type</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetaentryType()
- * @model extendedMetaData="name='metaentry_._type' kind='elementOnly'"
- * @generated
- */
-public interface MetaentryType extends EObject {
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetaentryType_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * extendedMetaData="kind='element' name='name' namespace='##targetNamespace'"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' attribute.
- * @see #setValue(String)
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage#getMetaentryType_Value()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * extendedMetaData="kind='element' name='value' namespace='##targetNamespace'"
- * @generated
- */
- String getValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType#getValue <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
- * @see #getValue()
- * @generated
- */
- void setValue(String value);
-
-} // MetaentryType
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DocumentRootImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DocumentRootImpl.java
index 0d8e44d..039d301 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DocumentRootImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DocumentRootImpl.java
@@ -9,8 +9,8 @@
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.GlobalType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnEntryScriptType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnExitScriptType;
import org.eclipse.emf.common.notify.Notification;
@@ -29,8 +29,8 @@
* <ul>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DocumentRootImpl#getGlobal <em>Global</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DocumentRootImpl#getImportType <em>Import Type</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DocumentRootImpl#getMetadata <em>Metadata</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DocumentRootImpl#getMetaentry <em>Metaentry</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DocumentRootImpl#getMetaData <em>Meta Data</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DocumentRootImpl#getMetaValue <em>Meta Value</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DocumentRootImpl#getOnEntryScript <em>On Entry Script</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DocumentRootImpl#getOnExitScript <em>On Exit Script</em>}</li>
* <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.DocumentRootImpl#getBpsimData <em>Bpsim Data</em>}</li>
@@ -223,8 +223,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public MetadataType getMetadata() {
- return (MetadataType)getMixed().get(DroolsPackage.Literals.DOCUMENT_ROOT__METADATA, true);
+ public MetaDataType getMetaData() {
+ return (MetaDataType)getMixed().get(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, true);
}
/**
@@ -232,8 +232,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public NotificationChain basicSetMetadata(MetadataType newMetadata, NotificationChain msgs) {
- return ((FeatureMap.Internal)getMixed()).basicAdd(DroolsPackage.Literals.DOCUMENT_ROOT__METADATA, newMetadata, msgs);
+ public NotificationChain basicSetMetaData(MetaDataType newMetaData, NotificationChain msgs) {
+ return ((FeatureMap.Internal)getMixed()).basicAdd(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, newMetaData, msgs);
}
/**
@@ -241,8 +241,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public void setMetadata(MetadataType newMetadata) {
- ((FeatureMap.Internal)getMixed()).set(DroolsPackage.Literals.DOCUMENT_ROOT__METADATA, newMetadata);
+ public void setMetaData(MetaDataType newMetaData) {
+ ((FeatureMap.Internal)getMixed()).set(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, newMetaData);
}
/**
@@ -250,8 +250,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public MetaentryType getMetaentry() {
- return (MetaentryType)getMixed().get(DroolsPackage.Literals.DOCUMENT_ROOT__METAENTRY, true);
+ public MetaValueType getMetaValue() {
+ return (MetaValueType)getMixed().get(DroolsPackage.Literals.DOCUMENT_ROOT__META_VALUE, true);
}
/**
@@ -259,8 +259,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public NotificationChain basicSetMetaentry(MetaentryType newMetaentry, NotificationChain msgs) {
- return ((FeatureMap.Internal)getMixed()).basicAdd(DroolsPackage.Literals.DOCUMENT_ROOT__METAENTRY, newMetaentry, msgs);
+ public NotificationChain basicSetMetaValue(MetaValueType newMetaValue, NotificationChain msgs) {
+ return ((FeatureMap.Internal)getMixed()).basicAdd(DroolsPackage.Literals.DOCUMENT_ROOT__META_VALUE, newMetaValue, msgs);
}
/**
@@ -268,8 +268,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public void setMetaentry(MetaentryType newMetaentry) {
- ((FeatureMap.Internal)getMixed()).set(DroolsPackage.Literals.DOCUMENT_ROOT__METAENTRY, newMetaentry);
+ public void setMetaValue(MetaValueType newMetaValue) {
+ ((FeatureMap.Internal)getMixed()).set(DroolsPackage.Literals.DOCUMENT_ROOT__META_VALUE, newMetaValue);
}
/**
@@ -470,10 +470,10 @@
return basicSetGlobal(null, msgs);
case DroolsPackage.DOCUMENT_ROOT__IMPORT_TYPE:
return basicSetImportType(null, msgs);
- case DroolsPackage.DOCUMENT_ROOT__METADATA:
- return basicSetMetadata(null, msgs);
- case DroolsPackage.DOCUMENT_ROOT__METAENTRY:
- return basicSetMetaentry(null, msgs);
+ case DroolsPackage.DOCUMENT_ROOT__META_DATA:
+ return basicSetMetaData(null, msgs);
+ case DroolsPackage.DOCUMENT_ROOT__META_VALUE:
+ return basicSetMetaValue(null, msgs);
case DroolsPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
return basicSetOnEntryScript(null, msgs);
case DroolsPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
@@ -496,10 +496,10 @@
return getGlobal();
case DroolsPackage.DOCUMENT_ROOT__IMPORT_TYPE:
return getImportType();
- case DroolsPackage.DOCUMENT_ROOT__METADATA:
- return getMetadata();
- case DroolsPackage.DOCUMENT_ROOT__METAENTRY:
- return getMetaentry();
+ case DroolsPackage.DOCUMENT_ROOT__META_DATA:
+ return getMetaData();
+ case DroolsPackage.DOCUMENT_ROOT__META_VALUE:
+ return getMetaValue();
case DroolsPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
return getOnEntryScript();
case DroolsPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
@@ -534,11 +534,11 @@
case DroolsPackage.DOCUMENT_ROOT__IMPORT_TYPE:
setImportType((ImportType)newValue);
return;
- case DroolsPackage.DOCUMENT_ROOT__METADATA:
- setMetadata((MetadataType)newValue);
+ case DroolsPackage.DOCUMENT_ROOT__META_DATA:
+ setMetaData((MetaDataType)newValue);
return;
- case DroolsPackage.DOCUMENT_ROOT__METAENTRY:
- setMetaentry((MetaentryType)newValue);
+ case DroolsPackage.DOCUMENT_ROOT__META_VALUE:
+ setMetaValue((MetaValueType)newValue);
return;
case DroolsPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
setOnEntryScript((OnEntryScriptType)newValue);
@@ -582,11 +582,11 @@
case DroolsPackage.DOCUMENT_ROOT__IMPORT_TYPE:
setImportType((ImportType)null);
return;
- case DroolsPackage.DOCUMENT_ROOT__METADATA:
- setMetadata((MetadataType)null);
+ case DroolsPackage.DOCUMENT_ROOT__META_DATA:
+ setMetaData((MetaDataType)null);
return;
- case DroolsPackage.DOCUMENT_ROOT__METAENTRY:
- setMetaentry((MetaentryType)null);
+ case DroolsPackage.DOCUMENT_ROOT__META_VALUE:
+ setMetaValue((MetaValueType)null);
return;
case DroolsPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
setOnEntryScript((OnEntryScriptType)null);
@@ -628,10 +628,10 @@
return getGlobal() != null;
case DroolsPackage.DOCUMENT_ROOT__IMPORT_TYPE:
return getImportType() != null;
- case DroolsPackage.DOCUMENT_ROOT__METADATA:
- return getMetadata() != null;
- case DroolsPackage.DOCUMENT_ROOT__METAENTRY:
- return getMetaentry() != null;
+ case DroolsPackage.DOCUMENT_ROOT__META_DATA:
+ return getMetaData() != null;
+ case DroolsPackage.DOCUMENT_ROOT__META_VALUE:
+ return getMetaValue() != null;
case DroolsPackage.DOCUMENT_ROOT__ON_ENTRY_SCRIPT:
return getOnEntryScript() != null;
case DroolsPackage.DOCUMENT_ROOT__ON_EXIT_SCRIPT:
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DroolsFactoryImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DroolsFactoryImpl.java
index fa20d71..528b7bc 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DroolsFactoryImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DroolsFactoryImpl.java
@@ -10,8 +10,8 @@
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.GlobalType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnEntryScriptType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnExitScriptType;
import org.eclipse.emf.ecore.EClass;
@@ -38,7 +38,7 @@
*/
public static DroolsFactory init() {
try {
- DroolsFactory theDroolsFactory = (DroolsFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.jboss.org/drools");
+ DroolsFactory theDroolsFactory = (DroolsFactory)EPackage.Registry.INSTANCE.getEFactory(DroolsPackage.eNS_URI);
if (theDroolsFactory != null) {
return theDroolsFactory;
}
@@ -70,8 +70,8 @@
case DroolsPackage.DOCUMENT_ROOT: return createDocumentRoot();
case DroolsPackage.GLOBAL_TYPE: return createGlobalType();
case DroolsPackage.IMPORT_TYPE: return createImportType();
- case DroolsPackage.METADATA_TYPE: return createMetadataType();
- case DroolsPackage.METAENTRY_TYPE: return createMetaentryType();
+ case DroolsPackage.META_DATA_TYPE: return createMetaDataType();
+ case DroolsPackage.META_VALUE_TYPE: return createMetaValueType();
case DroolsPackage.ON_ENTRY_SCRIPT_TYPE: return createOnEntryScriptType();
case DroolsPackage.ON_EXIT_SCRIPT_TYPE: return createOnExitScriptType();
case DroolsPackage.BP_SIM_DATA_TYPE: return createBPSimDataType();
@@ -162,9 +162,9 @@
* <!-- end-user-doc -->
* @generated
*/
- public MetadataType createMetadataType() {
- MetadataTypeImpl metadataType = new MetadataTypeImpl();
- return metadataType;
+ public MetaDataType createMetaDataType() {
+ MetaDataTypeImpl metaDataType = new MetaDataTypeImpl();
+ return metaDataType;
}
/**
@@ -172,9 +172,9 @@
* <!-- end-user-doc -->
* @generated
*/
- public MetaentryType createMetaentryType() {
- MetaentryTypeImpl metaentryType = new MetaentryTypeImpl();
- return metaentryType;
+ public MetaValueType createMetaValueType() {
+ MetaValueTypeImpl metaValueType = new MetaValueTypeImpl();
+ return metaValueType;
}
/**
@@ -213,8 +213,8 @@
* @generated
*/
public ExternalProcess createExternalProcess() {
- ExternalProcessImpl callableElementProxy = new ExternalProcessImpl();
- return callableElementProxy;
+ ExternalProcessImpl externalProcess = new ExternalProcessImpl();
+ return externalProcess;
}
/**
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DroolsPackageImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DroolsPackageImpl.java
index f169545..ce8eee3 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DroolsPackageImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/DroolsPackageImpl.java
@@ -15,8 +15,8 @@
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.GlobalType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnEntryScriptType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnExitScriptType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.util.DroolsValidator;
@@ -64,14 +64,14 @@
* <!-- end-user-doc -->
* @generated
*/
- private EClass metadataTypeEClass = null;
+ private EClass metaDataTypeEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass metaentryTypeEClass = null;
+ private EClass metaValueTypeEClass = null;
/**
* <!-- begin-user-doc -->
@@ -99,7 +99,7 @@
* <!-- end-user-doc -->
* @generated
*/
- private EClass callableElementProxyEClass = null;
+ private EClass externalProcessEClass = null;
/**
* <!-- begin-user-doc -->
@@ -250,7 +250,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public EReference getDocumentRoot_Metadata() {
+ public EReference getDocumentRoot_MetaData() {
return (EReference)documentRootEClass.getEStructuralFeatures().get(2);
}
@@ -259,7 +259,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public EReference getDocumentRoot_Metaentry() {
+ public EReference getDocumentRoot_MetaValue() {
return (EReference)documentRootEClass.getEStructuralFeatures().get(3);
}
@@ -385,8 +385,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public EClass getMetadataType() {
- return metadataTypeEClass;
+ public EClass getMetaDataType() {
+ return metaDataTypeEClass;
}
/**
@@ -394,8 +394,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public EReference getMetadataType_Metaentry() {
- return (EReference)metadataTypeEClass.getEStructuralFeatures().get(0);
+ public EAttribute getMetaDataType_Name() {
+ return (EAttribute)metaDataTypeEClass.getEStructuralFeatures().get(0);
}
/**
@@ -403,8 +403,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public EClass getMetaentryType() {
- return metaentryTypeEClass;
+ public EReference getMetaDataType_MetaValue() {
+ return (EReference)metaDataTypeEClass.getEStructuralFeatures().get(1);
}
/**
@@ -412,8 +412,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getMetaentryType_Name() {
- return (EAttribute)metaentryTypeEClass.getEStructuralFeatures().get(0);
+ public EClass getMetaValueType() {
+ return metaValueTypeEClass;
}
/**
@@ -421,8 +421,17 @@
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getMetaentryType_Value() {
- return (EAttribute)metaentryTypeEClass.getEStructuralFeatures().get(1);
+ public EAttribute getMetaValueType_Mixed() {
+ return (EAttribute)metaValueTypeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMetaValueType_Value() {
+ return (EAttribute)metaValueTypeEClass.getEStructuralFeatures().get(1);
}
/**
@@ -494,7 +503,7 @@
* @generated
*/
public EClass getExternalProcess() {
- return callableElementProxyEClass;
+ return externalProcessEClass;
}
/**
@@ -573,8 +582,8 @@
documentRootEClass = createEClass(DOCUMENT_ROOT);
createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL);
createEReference(documentRootEClass, DOCUMENT_ROOT__IMPORT_TYPE);
- createEReference(documentRootEClass, DOCUMENT_ROOT__METADATA);
- createEReference(documentRootEClass, DOCUMENT_ROOT__METAENTRY);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__META_DATA);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__META_VALUE);
createEReference(documentRootEClass, DOCUMENT_ROOT__ON_ENTRY_SCRIPT);
createEReference(documentRootEClass, DOCUMENT_ROOT__ON_EXIT_SCRIPT);
createEReference(documentRootEClass, DOCUMENT_ROOT__BPSIM_DATA);
@@ -591,12 +600,13 @@
importTypeEClass = createEClass(IMPORT_TYPE);
createEAttribute(importTypeEClass, IMPORT_TYPE__NAME);
- metadataTypeEClass = createEClass(METADATA_TYPE);
- createEReference(metadataTypeEClass, METADATA_TYPE__METAENTRY);
+ metaDataTypeEClass = createEClass(META_DATA_TYPE);
+ createEAttribute(metaDataTypeEClass, META_DATA_TYPE__NAME);
+ createEReference(metaDataTypeEClass, META_DATA_TYPE__META_VALUE);
- metaentryTypeEClass = createEClass(METAENTRY_TYPE);
- createEAttribute(metaentryTypeEClass, METAENTRY_TYPE__NAME);
- createEAttribute(metaentryTypeEClass, METAENTRY_TYPE__VALUE);
+ metaValueTypeEClass = createEClass(META_VALUE_TYPE);
+ createEAttribute(metaValueTypeEClass, META_VALUE_TYPE__MIXED);
+ createEAttribute(metaValueTypeEClass, META_VALUE_TYPE__VALUE);
onEntryScriptTypeEClass = createEClass(ON_ENTRY_SCRIPT_TYPE);
createEAttribute(onEntryScriptTypeEClass, ON_ENTRY_SCRIPT_TYPE__SCRIPT);
@@ -608,7 +618,7 @@
bpSimDataTypeEClass = createEClass(BP_SIM_DATA_TYPE);
- callableElementProxyEClass = createEClass(EXTERNAL_PROCESS);
+ externalProcessEClass = createEClass(EXTERNAL_PROCESS);
// Create data types
packageNameTypeEDataType = createEDataType(PACKAGE_NAME_TYPE);
@@ -654,14 +664,14 @@
documentRootEClass.getESuperTypes().add(theBpmn2Package.getDocumentRoot());
globalTypeEClass.getESuperTypes().add(theBpmn2Package.getItemAwareElement());
bpSimDataTypeEClass.getESuperTypes().add(theBpsimPackage.getBPSimDataType());
- callableElementProxyEClass.getESuperTypes().add(theBpmn2Package.getCallableElement());
+ externalProcessEClass.getESuperTypes().add(theBpmn2Package.getCallableElement());
// Initialize classes and features; add operations and parameters
initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getDocumentRoot_Global(), this.getGlobalType(), null, "global", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEReference(getDocumentRoot_ImportType(), this.getImportType(), null, "importType", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
- initEReference(getDocumentRoot_Metadata(), this.getMetadataType(), null, "metadata", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
- initEReference(getDocumentRoot_Metaentry(), this.getMetaentryType(), null, "metaentry", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_MetaData(), this.getMetaDataType(), null, "metaData", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_MetaValue(), this.getMetaValueType(), null, "metaValue", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEReference(getDocumentRoot_OnEntryScript(), this.getOnEntryScriptType(), null, "onEntryScript", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEReference(getDocumentRoot_OnExitScript(), this.getOnExitScriptType(), null, "onExitScript", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEReference(getDocumentRoot_BpsimData(), theBpsimPackage.getBPSimDataType(), null, "bpsimData", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
@@ -678,12 +688,13 @@
initEClass(importTypeEClass, ImportType.class, "ImportType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getImportType_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, ImportType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEClass(metadataTypeEClass, MetadataType.class, "MetadataType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getMetadataType_Metaentry(), this.getMetaentryType(), null, "metaentry", null, 1, -1, MetadataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(metaDataTypeEClass, MetaDataType.class, "MetaDataType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getMetaDataType_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, MetaDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMetaDataType_MetaValue(), this.getMetaValueType(), null, "metaValue", null, 1, 1, MetaDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEClass(metaentryTypeEClass, MetaentryType.class, "MetaentryType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getMetaentryType_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, MetaentryType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getMetaentryType_Value(), theXMLTypePackage.getString(), "value", null, 1, 1, MetaentryType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(metaValueTypeEClass, MetaValueType.class, "MetaValueType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getMetaValueType_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, MetaValueType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMetaValueType_Value(), ecorePackage.getEString(), "value", null, 1, 1, MetaValueType.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, !IS_ORDERED);
initEClass(onEntryScriptTypeEClass, OnEntryScriptType.class, "OnEntryScriptType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getOnEntryScriptType_Script(), theXMLTypePackage.getString(), "script", null, 1, 1, OnEntryScriptType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -695,7 +706,7 @@
initEClass(bpSimDataTypeEClass, BPSimDataType.class, "BPSimDataType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEClass(callableElementProxyEClass, ExternalProcess.class, "ExternalProcess", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEClass(externalProcessEClass, ExternalProcess.class, "ExternalProcess", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
// Initialize data types
initEDataType(packageNameTypeEDataType, String.class, "PackageNameType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
@@ -719,14 +730,14 @@
* @generated
*/
protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
+ String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
addAnnotation
(documentRootEClass,
source,
new String[] {
"name", "",
"kind", "mixed"
- });
+ });
addAnnotation
(getDocumentRoot_Global(),
source,
@@ -734,7 +745,7 @@
"kind", "element",
"name", "global",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getDocumentRoot_ImportType(),
source,
@@ -742,23 +753,23 @@
"kind", "element",
"name", "import",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
- (getDocumentRoot_Metadata(),
+ (getDocumentRoot_MetaData(),
source,
new String[] {
"kind", "element",
- "name", "metadata",
+ "name", "metaData",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
- (getDocumentRoot_Metaentry(),
+ (getDocumentRoot_MetaValue(),
source,
new String[] {
"kind", "element",
- "name", "metaentry",
+ "name", "metaValue",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getDocumentRoot_OnEntryScript(),
source,
@@ -766,7 +777,7 @@
"kind", "element",
"name", "onEntry-script",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getDocumentRoot_OnExitScript(),
source,
@@ -774,7 +785,7 @@
"kind", "element",
"name", "onExit-script",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getDocumentRoot_BpsimData(),
source,
@@ -782,7 +793,7 @@
"kind", "element",
"name", "BPSimData",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getDocumentRoot_PackageName(),
source,
@@ -790,7 +801,7 @@
"kind", "attribute",
"name", "packageName",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getDocumentRoot_Priority(),
source,
@@ -798,7 +809,7 @@
"kind", "attribute",
"name", "priority",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getDocumentRoot_RuleFlowGroup(),
source,
@@ -806,7 +817,7 @@
"kind", "attribute",
"name", "ruleFlowGroup",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getDocumentRoot_TaskName(),
source,
@@ -814,7 +825,7 @@
"kind", "attribute",
"name", "taskName",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getDocumentRoot_Version(),
source,
@@ -822,87 +833,86 @@
"kind", "attribute",
"name", "version",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(globalTypeEClass,
source,
new String[] {
"name", "global_._type",
"kind", "empty"
- });
+ });
addAnnotation
(getGlobalType_Identifier(),
source,
new String[] {
"kind", "attribute",
"name", "identifier"
- });
+ });
addAnnotation
(getGlobalType_Type(),
source,
new String[] {
"kind", "attribute",
"name", "type"
- });
+ });
addAnnotation
(importTypeEClass,
source,
new String[] {
"name", "import_._type",
"kind", "empty"
- });
+ });
addAnnotation
(getImportType_Name(),
source,
new String[] {
"kind", "attribute",
"name", "name"
- });
+ });
addAnnotation
- (metadataTypeEClass,
+ (metaDataTypeEClass,
source,
new String[] {
- "name", "metadata_._type",
+ "name", "metaData_._type",
"kind", "elementOnly"
- });
+ });
addAnnotation
- (getMetadataType_Metaentry(),
+ (getMetaDataType_Name(),
source,
new String[] {
- "kind", "element",
- "name", "metaentry",
- "namespace", "##targetNamespace"
- });
- addAnnotation
- (metaentryTypeEClass,
- source,
- new String[] {
- "name", "metaentry_._type",
- "kind", "elementOnly"
- });
- addAnnotation
- (getMetaentryType_Name(),
- source,
- new String[] {
- "kind", "element",
+ "kind", "attribute",
"name", "name",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
- (getMetaentryType_Value(),
+ (getMetaDataType_MetaValue(),
source,
new String[] {
"kind", "element",
- "name", "value",
+ "name", "metaValue",
"namespace", "##targetNamespace"
- });
+ });
+ addAnnotation
+ (metaValueTypeEClass,
+ source,
+ new String[] {
+ "name", "metaValue_._type",
+ "kind", "mixed"
+ });
+ addAnnotation
+ (getMetaValueType_Mixed(),
+ source,
+ new String[] {
+ "kind", "elementWildcard",
+ "name", ":mixed"
+ });
addAnnotation
(onEntryScriptTypeEClass,
source,
new String[] {
"name", "onEntry-script_._type",
"kind", "elementOnly"
- });
+ });
addAnnotation
(getOnEntryScriptType_Script(),
source,
@@ -910,21 +920,21 @@
"kind", "element",
"name", "script",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getOnEntryScriptType_ScriptFormat(),
source,
new String[] {
"kind", "attribute",
"name", "scriptFormat"
- });
+ });
addAnnotation
(onExitScriptTypeEClass,
source,
new String[] {
"name", "onExit-script_._type",
"kind", "elementOnly"
- });
+ });
addAnnotation
(getOnExitScriptType_Script(),
source,
@@ -932,21 +942,21 @@
"kind", "element",
"name", "script",
"namespace", "##targetNamespace"
- });
+ });
addAnnotation
(getOnExitScriptType_ScriptFormat(),
source,
new String[] {
"kind", "attribute",
"name", "scriptFormat"
- });
+ });
addAnnotation
(packageNameTypeEDataType,
source,
new String[] {
"name", "packageName_._type",
"baseType", "http://www.eclipse.org/emf/2003/XMLType#string"
- });
+ });
addAnnotation
(priorityTypeEDataType,
source,
@@ -954,21 +964,21 @@
"name", "priority_._type",
"baseType", "http://www.eclipse.org/emf/2003/XMLType#integer",
"minInclusive", "1"
- });
+ });
addAnnotation
(ruleFlowGroupTypeEDataType,
source,
new String[] {
"name", "ruleFlowGroup_._type",
"baseType", "http://www.eclipse.org/emf/2003/XMLType#string"
- });
+ });
addAnnotation
(taskNameTypeEDataType,
source,
new String[] {
"name", "taskName_._type",
"baseType", "http://www.eclipse.org/emf/2003/XMLType#string"
- });
+ });
addAnnotation
(versionTypeEDataType,
source,
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetaDataTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetaDataTypeImpl.java
new file mode 100644
index 0000000..6dcfe65
--- /dev/null
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetaDataTypeImpl.java
@@ -0,0 +1,245 @@
+/**
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl;
+
+import java.util.Collection;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>MetaData Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaDataTypeImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaDataTypeImpl#getMetaValue <em>Meta Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class MetaDataTypeImpl extends EObjectImpl implements MetaDataType {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+ /**
+ * The cached value of the '{@link #getMetaValue() <em>Meta Value</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMetaValue()
+ * @generated
+ * @ordered
+ */
+ protected MetaValueType metaValue;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MetaDataTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return DroolsPackage.Literals.META_DATA_TYPE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, DroolsPackage.META_DATA_TYPE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MetaValueType getMetaValue() {
+ return metaValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetMetaValue(MetaValueType newMetaValue, NotificationChain msgs) {
+ MetaValueType oldMetaValue = metaValue;
+ metaValue = newMetaValue;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DroolsPackage.META_DATA_TYPE__META_VALUE, oldMetaValue, newMetaValue);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setMetaValue(MetaValueType newMetaValue) {
+ if (newMetaValue != metaValue) {
+ NotificationChain msgs = null;
+ if (metaValue != null)
+ msgs = ((InternalEObject)metaValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DroolsPackage.META_DATA_TYPE__META_VALUE, null, msgs);
+ if (newMetaValue != null)
+ msgs = ((InternalEObject)newMetaValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DroolsPackage.META_DATA_TYPE__META_VALUE, null, msgs);
+ msgs = basicSetMetaValue(newMetaValue, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, DroolsPackage.META_DATA_TYPE__META_VALUE, newMetaValue, newMetaValue));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case DroolsPackage.META_DATA_TYPE__META_VALUE:
+ return basicSetMetaValue(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case DroolsPackage.META_DATA_TYPE__NAME:
+ return getName();
+ case DroolsPackage.META_DATA_TYPE__META_VALUE:
+ return getMetaValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case DroolsPackage.META_DATA_TYPE__NAME:
+ setName((String)newValue);
+ return;
+ case DroolsPackage.META_DATA_TYPE__META_VALUE:
+ setMetaValue((MetaValueType)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case DroolsPackage.META_DATA_TYPE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case DroolsPackage.META_DATA_TYPE__META_VALUE:
+ setMetaValue((MetaValueType)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case DroolsPackage.META_DATA_TYPE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case DroolsPackage.META_DATA_TYPE__META_VALUE:
+ return metaValue != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //MetaDataTypeImpl
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetaValueTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetaValueTypeImpl.java
new file mode 100644
index 0000000..b31e787
--- /dev/null
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetaValueTypeImpl.java
@@ -0,0 +1,220 @@
+/**
+ */
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl;
+
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.BasicFeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>MetaValue Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaValueTypeImpl#getMixed <em>Mixed</em>}</li>
+ * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaValueTypeImpl#getValue <em>Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class MetaValueTypeImpl extends EObjectImpl implements MetaValueType {
+ /**
+ * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMixed()
+ * @generated
+ * @ordered
+ */
+ protected FeatureMap mixed;
+
+ /**
+ * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MetaValueTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return DroolsPackage.Literals.META_VALUE_TYPE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FeatureMap getMixed() {
+ if (mixed == null) {
+ mixed = new BasicFeatureMap(this, DroolsPackage.META_VALUE_TYPE__MIXED);
+ }
+ return mixed;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getValue() {
+ if (mixed != null) {
+ StringBuilder result = new StringBuilder();
+ for (FeatureMap.Entry cur : mixed) {
+ switch (cur.getEStructuralFeature().getFeatureID()) {
+ case XMLTypePackage.XML_TYPE_DOCUMENT_ROOT__CDATA:
+ case XMLTypePackage.XML_TYPE_DOCUMENT_ROOT__TEXT:
+ result.append(cur.getValue());
+ break;
+
+ default:
+ break;
+ }
+ }
+ return result.toString();
+ }
+
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setValue(String newValue) {
+ getMixed().clear();
+ FeatureMap.Entry cdata = FeatureMapUtil.createCDATAEntry(newValue);
+ getMixed().add(cdata);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case DroolsPackage.META_VALUE_TYPE__MIXED:
+ return ((InternalEList<?>)getMixed()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case DroolsPackage.META_VALUE_TYPE__MIXED:
+ if (coreType) return getMixed();
+ return ((FeatureMap.Internal)getMixed()).getWrapper();
+ case DroolsPackage.META_VALUE_TYPE__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case DroolsPackage.META_VALUE_TYPE__MIXED:
+ ((FeatureMap.Internal)getMixed()).set(newValue);
+ return;
+ case DroolsPackage.META_VALUE_TYPE__VALUE:
+ setValue((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case DroolsPackage.META_VALUE_TYPE__MIXED:
+ getMixed().clear();
+ return;
+ case DroolsPackage.META_VALUE_TYPE__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case DroolsPackage.META_VALUE_TYPE__MIXED:
+ return mixed != null && !mixed.isEmpty();
+ case DroolsPackage.META_VALUE_TYPE__VALUE:
+ return VALUE_EDEFAULT == null ? getValue() != null : !VALUE_EDEFAULT.equals(getValue());
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (mixed: ");
+ result.append(mixed);
+ result.append(')');
+ return result.toString();
+ }
+
+} //MetaValueTypeImpl
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetadataTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetadataTypeImpl.java
deleted file mode 100644
index a8b9143..0000000
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetadataTypeImpl.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl;
-
-import java.util.Collection;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Metadata Type</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetadataTypeImpl#getMetaentry <em>Metaentry</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class MetadataTypeImpl extends EObjectImpl implements MetadataType {
- /**
- * The cached value of the '{@link #getMetaentry() <em>Metaentry</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMetaentry()
- * @generated
- * @ordered
- */
- protected EList<MetaentryType> metaentry;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected MetadataTypeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return DroolsPackage.Literals.METADATA_TYPE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList<MetaentryType> getMetaentry() {
- if (metaentry == null) {
- metaentry = new EObjectContainmentEList<MetaentryType>(MetaentryType.class, this, DroolsPackage.METADATA_TYPE__METAENTRY);
- }
- return metaentry;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DroolsPackage.METADATA_TYPE__METAENTRY:
- return ((InternalEList<?>)getMetaentry()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DroolsPackage.METADATA_TYPE__METAENTRY:
- return getMetaentry();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DroolsPackage.METADATA_TYPE__METAENTRY:
- getMetaentry().clear();
- getMetaentry().addAll((Collection<? extends MetaentryType>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case DroolsPackage.METADATA_TYPE__METAENTRY:
- getMetaentry().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DroolsPackage.METADATA_TYPE__METAENTRY:
- return metaentry != null && !metaentry.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //MetadataTypeImpl
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetaentryTypeImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetaentryTypeImpl.java
deleted file mode 100644
index e750144..0000000
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/impl/MetaentryTypeImpl.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/**
- */
-package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl;
-
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Metaentry Type</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaentryTypeImpl#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.impl.MetaentryTypeImpl#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class MetaentryTypeImpl extends EObjectImpl implements MetaentryType {
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected String value = VALUE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected MetaentryTypeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return DroolsPackage.Literals.METAENTRY_TYPE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DroolsPackage.METAENTRY_TYPE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getValue() {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setValue(String newValue) {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DroolsPackage.METAENTRY_TYPE__VALUE, oldValue, value));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DroolsPackage.METAENTRY_TYPE__NAME:
- return getName();
- case DroolsPackage.METAENTRY_TYPE__VALUE:
- return getValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DroolsPackage.METAENTRY_TYPE__NAME:
- setName((String)newValue);
- return;
- case DroolsPackage.METAENTRY_TYPE__VALUE:
- setValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case DroolsPackage.METAENTRY_TYPE__NAME:
- setName(NAME_EDEFAULT);
- return;
- case DroolsPackage.METAENTRY_TYPE__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DroolsPackage.METAENTRY_TYPE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case DroolsPackage.METAENTRY_TYPE__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", value: ");
- result.append(value);
- result.append(')');
- return result.toString();
- }
-
-} //MetaentryTypeImpl
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsAdapterFactory.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsAdapterFactory.java
index 1f73f80..d744998 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsAdapterFactory.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsAdapterFactory.java
@@ -11,8 +11,8 @@
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.GlobalType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnEntryScriptType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnExitScriptType;
import org.eclipse.emf.common.notify.Adapter;
@@ -89,12 +89,12 @@
return createImportTypeAdapter();
}
@Override
- public Adapter caseMetadataType(MetadataType object) {
- return createMetadataTypeAdapter();
+ public Adapter caseMetaDataType(MetaDataType object) {
+ return createMetaDataTypeAdapter();
}
@Override
- public Adapter caseMetaentryType(MetaentryType object) {
- return createMetaentryTypeAdapter();
+ public Adapter caseMetaValueType(MetaValueType object) {
+ return createMetaValueTypeAdapter();
}
@Override
public Adapter caseOnEntryScriptType(OnEntryScriptType object) {
@@ -199,30 +199,30 @@
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType <em>Metadata Type</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType <em>Meta Data Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType
* @generated
*/
- public Adapter createMetadataTypeAdapter() {
+ public Adapter createMetaDataTypeAdapter() {
return null;
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType <em>Metaentry Type</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType <em>Meta Value Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
- * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType
+ * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType
* @generated
*/
- public Adapter createMetaentryTypeAdapter() {
+ public Adapter createMetaValueTypeAdapter() {
return null;
}
@@ -269,7 +269,7 @@
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ExternalProcess <em>Callable Element Proxy</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ExternalProcess <em>External Process</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsResourceImpl.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsResourceImpl.java
index 667f6c1..21c2e44 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsResourceImpl.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsResourceImpl.java
@@ -13,6 +13,7 @@
package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.util;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -30,21 +31,18 @@
import org.eclipse.bpmn2.DataOutputAssociation;
import org.eclipse.bpmn2.DataStore;
import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Error;
-import org.eclipse.bpmn2.Escalation;
import org.eclipse.bpmn2.Event;
+import org.eclipse.bpmn2.ExtensionAttributeValue;
import org.eclipse.bpmn2.InputSet;
import org.eclipse.bpmn2.Interface;
import org.eclipse.bpmn2.ItemAwareElement;
import org.eclipse.bpmn2.ItemDefinition;
import org.eclipse.bpmn2.LoopCharacteristics;
-import org.eclipse.bpmn2.Message;
import org.eclipse.bpmn2.MultiInstanceLoopCharacteristics;
import org.eclipse.bpmn2.OutputSet;
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.Property;
import org.eclipse.bpmn2.RootElement;
-import org.eclipse.bpmn2.Signal;
import org.eclipse.bpmn2.ThrowEvent;
import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceImpl;
import org.eclipse.bpmn2.modeler.core.model.ModelDecorator;
@@ -54,6 +52,8 @@
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ExternalProcess;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.GlobalType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.preferences.JbpmPreferencePage;
import org.eclipse.bpmn2.util.Bpmn2ResourceImpl;
import org.eclipse.emf.common.util.EList;
@@ -68,6 +68,7 @@
import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.BasicInternalEList;
import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.xmi.XMLHelper;
import org.eclipse.emf.ecore.xmi.XMLLoad;
import org.eclipse.emf.ecore.xmi.XMLResource;
@@ -127,15 +128,17 @@
if (o instanceof ExternalProcess) {
return;
}
+ if (o instanceof MetaDataType) {
+ if (((MetaDataType)o).getName()==null || ((MetaDataType)o).getName().isEmpty()) {
+ return;
+ }
+ }
super.saveElement(o, f);
}
@Override
protected boolean shouldSaveFeature(EObject o, EStructuralFeature f) {
- if (Bpmn2Package.eINSTANCE.getDocumentation_Text().equals(f))
- return false;
-
if (f==Bpmn2Package.eINSTANCE.getDefinitions_Relationships()) {
if (!JbpmPreferencePage.isEnableSimulation())
return false;
@@ -143,7 +146,11 @@
if (o instanceof GlobalType && f==Bpmn2Package.eINSTANCE.getBaseElement_Id()) {
return false;
}
-
+ if (o instanceof MetaValueType && f==DroolsPackage.eINSTANCE.getMetaValueType_Value()) {
+ // the MetaValue.value will already be saved as CData, so no need to duplicate
+ return false;
+ }
+
// workaround for Bug 430953 don't save the following collections:
//
// OutputSet
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsSwitch.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsSwitch.java
index 56b6131..44c53fa 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsSwitch.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsSwitch.java
@@ -11,8 +11,8 @@
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.GlobalType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnEntryScriptType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnExitScriptType;
import org.eclipse.emf.ecore.EObject;
@@ -97,15 +97,15 @@
if (result == null) result = defaultCase(theEObject);
return result;
}
- case DroolsPackage.METADATA_TYPE: {
- MetadataType metadataType = (MetadataType)theEObject;
- T result = caseMetadataType(metadataType);
+ case DroolsPackage.META_DATA_TYPE: {
+ MetaDataType metaDataType = (MetaDataType)theEObject;
+ T result = caseMetaDataType(metaDataType);
if (result == null) result = defaultCase(theEObject);
return result;
}
- case DroolsPackage.METAENTRY_TYPE: {
- MetaentryType metaentryType = (MetaentryType)theEObject;
- T result = caseMetaentryType(metaentryType);
+ case DroolsPackage.META_VALUE_TYPE: {
+ MetaValueType metaValueType = (MetaValueType)theEObject;
+ T result = caseMetaValueType(metaValueType);
if (result == null) result = defaultCase(theEObject);
return result;
}
@@ -129,11 +129,11 @@
return result;
}
case DroolsPackage.EXTERNAL_PROCESS: {
- ExternalProcess callableElementProxy = (ExternalProcess)theEObject;
- T result = caseExternalProcess(callableElementProxy);
- if (result == null) result = caseCallableElement(callableElementProxy);
- if (result == null) result = caseRootElement(callableElementProxy);
- if (result == null) result = caseBaseElement(callableElementProxy);
+ ExternalProcess externalProcess = (ExternalProcess)theEObject;
+ T result = caseExternalProcess(externalProcess);
+ if (result == null) result = caseCallableElement(externalProcess);
+ if (result == null) result = caseRootElement(externalProcess);
+ if (result == null) result = caseBaseElement(externalProcess);
if (result == null) result = defaultCase(theEObject);
return result;
}
@@ -187,32 +187,32 @@
}
/**
- * Returns the result of interpreting the object as an instance of '<em>Metadata Type</em>'.
+ * Returns the result of interpreting the object as an instance of '<em>Meta Data Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Metadata Type</em>'.
+ * @return the result of interpreting the object as an instance of '<em>Meta Data Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
- public T caseMetadataType(MetadataType object) {
+ public T caseMetaDataType(MetaDataType object) {
return null;
}
/**
- * Returns the result of interpreting the object as an instance of '<em>Metaentry Type</em>'.
+ * Returns the result of interpreting the object as an instance of '<em>Meta Value Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Metaentry Type</em>'.
+ * @return the result of interpreting the object as an instance of '<em>Meta Value Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
- public T caseMetaentryType(MetaentryType object) {
+ public T caseMetaValueType(MetaValueType object) {
return null;
}
@@ -262,13 +262,13 @@
}
/**
- * Returns the result of interpreting the object as an instance of '<em>Callable Element Proxy</em>'.
+ * Returns the result of interpreting the object as an instance of '<em>External Process</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Callable Element Proxy</em>'.
+ * @return the result of interpreting the object as an instance of '<em>External Process</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsValidator.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsValidator.java
index 0e7339c..4833bd2 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsValidator.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/model/drools/util/DroolsValidator.java
@@ -10,8 +10,8 @@
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.GlobalType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ImportType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetadataType;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaentryType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnEntryScriptType;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnExitScriptType;
import org.eclipse.emf.common.util.DiagnosticChain;
@@ -107,10 +107,10 @@
return validateGlobalType((GlobalType)value, diagnostics, context);
case DroolsPackage.IMPORT_TYPE:
return validateImportType((ImportType)value, diagnostics, context);
- case DroolsPackage.METADATA_TYPE:
- return validateMetadataType((MetadataType)value, diagnostics, context);
- case DroolsPackage.METAENTRY_TYPE:
- return validateMetaentryType((MetaentryType)value, diagnostics, context);
+ case DroolsPackage.META_DATA_TYPE:
+ return validateMetaDataType((MetaDataType)value, diagnostics, context);
+ case DroolsPackage.META_VALUE_TYPE:
+ return validateMetaValueType((MetaValueType)value, diagnostics, context);
case DroolsPackage.ON_ENTRY_SCRIPT_TYPE:
return validateOnEntryScriptType((OnEntryScriptType)value, diagnostics, context);
case DroolsPackage.ON_EXIT_SCRIPT_TYPE:
@@ -166,8 +166,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public boolean validateMetadataType(MetadataType metadataType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return validate_EveryDefaultConstraint(metadataType, diagnostics, context);
+ public boolean validateMetaDataType(MetaDataType metaDataType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(metaDataType, diagnostics, context);
}
/**
@@ -175,8 +175,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public boolean validateMetaentryType(MetaentryType metaentryType, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return validate_EveryDefaultConstraint(metaentryType, diagnostics, context);
+ public boolean validateMetaValueType(MetaValueType metaValueType, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(metaValueType, diagnostics, context);
}
/**
@@ -211,8 +211,8 @@
* <!-- end-user-doc -->
* @generated
*/
- public boolean validateExternalProcess(ExternalProcess callableElementProxy, DiagnosticChain diagnostics, Map<Object, Object> context) {
- return validate_EveryDefaultConstraint(callableElementProxy, diagnostics, context);
+ public boolean validateExternalProcess(ExternalProcess externalProcess, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ return validate_EveryDefaultConstraint(externalProcess, diagnostics, context);
}
/**
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDescriptionPropertySection.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDescriptionPropertySection.java
index 0806d5c..fa40275 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDescriptionPropertySection.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmDescriptionPropertySection.java
@@ -14,15 +14,37 @@
package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Factory;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.ExtensionAttributeValue;
import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.di.BPMNDiagram;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.IConstants;
+import org.eclipse.bpmn2.modeler.core.adapters.InsertionAdapter;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextAndButtonObjectEditor;
+import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextObjectEditor;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.MetaDataTypeAdapter;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsFactory;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage;
import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ExternalProcess;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType;
import org.eclipse.bpmn2.modeler.ui.property.DescriptionPropertySection;
+import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.FeatureMap.Entry;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
/**
* This is an empty tab section which simply exists to hide the "Basic" tab
@@ -33,6 +55,9 @@
*/
public class JbpmDescriptionPropertySection extends DescriptionPropertySection {
+ MetaDataType metaData = null;
+ MetaValueType metaValue = null;
+
@Override
protected AbstractDetailComposite createSectionRoot() {
return new JbpmDescriptionPropertyComposite(this);
@@ -59,7 +84,7 @@
}
@Override
- public void createBindings(EObject be) {
+ public void createBindings(final EObject be) {
// for BPMNDiagram objects, pick out the Process and render the Process attributes
Process process = null;
if (be instanceof Participant) {
@@ -92,11 +117,90 @@
// bindList(process, "properties"); // this has moved to JbpmDataItemsDetailComposite
// bindList(process, "laneSets"); // don't need this
}
+ if (be instanceof BaseElement) {
+ bindMetaData((BaseElement) be);
+ }
}
@Override
protected void bindAppearance(EObject be) {
// TODO: support the color/appearance extensions defined by jBPM Web Designer
}
+
+ @Override
+ public void notifyChanged(Notification notification) {
+ super.notifyChanged(notification);
+ }
+
+ protected void bindMetaData(final BaseElement be) {
+ if (isModelObjectEnabled(DroolsPackage.eINSTANCE.getMetaDataType())) {
+ Composite section = createSectionComposite(this, "Metadata");
+ metaData = null;
+ metaValue = null;
+ for (ExtensionAttributeValue eav : be.getExtensionValues()) {
+ for (Entry entry : eav.getValue()) {
+ if (entry.getValue() instanceof MetaDataType) {
+ metaData = (MetaDataType) entry.getValue();
+ metaValue = metaData.getMetaValue();
+ }
+ }
+ }
+ if (metaData==null) {
+ Button button = toolkit.createButton(section, "Add MetaData", SWT.PUSH);
+ toolkit.createLabel(section, "");
+ toolkit.createLabel(section, "");
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain();
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ metaValue = DroolsFactory.eINSTANCE.createMetaValueType();
+ metaValue.setValue("");
+ metaData = DroolsFactory.eINSTANCE.createMetaDataType();
+ MetaDataTypeAdapter.adapt(metaData);
+ metaData.setMetaValue(metaValue);
+ ExtensionAttributeValue eav = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue();
+ eav.getValue().add(DroolsPackage.eINSTANCE.getDocumentRoot_MetaData(), metaData);
+ be.getExtensionValues().add(eav);
+ setBusinessObject(be);
+ }
+ });
+ }
+ });
+ }
+ else {
+ TextObjectEditor nameEditor = new TextObjectEditor(this, metaData, DroolsPackage.eINSTANCE.getMetaDataType_Name());
+ TextObjectEditor valueEditor = new TextObjectEditor(this, metaValue, DroolsPackage.eINSTANCE.getMetaValueType_Value());
+ nameEditor.createControl(section, "Name");
+ valueEditor.createControl(section, "Value");
+
+ toolkit.createLabel(section, "");
+ Button button = toolkit.createButton(section, "Remove MetaData", SWT.PUSH);
+ toolkit.createLabel(section, "");
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain();
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ for (ExtensionAttributeValue eav : be.getExtensionValues()) {
+ if (eav.getValue().size()>0 && eav.getValue().getValue(0)==metaData) {
+ be.getExtensionValues().remove(eav);
+ break;
+ }
+ }
+ metaValue = null;
+ metaData = null;
+ setBusinessObject(be);
+ }
+ });
+ }
+ });
+ }
+ }
+ }
}
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfaceDetailComposite.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfaceDetailComposite.java
index 28fe557..0c1410c 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfaceDetailComposite.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfaceDetailComposite.java
@@ -14,7 +14,6 @@
import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesProvider;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
import org.eclipse.bpmn2.modeler.ui.property.data.InterfaceDetailComposite;
-import org.eclipse.bpmn2.modeler.ui.property.editors.SchemaObjectEditor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.swt.widgets.Composite;
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacePropertySection.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacePropertySection.java
index e123f2d..9de14d0 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacePropertySection.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacePropertySection.java
@@ -1,120 +1,29 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012, 2013 Red Hat, Inc.
- * All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ * Copyright (c) 2011, 2012 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *******************************************************************************/
package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Interface;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmInterfaceImportDialog;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil.ImportHandler;
import org.eclipse.bpmn2.modeler.ui.property.data.InterfacePropertySection;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
public class JbpmInterfacePropertySection extends InterfacePropertySection {
- public JbpmInterfacePropertySection() {
- super();
- }
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmInterfaceDetailComposite(this);
+ }
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new JbpmInterfaceSectionRoot(this);
- }
-
- public class JbpmInterfaceSectionRoot extends InterfaceSectionRoot {
-
- public JbpmInterfaceSectionRoot(Composite parent, int style) {
- super(parent, style);
- }
-
- public JbpmInterfaceSectionRoot(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public void createBindings(EObject be) {
- definedInterfacesTable = new JbpmDefinedInterfaceListComposite(this);
- definedInterfacesTable.bindList(be);
- }
-
- }
-
- private class JbpmDefinedInterfaceListComposite extends DefinedInterfaceListComposite {
-
- public JbpmDefinedInterfaceListComposite(Composite parent) {
- super(parent);
- }
-
- @Override
- public void bindList(EObject theobject) {
- // TODO: push this up to super
- // this also requires that the JbpmImportDialog is moved to the core plugin
- // also JbpmModelUtil.ImportHandler
- super.bindList(theobject);
- ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/20/import.png"); //$NON-NLS-1$
- Action importAction = new Action(Messages.JbpmInterfacePropertySection_Import_Action, id) {
- @Override
- public void run() {
- super.run();
- editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
- @Override
- protected void doExecute() {
- EObject newItem = importListItem(businessObject, feature);
- if (newItem != null) {
- final EList<EObject> list = (EList<EObject>) businessObject.eGet(feature);
- tableViewer.setInput(list);
- tableViewer.setSelection(new StructuredSelection(newItem));
- //showDetails(true);
- }
- }
- });
- }
- };
- tableToolBarManager.insert(1, new ActionContributionItem(importAction));
- tableToolBarManager.update(true);
- }
-
- protected EObject importListItem(EObject object, EStructuralFeature feature) {
- final JbpmInterfaceImportDialog dialog = new JbpmInterfaceImportDialog();
- dialog.open();
- final IType selectedType = dialog.getIType();
- final Definitions definitions = ModelUtil.getDefinitions(object);
- if (selectedType == null || definitions==null) {
- return null;
- }
-
- // add this IType to the list of <import> extension elements
- JbpmModelUtil.addImport(selectedType, object, false, dialog.isCreateVariables());
-
- ImportHandler importer = new ImportHandler();
- importer.setCreateVariables( dialog.isCreateVariables() );
-
- final Interface iface = importer.createInterface(definitions, null, selectedType, dialog.getIMethods());
- EList<EObject> list = (EList<EObject>) object.eGet(feature);
- list.add(iface);
- return iface;
- }
- }
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmInterfaceDetailComposite(parent, style);
+ }
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacesPropertySection.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacesPropertySection.java
new file mode 100644
index 0000000..6159c4f
--- /dev/null
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacesPropertySection.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012, 2013 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmInterfaceImportDialog;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil.ImportHandler;
+import org.eclipse.bpmn2.modeler.ui.property.data.InterfacesPropertySection;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+public class JbpmInterfacesPropertySection extends InterfacesPropertySection {
+
+ public JbpmInterfacesPropertySection() {
+ super();
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmInterfacesSectionRoot(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmInterfacesSectionRoot(parent,style);
+ }
+
+ public class JbpmInterfacesSectionRoot extends InterfacesSectionRoot {
+
+ public JbpmInterfacesSectionRoot(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public JbpmInterfacesSectionRoot(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ definedInterfacesTable = new JbpmDefinedInterfaceListComposite(this);
+ definedInterfacesTable.bindList(be);
+ }
+
+ }
+
+ private class JbpmDefinedInterfaceListComposite extends DefinedInterfaceListComposite {
+
+ public JbpmDefinedInterfaceListComposite(Composite parent) {
+ super(parent);
+ }
+
+ @Override
+ public void bindList(EObject theobject) {
+ // TODO: push this up to super
+ // this also requires that the JbpmImportDialog is moved to the core plugin
+ // also JbpmModelUtil.ImportHandler
+ super.bindList(theobject);
+ ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/20/import.png"); //$NON-NLS-1$
+ Action importAction = new Action(Messages.JbpmInterfacePropertySection_Import_Action, id) {
+ @Override
+ public void run() {
+ super.run();
+ editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
+ @Override
+ protected void doExecute() {
+ EObject newItem = importListItem(businessObject, feature);
+ if (newItem != null) {
+ final EList<EObject> list = (EList<EObject>) businessObject.eGet(feature);
+ tableViewer.setInput(list);
+ tableViewer.setSelection(new StructuredSelection(newItem));
+ //showDetails(true);
+ }
+ }
+ });
+ }
+ };
+ tableToolBarManager.insert(1, new ActionContributionItem(importAction));
+ tableToolBarManager.update(true);
+ }
+
+ protected EObject importListItem(EObject object, EStructuralFeature feature) {
+ final JbpmInterfaceImportDialog dialog = new JbpmInterfaceImportDialog();
+ dialog.open();
+ final IType selectedType = dialog.getIType();
+ final Definitions definitions = ModelUtil.getDefinitions(object);
+ if (selectedType == null || definitions==null) {
+ return null;
+ }
+
+ // add this IType to the list of <import> extension elements
+ JbpmModelUtil.addImport(selectedType, object, false, dialog.isCreateVariables());
+
+ ImportHandler importer = new ImportHandler();
+ importer.setCreateVariables( dialog.isCreateVariables() );
+
+ final Interface iface = importer.createInterface(definitions, null, selectedType, dialog.getIMethods());
+ EList<EObject> list = (EList<EObject>) object.eGet(feature);
+ list.add(iface);
+ return iface;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/UserTaskValidator.java b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/UserTaskValidator.java
index df04222..2357045 100644
--- a/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/UserTaskValidator.java
+++ b/plugins/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/UserTaskValidator.java
@@ -89,12 +89,12 @@
Bpmn2FeatureMap extensionElements = extattrval.getValue();
if (extensionElements!=null) {
@SuppressWarnings("unchecked")
- List<MetadataType> metadataTypeExtensions = (List<MetadataType>) extensionElements.get(
+ List<MetaDataType> metaDataTypeExtensions = (List<MetaDataType>) extensionElements.get(
DroolsPackage.Literals.DOCUMENT_ROOT__METADATA, true);
- if (metadataTypeExtensions != null && metadataTypeExtensions.size() > 0) {
- MetadataType metaType = metadataTypeExtensions.get(0);
- for (Object metaEntryObj : metaType.getMetaentry()) {
- MetaentryType entry = (MetaentryType) metaEntryObj;
+ if (metaDataTypeExtensions != null && metaDataTypeExtensions.size() > 0) {
+ MetaDataType metaType = metaDataTypeExtensions.get(0);
+ for (Object metaValueObj : metaType.getMetaValue()) {
+ MetaValueType entry = (MetaValueType) metaValueObj;
if (entry.getName() != null && entry.getName().equals("staffavailability")) {
Float f = new Float(entry.getValue());
if (f.floatValue() < 0) {
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/plugin.xml b/plugins/org.eclipse.bpmn2.modeler.ui/plugin.xml
index d1cea9c..0c193e3 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/plugin.xml
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/plugin.xml
@@ -205,16 +205,16 @@
</propertyTab>
<propertyTab
- id="org.eclipse.bpmn2.modeler.interface.tab"
+ id="org.eclipse.bpmn2.modeler.interfaces.tab"
afterTab="org.eclipse.bpmn2.modeler.process.diagram.tab"
- class="org.eclipse.bpmn2.modeler.ui.property.data.InterfacePropertySection"
+ class="org.eclipse.bpmn2.modeler.ui.property.data.InterfacesPropertySection"
type="org.eclipse.bpmn2.Process org.eclipse.bpmn2.Collaboration org.eclipse.bpmn2.Participant"
label="%propertyTab.label.Interfaces">
</propertyTab>
<propertyTab
id="org.eclipse.bpmn2.modeler.definitions.tab"
- afterTab="org.eclipse.bpmn2.modeler.interface.tab"
+ afterTab="org.eclipse.bpmn2.modeler.interfaces.tab"
class="org.eclipse.bpmn2.modeler.ui.property.diagrams.DefinitionsPropertySection"
type="org.eclipse.bpmn2.Definitions"
label="%propertyTab.label.Definitions">
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FormalExpressionPropertiesAdapter.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FormalExpressionPropertiesAdapter.java
index d9898e6..6d1cc7a 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FormalExpressionPropertiesAdapter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/FormalExpressionPropertiesAdapter.java
@@ -111,6 +111,15 @@
public String getTextValue() {
return getFeatureDescriptor(body).getTextValue();
}
+
+ @Override
+ public String getLabel() {
+ if (object.eContainer() instanceof SequenceFlow)
+ return Messages.FormalExpressionPropertiesAdapter_Condition;
+ if (object.eContainer() instanceof ResourceAssignmentExpression)
+ return Messages.FormalExpressionPropertiesAdapter_Actor;
+ return Messages.FormalExpressionPropertiesAdapter_Script;
+ }
});
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/AssociationFeatureContainer.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/AssociationFeatureContainer.java
index 5df4a78..629341f 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/AssociationFeatureContainer.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/AssociationFeatureContainer.java
@@ -19,7 +19,9 @@
import org.eclipse.bpmn2.BoundaryEvent;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.CompensateEventDefinition;
+import org.eclipse.bpmn2.Event;
import org.eclipse.bpmn2.EventDefinition;
+import org.eclipse.bpmn2.Gateway;
import org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2UpdateFeature;
import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer;
import org.eclipse.bpmn2.modeler.core.features.DefaultDeleteBPMNShapeFeature;
@@ -45,6 +47,8 @@
import org.eclipse.graphiti.features.context.IDeleteContext;
import org.eclipse.graphiti.features.context.IReconnectionContext;
import org.eclipse.graphiti.features.context.IUpdateContext;
+import org.eclipse.graphiti.features.context.impl.DeleteContext;
+import org.eclipse.graphiti.features.context.impl.UpdateContext;
import org.eclipse.graphiti.features.impl.Reason;
import org.eclipse.graphiti.mm.algorithms.Polyline;
import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
@@ -52,6 +56,7 @@
import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
@@ -96,6 +101,144 @@
public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
return new DeleteAssociationFeature(fp);
}
+
+ private static void setAssociationDirection(Connection connection, Association businessObject) {
+ IPeService peService = Graphiti.getPeService();
+ IGaService gaService = Graphiti.getGaService();
+ String newDirection = businessObject.getAssociationDirection().toString();
+ if (newDirection==null || newDirection.isEmpty())
+ newDirection = AssociationDirection.NONE.toString();
+ String oldDirection = peService.getPropertyValue(connection, ASSOCIATION_DIRECTION);
+ if (oldDirection==null || oldDirection.isEmpty())
+ oldDirection = AssociationDirection.NONE.toString();
+
+ if (!oldDirection.equals(newDirection)) {
+ ConnectionDecorator sourceDecorator = null;
+ ConnectionDecorator targetDecorator = null;
+ for (ConnectionDecorator d : connection.getConnectionDecorators()) {
+ String s = peService.getPropertyValue(d, ARROWHEAD_DECORATOR);
+ if (s!=null) {
+ if (s.equals("source")) //$NON-NLS-1$
+ sourceDecorator = d;
+ else if (s.equals("target")) //$NON-NLS-1$
+ targetDecorator = d;
+ }
+ }
+
+ boolean needSource = false;
+ boolean needTarget = false;
+ if (newDirection.equals(AssociationDirection.ONE.toString())) {
+ needTarget = true;
+ }
+ else if (newDirection.equals(AssociationDirection.BOTH.toString())) {
+ needSource = needTarget = true;
+ }
+
+ final int w = 7;
+ final int l = 13;
+ if (needSource) {
+ if (sourceDecorator==null) {
+ sourceDecorator = peService.createConnectionDecorator(connection, false, 0.0, true);
+ Polyline arrowhead = gaService.createPolyline(sourceDecorator, new int[] { -l, w, 0, 0, -l, -w });
+ StyleUtil.applyStyle(arrowhead, businessObject);
+ peService.setPropertyValue(sourceDecorator, ARROWHEAD_DECORATOR, "source"); //$NON-NLS-1$
+ }
+ }
+ else {
+ if (sourceDecorator!=null)
+ connection.getConnectionDecorators().remove(sourceDecorator);
+ }
+ if (needTarget) {
+ if (targetDecorator==null) {
+ targetDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);
+ Polyline arrowhead = gaService.createPolyline(targetDecorator, new int[] { -l, w, 0, 0, -l, -w });
+ StyleUtil.applyStyle(arrowhead, businessObject);
+ peService.setPropertyValue(targetDecorator, ARROWHEAD_DECORATOR, "target"); //$NON-NLS-1$
+ }
+ }
+ else {
+ if (targetDecorator!=null)
+ connection.getConnectionDecorators().remove(targetDecorator);
+ }
+
+ // update the property value in the Connection PictogramElement
+ peService.setPropertyValue(connection, ASSOCIATION_DIRECTION, newDirection);
+ }
+
+ }
+
+ private static void updateCompensationHandlers(IFeatureProvider fp, Association association,
+ BaseElement oldSource, BaseElement oldTarget,
+ BaseElement newSource, BaseElement newTarget) {
+ Diagram diagram = fp.getDiagramTypeProvider().getDiagram();
+ boolean oldTargetHasOtherCompensationEvents = false;
+ for (Connection c : diagram.getConnections()) {
+ Association a = BusinessObjectUtil.getFirstElementOfType(c, Association.class);
+ if (a!=null && a.getAssociationDirection()==AssociationDirection.ONE &&
+ a!=association && a.getTargetRef()==oldTarget) {
+ oldTargetHasOtherCompensationEvents = true;
+ break;
+ }
+ }
+ Association oldAssociation = null;
+ for (Connection c : diagram.getConnections()) {
+ Association a = BusinessObjectUtil.getFirstElementOfType(c, Association.class);
+ if (a!=null && a.getAssociationDirection()==AssociationDirection.ONE &&
+ a!=association && a.getSourceRef()==newSource) {
+ oldAssociation = a;
+ break;
+ }
+ }
+
+ if (association.getAssociationDirection()==AssociationDirection.ONE) {
+ if (oldSource instanceof BoundaryEvent && oldTarget instanceof Activity) {
+ // set the Activity reference of the old Boundary Event null
+ CompensateEventDefinition ced = getCompensateEvent(oldSource);
+ if (ced!=null) {
+ ced.setActivityRef(null);
+ if (!oldTargetHasOtherCompensationEvents) {
+ ((Activity)oldTarget).setIsForCompensation(false);
+ PictogramElement pe = fp.getPictogramElementForBusinessObject(oldTarget);
+ IUpdateContext uc = new UpdateContext(pe);
+ IUpdateFeature uf = fp.getUpdateFeature(uc);
+ uf.update(uc);
+ }
+ }
+ }
+ if (newSource instanceof BoundaryEvent && newTarget instanceof Activity) {
+ // Set the Activity reference of the new Boundary Event
+ CompensateEventDefinition ced = getCompensateEvent(newSource);
+ if (ced!=null) {
+ oldTarget = ced.getActivityRef();
+ ced.setActivityRef((Activity)newTarget);
+ ((Activity)newTarget).setIsForCompensation(true);
+ PictogramElement pe = fp.getPictogramElementForBusinessObject(newTarget);
+ IUpdateContext uc = new UpdateContext(pe);
+ IUpdateFeature uf = fp.getUpdateFeature(uc);
+ uf.update(uc);
+
+ if ((oldSource!=newSource || oldTarget!=newTarget) && oldAssociation!=null) {
+ pe = fp.getPictogramElementForBusinessObject(oldAssociation);
+ IDeleteContext dc = new DeleteContext(pe);
+ IDeleteFeature df = fp.getDeleteFeature(dc);
+ df.delete(dc);
+ }
+ }
+ }
+ }
+ }
+
+ private static CompensateEventDefinition getCompensateEvent(BaseElement source) {
+ if (source instanceof BoundaryEvent) {
+ // find a Compensate Event Definition in the BoundaryEvent
+ for (EventDefinition ed : ((BoundaryEvent)source).getEventDefinitions()) {
+ if (ed instanceof CompensateEventDefinition) {
+ return (CompensateEventDefinition) ed;
+ }
+ }
+ }
+ return null;
+ }
public class AddAssociationFeature extends AbstractAddFlowFeature<Association> {
public AddAssociationFeature(IFeatureProvider fp) {
@@ -135,6 +278,11 @@
public boolean isAvailable(IContext context) {
if (!isModelObjectEnabled(Bpmn2Package.eINSTANCE.getAssociation()))
return false;
+ if (context instanceof ICreateConnectionContext) {
+ BaseElement source = getSourceBo((ICreateConnectionContext) context);
+ if (source instanceof Activity || source instanceof Gateway || source instanceof Event)
+ return false;
+ }
return super.isAvailable(context);
}
@@ -217,71 +365,6 @@
}
}
- private static void setAssociationDirection(Connection connection, Association businessObject) {
- IPeService peService = Graphiti.getPeService();
- IGaService gaService = Graphiti.getGaService();
- String newDirection = businessObject.getAssociationDirection().toString();
- if (newDirection==null || newDirection.isEmpty())
- newDirection = AssociationDirection.NONE.toString();
- String oldDirection = peService.getPropertyValue(connection, ASSOCIATION_DIRECTION);
- if (oldDirection==null || oldDirection.isEmpty())
- oldDirection = AssociationDirection.NONE.toString();
-
- if (!oldDirection.equals(newDirection)) {
- ConnectionDecorator sourceDecorator = null;
- ConnectionDecorator targetDecorator = null;
- for (ConnectionDecorator d : connection.getConnectionDecorators()) {
- String s = peService.getPropertyValue(d, ARROWHEAD_DECORATOR);
- if (s!=null) {
- if (s.equals("source")) //$NON-NLS-1$
- sourceDecorator = d;
- else if (s.equals("target")) //$NON-NLS-1$
- targetDecorator = d;
- }
- }
-
- boolean needSource = false;
- boolean needTarget = false;
- if (newDirection.equals(AssociationDirection.ONE.toString())) {
- needTarget = true;
- }
- else if (newDirection.equals(AssociationDirection.BOTH.toString())) {
- needSource = needTarget = true;
- }
-
- final int w = 7;
- final int l = 13;
- if (needSource) {
- if (sourceDecorator==null) {
- sourceDecorator = peService.createConnectionDecorator(connection, false, 0.0, true);
- Polyline arrowhead = gaService.createPolyline(sourceDecorator, new int[] { -l, w, 0, 0, -l, -w });
- StyleUtil.applyStyle(arrowhead, businessObject);
- peService.setPropertyValue(sourceDecorator, ARROWHEAD_DECORATOR, "source"); //$NON-NLS-1$
- }
- }
- else {
- if (sourceDecorator!=null)
- connection.getConnectionDecorators().remove(sourceDecorator);
- }
- if (needTarget) {
- if (targetDecorator==null) {
- targetDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);
- Polyline arrowhead = gaService.createPolyline(targetDecorator, new int[] { -l, w, 0, 0, -l, -w });
- StyleUtil.applyStyle(arrowhead, businessObject);
- peService.setPropertyValue(targetDecorator, ARROWHEAD_DECORATOR, "target"); //$NON-NLS-1$
- }
- }
- else {
- if (targetDecorator!=null)
- connection.getConnectionDecorators().remove(targetDecorator);
- }
-
- // update the property value in the Connection PictogramElement
- peService.setPropertyValue(connection, ASSOCIATION_DIRECTION, newDirection);
- }
-
- }
-
public static class UpdateAssociationFeature extends AbstractBpmn2UpdateFeature {
public UpdateAssociationFeature(IFeatureProvider fp) {
@@ -320,9 +403,13 @@
@Override
public boolean update(IUpdateContext context) {
Connection connection = (Connection) context.getPictogramElement();
- Association businessObject = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
+ Association association = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
Association.class);
- setAssociationDirection(connection, businessObject);
+ setAssociationDirection(connection, association);
+ BaseElement source = association.getSourceRef();
+ BaseElement target = association.getTargetRef();
+ updateCompensationHandlers(getFeatureProvider(), association, source, target, source, target);
+
return true;
}
}
@@ -380,23 +467,9 @@
BaseElement newSource = BusinessObjectUtil.getFirstBaseElement(ac);
ac = context.getConnection().getEnd().getParent();
BaseElement newTarget = BusinessObjectUtil.getFirstBaseElement(ac);
- if (oldSource instanceof BoundaryEvent && oldTarget instanceof Activity) {
- // set the Activity reference of the old Boundary Event null
- CompensateEventDefinition ced = getCompensateEvent(oldSource);
- if (ced!=null) {
- ced.setActivityRef(null);
- ((Activity)oldTarget).setIsForCompensation(false);
- }
- }
- if (newSource instanceof BoundaryEvent && newTarget instanceof Activity) {
- // Set the Activity reference of the new Boundary Event
- CompensateEventDefinition ced = getCompensateEvent(newSource);
- if (ced!=null) {
- ced.setActivityRef((Activity)newTarget);
- ((Activity)newTarget).setIsForCompensation(true);
- }
- }
-
+ Association association = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), Association.class);
+ updateCompensationHandlers(getFeatureProvider(), association, oldSource, oldTarget, newSource, newTarget);
+
super.postReconnect(context);
}
}
@@ -427,29 +500,10 @@
BaseElement oldSource = BusinessObjectUtil.getFirstBaseElement(ac);
ac = connection.getEnd().getParent();
BaseElement oldTarget = BusinessObjectUtil.getFirstBaseElement(ac);
- if (oldSource instanceof BoundaryEvent && oldTarget instanceof Activity) {
- // Set the Activity reference of the new Boundary Event
- CompensateEventDefinition ced = getCompensateEvent(oldSource);
- if (ced!=null) {
- ced.setActivityRef(null);
- ((Activity)oldTarget).setIsForCompensation(false);
- }
- }
-
+ Association association = BusinessObjectUtil.getFirstElementOfType(connection, Association.class);
+ updateCompensationHandlers(getFeatureProvider(), association, oldSource, oldTarget, null, null);
+
super.delete(context);
}
}
-
- private static CompensateEventDefinition getCompensateEvent(BaseElement source) {
- if (source instanceof BoundaryEvent) {
- // find a Compensate Event Definition in the BoundaryEvent
- for (EventDefinition ed : ((BoundaryEvent)source).getEventDefinitions()) {
- if (ed instanceof CompensateEventDefinition) {
- return (CompensateEventDefinition) ed;
- }
- }
- }
- return null;
- }
-
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/StyleChangeAdapter.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/StyleChangeAdapter.java
index 4b1b479..d549711 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/StyleChangeAdapter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/StyleChangeAdapter.java
@@ -14,10 +14,7 @@
package org.eclipse.bpmn2.modeler.ui.property;
import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.ChoreographyActivity;
import org.eclipse.bpmn2.ExtensionAttributeValue;
-import org.eclipse.bpmn2.Lane;
-import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.modeler.core.adapters.IExtensionValueAdapter;
import org.eclipse.bpmn2.modeler.core.di.DIUtils;
import org.eclipse.bpmn2.modeler.core.features.GraphitiConstants;
@@ -34,11 +31,9 @@
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.FeatureMap.Entry;
import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.swt.graphics.FontData;
/**
*
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacePropertySection.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacePropertySection.java
index 6a3a2a2..57b8b84 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacePropertySection.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacePropertySection.java
@@ -11,47 +11,25 @@
package org.eclipse.bpmn2.modeler.ui.property.data;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CallableElement;
-import org.eclipse.bpmn2.Choreography;
-import org.eclipse.bpmn2.Collaboration;
-import org.eclipse.bpmn2.Definitions;
import org.eclipse.bpmn2.Interface;
-import org.eclipse.bpmn2.Participant;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.dialogs.ListDialog;
public class InterfacePropertySection extends DefaultPropertySection {
@Override
protected AbstractDetailComposite createSectionRoot() {
- return new InterfaceSectionRoot(this);
+ return new InterfaceDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new InterfaceDetailComposite(parent, style);
}
public InterfacePropertySection() {
@@ -72,226 +50,10 @@
@Override
public EObject getBusinessObjectForSelection(ISelection selection) {
EObject bo = super.getBusinessObjectForSelection(selection);
- if (
- bo instanceof CallableElement || // includes Process
- bo instanceof Interface ||
- bo instanceof Collaboration // includes Choreography
- ) {
+ if (bo instanceof Interface) {
return bo;
}
return null;
}
-
- public class InterfaceSectionRoot extends InterfaceDetailComposite {
-
- protected DefinedInterfaceListComposite definedInterfacesTable;
- protected ProvidedInterfaceListComposite providedInterfacesTable;
-
- /**
- * @param parent
- * @param style
- */
- public InterfaceSectionRoot(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public InterfaceSectionRoot(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public void cleanBindings() {
- super.cleanBindings();
- definedInterfacesTable = null;
- providedInterfacesTable = null;
- }
-
- @Override
- public void createBindings(EObject be) {
- if (be instanceof Interface) {
- super.createBindings(be);
- }
- else {
- definedInterfacesTable = new DefinedInterfaceListComposite(this);
- definedInterfacesTable.bindList(be);
- definedInterfacesTable.setTitle(Messages.InterfacePropertySection_Interfaces_Title);
-
- if (be instanceof Participant) {
- providedInterfacesTable = new ProvidedInterfaceListComposite(this);
- providedInterfacesTable.bindList(be, getFeature(be, "interfaceRefs")); //$NON-NLS-1$
- }
- else if (be instanceof CallableElement) {
- CallableElement ce = (CallableElement)be;
- providedInterfacesTable = new ProvidedInterfaceListComposite(this);
- providedInterfacesTable.bindList(be, getFeature(be, "supportedInterfaceRefs")); //$NON-NLS-1$
- }
- }
- }
- }
-
- public class DefinedInterfaceListComposite extends DefaultListComposite {
-
- /**
- * @param parent
- */
- public DefinedInterfaceListComposite(Composite parent) {
- super(parent, DEFAULT_STYLE);
- }
-
- @Override
- public EClass getListItemClass(EObject object, EStructuralFeature feature) {
- return listItemClass = Bpmn2Package.eINSTANCE.getInterface();
- }
-
- public void bindList(EObject theobject) {
- Definitions defs = ModelUtil.getDefinitions(theobject);
- super.bindList(defs, Bpmn2Package.eINSTANCE.getDefinitions_RootElements());
- }
-
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- Interface iface = Bpmn2ModelerFactory.create(object.eResource(), Interface.class);
-
- EList<EObject> list = (EList<EObject>)object.eGet(feature);
- list.add(iface);
- return iface;
- }
-
- @Override
- public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
- if (columnProvider==null) {
- columnProvider = new ListCompositeColumnProvider(this);
- TableColumn tc = new TableColumn(object, Bpmn2Package.eINSTANCE.getInterface_Name());
- columnProvider.add(tc);
- tc.setEditable(false);
-
- tc = new TableColumn(object,Bpmn2Package.eINSTANCE.getInterface_ImplementationRef());
- columnProvider.add(tc).setHeaderText(Messages.InterfacePropertySection_Implementation_Header);
- tc.setEditable(false);
- }
- return columnProvider;
- }
- }
-
- public static class ProvidedInterfaceListComposite extends DefaultListComposite {
-
- /**
- * @param parent
- */
- public ProvidedInterfaceListComposite(Composite parent) {
- // only allow details editing in DefinedInterfacesTable
- super(parent, AbstractListComposite.READ_ONLY_STYLE);
- }
-
- public void bindList(final EObject theobject, final EStructuralFeature thefeature) {
- super.bindList(theobject, thefeature);
- if (theobject instanceof Participant)
- setTitle(Messages.InterfacePropertySection_Participant_Title);
- else if (theobject instanceof CallableElement)
- setTitle(Messages.InterfacePropertySection_Process_Title);
- }
-
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- Definitions defs = ModelUtil.getDefinitions(object);
- final List<Interface>items = new ArrayList<Interface>();
- for (EObject o : defs.getRootElements()) {
- if (o instanceof Interface) {
- if (object instanceof Participant) {
- Participant participant = (Participant)object;
- if (!participant.getInterfaceRefs().contains(o))
- items.add((Interface)o);
- } else if (object instanceof CallableElement) {
- CallableElement callableElement = (CallableElement)object;
- if (!callableElement.getSupportedInterfaceRefs().contains(o))
- items.add((Interface)o);
- }
- }
- }
- Interface iface = null;
- ListDialog dialog = new ListDialog(getShell());
- if (items.size()>1) {
- dialog.setContentProvider(new IStructuredContentProvider() {
-
- @Override
- public void dispose() {
- }
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- @Override
- public Object[] getElements(Object inputElement) {
- return items.toArray();
- }
-
- });
- dialog.setLabelProvider(new ILabelProvider() {
-
- @Override
- public void addListener(ILabelProviderListener listener) {
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- @Override
- public void removeListener(ILabelProviderListener listener) {
- }
-
- @Override
- public Image getImage(Object element) {
- return null;
- }
-
- @Override
- public String getText(Object element) {
- return ModelUtil.getName((BaseElement)element);
- }
-
- });
- dialog.setTitle(Messages.InterfacePropertySection_Interfaces_Title);
- dialog.setMessage(Messages.InterfacePropertySection_Interfaces_Message);
- dialog.setAddCancelButton(true);
- dialog.setHelpAvailable(false);
- dialog.setInput(new Object());
-
- if (dialog.open() == Window.OK) {
- iface = (Interface)dialog.getResult()[0];
- }
- }
- else if (items.size()==1) {
- iface = items.get(0);
- }
- else {
- MessageDialog.openInformation(getShell(), Messages.InterfacePropertySection_No_Interfaces_Error_Title,
- Messages.InterfacePropertySection_No_Interfaces_Error_Message
- );
- }
-
- if (iface!=null) {
- if (object instanceof Participant) {
- Participant participant = (Participant)object;
- participant.getInterfaceRefs().add(iface);
- } else if (object instanceof CallableElement) {
- CallableElement callableElement = (CallableElement)object;
- callableElement.getSupportedInterfaceRefs().add(iface);
- }
- }
-
- return iface;
- }
- }
-
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacesPropertySection.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacesPropertySection.java
new file mode 100644
index 0000000..69c2a99
--- /dev/null
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacesPropertySection.java
@@ -0,0 +1,301 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Red Hat, Inc.
+ * All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CallableElement;
+import org.eclipse.bpmn2.Collaboration;
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.dialogs.ListDialog;
+
+public class InterfacesPropertySection extends DefaultPropertySection {
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new InterfacesSectionRoot(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new InterfacesSectionRoot(parent,style);
+ }
+
+ public InterfacesPropertySection() {
+ super();
+ }
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ if (super.appliesTo(part, selection)) {
+ if (isModelObjectEnabled(Bpmn2Package.eINSTANCE.getInterface())) {
+ EObject bo = getBusinessObjectForSelection(selection);
+ return bo!=null;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public EObject getBusinessObjectForSelection(ISelection selection) {
+ EObject bo = super.getBusinessObjectForSelection(selection);
+ if (
+ bo instanceof CallableElement || // includes Process
+ bo instanceof Collaboration // includes Choreography
+ ) {
+ return bo;
+ }
+
+ return null;
+ }
+
+ public class InterfacesSectionRoot extends DefaultDetailComposite {
+
+ protected DefinedInterfaceListComposite definedInterfacesTable;
+ protected ProvidedInterfaceListComposite providedInterfacesTable;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public InterfacesSectionRoot(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public InterfacesSectionRoot(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public void cleanBindings() {
+ super.cleanBindings();
+ definedInterfacesTable = null;
+ providedInterfacesTable = null;
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ if (be instanceof Interface) {
+ super.createBindings(be);
+ }
+ else {
+ definedInterfacesTable = new DefinedInterfaceListComposite(this);
+ definedInterfacesTable.bindList(be);
+ definedInterfacesTable.setTitle(Messages.InterfacePropertySection_Interfaces_Title);
+
+ if (be instanceof Participant) {
+ providedInterfacesTable = new ProvidedInterfaceListComposite(this);
+ providedInterfacesTable.bindList(be, getFeature(be, "interfaceRefs")); //$NON-NLS-1$
+ }
+ else if (be instanceof CallableElement) {
+ CallableElement ce = (CallableElement)be;
+ providedInterfacesTable = new ProvidedInterfaceListComposite(this);
+ providedInterfacesTable.bindList(be, getFeature(be, "supportedInterfaceRefs")); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ public class DefinedInterfaceListComposite extends DefaultListComposite {
+
+ /**
+ * @param parent
+ */
+ public DefinedInterfaceListComposite(Composite parent) {
+ super(parent, DEFAULT_STYLE);
+ }
+
+ @Override
+ public EClass getListItemClass(EObject object, EStructuralFeature feature) {
+ return listItemClass = Bpmn2Package.eINSTANCE.getInterface();
+ }
+
+ public void bindList(EObject theobject) {
+ Definitions defs = ModelUtil.getDefinitions(theobject);
+ super.bindList(defs, Bpmn2Package.eINSTANCE.getDefinitions_RootElements());
+ }
+
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ Interface iface = Bpmn2ModelerFactory.create(object.eResource(), Interface.class);
+
+ EList<EObject> list = (EList<EObject>)object.eGet(feature);
+ list.add(iface);
+ return iface;
+ }
+
+ @Override
+ public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
+ if (columnProvider==null) {
+ columnProvider = new ListCompositeColumnProvider(this);
+ TableColumn tc = new TableColumn(object, Bpmn2Package.eINSTANCE.getInterface_Name());
+ columnProvider.add(tc);
+ tc.setEditable(false);
+
+ tc = new TableColumn(object,Bpmn2Package.eINSTANCE.getInterface_ImplementationRef());
+ columnProvider.add(tc).setHeaderText(Messages.InterfacePropertySection_Implementation_Header);
+ tc.setEditable(false);
+ }
+ return columnProvider;
+ }
+ }
+
+ public static class ProvidedInterfaceListComposite extends DefaultListComposite {
+
+ /**
+ * @param parent
+ */
+ public ProvidedInterfaceListComposite(Composite parent) {
+ // only allow details editing in DefinedInterfacesTable
+ super(parent, AbstractListComposite.READ_ONLY_STYLE);
+ }
+
+ public void bindList(final EObject theobject, final EStructuralFeature thefeature) {
+ super.bindList(theobject, thefeature);
+ if (theobject instanceof Participant)
+ setTitle(Messages.InterfacePropertySection_Participant_Title);
+ else if (theobject instanceof CallableElement)
+ setTitle(Messages.InterfacePropertySection_Process_Title);
+ }
+
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ Definitions defs = ModelUtil.getDefinitions(object);
+ final List<Interface>items = new ArrayList<Interface>();
+ for (EObject o : defs.getRootElements()) {
+ if (o instanceof Interface) {
+ if (object instanceof Participant) {
+ Participant participant = (Participant)object;
+ if (!participant.getInterfaceRefs().contains(o))
+ items.add((Interface)o);
+ } else if (object instanceof CallableElement) {
+ CallableElement callableElement = (CallableElement)object;
+ if (!callableElement.getSupportedInterfaceRefs().contains(o))
+ items.add((Interface)o);
+ }
+ }
+ }
+ Interface iface = null;
+ ListDialog dialog = new ListDialog(getShell());
+ if (items.size()>1) {
+ dialog.setContentProvider(new IStructuredContentProvider() {
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return items.toArray();
+ }
+
+ });
+ dialog.setLabelProvider(new ILabelProvider() {
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ return ModelUtil.getName((BaseElement)element);
+ }
+
+ });
+ dialog.setTitle(Messages.InterfacePropertySection_Interfaces_Title);
+ dialog.setMessage(Messages.InterfacePropertySection_Interfaces_Message);
+ dialog.setAddCancelButton(true);
+ dialog.setHelpAvailable(false);
+ dialog.setInput(new Object());
+
+ if (dialog.open() == Window.OK) {
+ iface = (Interface)dialog.getResult()[0];
+ }
+ }
+ else if (items.size()==1) {
+ iface = items.get(0);
+ }
+ else {
+ MessageDialog.openInformation(getShell(), Messages.InterfacePropertySection_No_Interfaces_Error_Title,
+ Messages.InterfacePropertySection_No_Interfaces_Error_Message
+ );
+ }
+
+ if (iface!=null) {
+ if (object instanceof Participant) {
+ Participant participant = (Participant)object;
+ participant.getInterfaceRefs().add(iface);
+ } else if (object instanceof CallableElement) {
+ CallableElement callableElement = (CallableElement)object;
+ callableElement.getSupportedInterfaceRefs().add(iface);
+ }
+ }
+
+ return iface;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
index b629f75..8348185 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
@@ -17,6 +17,7 @@
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
public class DataItemsPropertySection extends DefaultPropertySection {
@@ -29,6 +30,11 @@
}
@Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new DataItemsDetailComposite(parent,style);
+ }
+
+ @Override
public EObject getBusinessObjectForSelection(ISelection selection) {
EObject be = super.getBusinessObjectForSelection(selection);
if (be instanceof Participant)
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantDetailComposite.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantDetailComposite.java
index ba1aa33..5c7c147 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantDetailComposite.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantDetailComposite.java
@@ -27,7 +27,7 @@
import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextObjectEditor;
import org.eclipse.bpmn2.modeler.core.utils.ErrorUtils;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
-import org.eclipse.bpmn2.modeler.ui.property.data.InterfacePropertySection.ProvidedInterfaceListComposite;
+import org.eclipse.bpmn2.modeler.ui.property.data.InterfacesPropertySection.ProvidedInterfaceListComposite;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantPropertySection.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantPropertySection.java
index 41cab71..5d1c95f 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantPropertySection.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantPropertySection.java
@@ -12,6 +12,7 @@
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
+import org.eclipse.swt.widgets.Composite;
public class ParticipantPropertySection extends DefaultPropertySection {
@@ -22,4 +23,9 @@
protected AbstractDetailComposite createSectionRoot() {
return new ParticipantDetailComposite(this);
}
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ParticipantDetailComposite(parent,style);
+ }
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java
index bbe2945..463c49d 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java
@@ -277,11 +277,13 @@
}
}
else if (event instanceof ThrowEvent) {
- text += getTextValue(link.eContainer());
- text += " -> ";
- LinkEventDefinition target = link.getTarget();
- text += getTextValue(target.eContainer());
- return text;
+ if (link.getTarget()!=null) {
+ text += getTextValue(link.eContainer());
+ text += " -> ";
+ LinkEventDefinition target = link.getTarget();
+ text += getTextValue(target.eContainer());
+ return text;
+ }
}
}
if (element instanceof MessageEventDefinition) {