summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-02-17 09:32:18 (EST)
committerStephan Born2012-04-24 10:12:59 (EDT)
commita1821a31be6520c7351da1934fa1c103e6cc6cc1 (patch)
treee78e3220e18bd5b04926e349a957d0937e44c0ae
parent35dab625bd315963cb867c6f0aebebd366b16bcc (diff)
downloadorg.eclipse.stardust.ide-a1821a31be6520c7351da1934fa1c103e6cc6cc1.zip
org.eclipse.stardust.ide-a1821a31be6520c7351da1934fa1c103e6cc6cc1.tar.gz
org.eclipse.stardust.ide-a1821a31be6520c7351da1934fa1c103e6cc6cc1.tar.bz2
Jira-ID: CRNT-23339 Scan Trigger: Error icon not present for unassigned participant trigger
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@53893 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ParticipantPropertyPage.java38
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ScanTriggerPropertyPage.java53
-rw-r--r--modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_de.properties4
-rw-r--r--modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_en.properties4
-rw-r--r--modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_ja.properties4
-rw-r--r--modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/Validation_Messages.java2
-rw-r--r--modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/validation-messages.properties3
7 files changed, 96 insertions, 12 deletions
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ParticipantPropertyPage.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ParticipantPropertyPage.java
index 02e52d9..0578bf3 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ParticipantPropertyPage.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ParticipantPropertyPage.java
@@ -19,6 +19,8 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.stardust.common.reflect.Reflect;
import org.eclipse.stardust.engine.api.model.PredefinedConstants;
import org.eclipse.stardust.model.xpdl.carnot.AttributeType;
import org.eclipse.stardust.model.xpdl.carnot.IExtensibleElement;
@@ -30,16 +32,19 @@ import org.eclipse.stardust.model.xpdl.carnot.TriggerType;
import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil;
import org.eclipse.stardust.model.xpdl.carnot.util.ModelUtils;
import org.eclipse.stardust.model.xpdl.carnot.util.ScopeUtils;
+import org.eclipse.stardust.modeling.common.platform.validation.IQuickValidationStatus;
import org.eclipse.stardust.modeling.common.ui.jface.utils.FormBuilder;
import org.eclipse.stardust.modeling.common.ui.jface.utils.LabeledViewer;
import org.eclipse.stardust.modeling.common.ui.jface.widgets.LabelWithStatus;
import org.eclipse.stardust.modeling.core.Diagram_Messages;
import org.eclipse.stardust.modeling.core.editors.parts.properties.LaneParticipantCommandFactory;
+import org.eclipse.stardust.modeling.core.editors.ui.CarnotPreferenceNode;
import org.eclipse.stardust.modeling.core.editors.ui.EObjectLabelProvider;
import org.eclipse.stardust.modeling.core.properties.AbstractModelElementPropertyPage;
import org.eclipse.stardust.modeling.core.spi.SpiPropertyPage;
import org.eclipse.stardust.modeling.core.utils.IdentifiableViewerSorter;
import org.eclipse.stardust.modeling.core.utils.WidgetBindingManager;
+import org.eclipse.stardust.modeling.validation.Validation_Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -84,6 +89,7 @@ public class ParticipantPropertyPage extends AbstractModelElementPropertyPage
.getReferenceElement(attribute);
}
validate(originalPerformer);
+
}
public void loadElementFromFields(final IModelElementNodeSymbol symbol,
@@ -151,6 +157,7 @@ public class ParticipantPropertyPage extends AbstractModelElementPropertyPage
boolean isValid = true;
if (performer != null)
{
+ setParticipantValidationState(IQuickValidationStatus.OK);
ModelType model = ModelUtils.findContainingModel(performer);
HashSet<IModelParticipant> scoped = ScopeUtils.findScopedParticipants(model);
// is scoped participant?
@@ -159,12 +166,31 @@ public class ParticipantPropertyPage extends AbstractModelElementPropertyPage
isValid = ScopeUtils.isValidScopedParticipantForManualTrigger(performer);
}
}
-
- /*
- * if(isValid) { spiPage.setMessage(null); } else { spiPage.setMessage(
- * "Invalid scoped Participant (primitive scope data of type \"String\" with empty data path expected)."
- * , WARNING); }
- */
+ else
+ {
+ setParticipantValidationState(IQuickValidationStatus.ERRORS);
+ }
+ }
+
+ private void setParticipantValidationState(IQuickValidationStatus state)
+ {
+ CarnotPreferenceNode preferenceNode = (CarnotPreferenceNode) this
+ .getPreferenceManager()
+ .find("org~eclipse~stardust~modeling~core~spi~triggerTypes~scan~ParticipantPropertyPage");
+ preferenceNode.updatePageStatus(state);
+ TreeViewer parentTreeViewer = (TreeViewer) Reflect.getFieldValue(
+ this.getContainer(), "treeViewer");
+ parentTreeViewer.refresh(true);
+ labeledWidget.getLabel().setValidationStatus(state);
+ if (state == IQuickValidationStatus.ERRORS)
+ {
+ labeledWidget.getLabel().setToolTipText(
+ Validation_Messages.MSG_Scantrigger_UnspecifiedParticipant);
+ }
+ else
+ {
+ labeledWidget.getLabel().setToolTipText(null);
+ }
}
/**
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ScanTriggerPropertyPage.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ScanTriggerPropertyPage.java
index 4340b89..f645082 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ScanTriggerPropertyPage.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/spi/triggerTypes/scan/ScanTriggerPropertyPage.java
@@ -11,6 +11,7 @@
package org.eclipse.stardust.modeling.core.spi.triggerTypes.scan;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -19,8 +20,11 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.stardust.common.reflect.Reflect;
import org.eclipse.stardust.engine.api.model.PredefinedConstants;
import org.eclipse.stardust.model.xpdl.carnot.AccessPointType;
+import org.eclipse.stardust.model.xpdl.carnot.AttributeType;
import org.eclipse.stardust.model.xpdl.carnot.CarnotWorkflowModelFactory;
import org.eclipse.stardust.model.xpdl.carnot.DataType;
import org.eclipse.stardust.model.xpdl.carnot.DirectionType;
@@ -33,6 +37,8 @@ import org.eclipse.stardust.model.xpdl.carnot.TriggerType;
import org.eclipse.stardust.model.xpdl.carnot.util.AccessPointUtil;
import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil;
import org.eclipse.stardust.model.xpdl.carnot.util.ModelUtils;
+import org.eclipse.stardust.model.xpdl.carnot.util.ScopeUtils;
+import org.eclipse.stardust.modeling.common.platform.validation.IQuickValidationStatus;
import org.eclipse.stardust.modeling.common.ui.jface.utils.FormBuilder;
import org.eclipse.stardust.modeling.common.ui.jface.utils.LabeledText;
import org.eclipse.stardust.modeling.common.ui.jface.utils.LabeledViewer;
@@ -58,6 +64,8 @@ public class ScanTriggerPropertyPage extends AbstractModelElementPropertyPage
private LabeledText metaTypeText;
+ private CarnotPreferenceNode participantNode;
+
public void loadFieldsFromElement(IModelElementNodeSymbol symbol, IModelElement element)
{
trigger = (TriggerType) element;
@@ -82,6 +90,16 @@ public class ScanTriggerPropertyPage extends AbstractModelElementPropertyPage
dataCombo.getViewer().setSelection(new StructuredSelection(dataType));
}
}
+
+ TriggerType trigger = (TriggerType) getModelElement();
+ AttributeType attribute = AttributeUtil.getAttribute(trigger,
+ PredefinedConstants.MANUAL_TRIGGER_PARTICIPANT_ATT);
+ if (attribute != null)
+ {
+ originalPerformer = (IModelParticipant) AttributeUtil
+ .getReferenceElement(attribute);
+ }
+ validate(originalPerformer);
}
@@ -142,6 +160,8 @@ public class ScanTriggerPropertyPage extends AbstractModelElementPropertyPage
}
metaTypeText.getText().setText(typeName);
+
+
}
});
@@ -157,10 +177,39 @@ public class ScanTriggerPropertyPage extends AbstractModelElementPropertyPage
"Participant", //$NON-NLS-1$
iconName,
org.eclipse.stardust.modeling.core.spi.triggerTypes.scan.ParticipantPropertyPage.class);
- CarnotPreferenceNode newNode = new CarnotPreferenceNode(element, getElement(), 0);
- getPreferenceManager().addToRoot(newNode);
+ participantNode = new CarnotPreferenceNode(element, getElement(), 0);
+
+ getPreferenceManager().addToRoot(participantNode);
+
return composite;
}
+
+ private void validate(IModelParticipant performer)
+ {
+ if (performer != null)
+ {
+ setParticipantValidationState(IQuickValidationStatus.OK);
+ }
+ else
+ {
+ setParticipantValidationState(IQuickValidationStatus.ERRORS);
+ }
+ }
+
+ private void setParticipantValidationState(IQuickValidationStatus state)
+ {
+ this.participantNode.updatePageStatus(state);
+ TreeViewer parentTreeViewer = (TreeViewer) Reflect.getFieldValue(
+ this.getContainer(), "treeViewer");
+ parentTreeViewer.refresh(true);
+ /*CarnotPreferenceNode preferenceNode = (CarnotPreferenceNode) this
+ .getPreferenceManager()
+ .find("org~eclipse~stardust~modeling~core~spi~triggerTypes~scan~ParticipantPropertyPage");
+ preferenceNode.updatePageStatus(IQuickValidationStatus.ERRORS);
+ TreeViewer parentTreeViewer = (TreeViewer) Reflect.getFieldValue(
+ this.getContainer(), "treeViewer");
+ parentTreeViewer.refresh(true);*/
+ }
public boolean performCancel()
{
diff --git a/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_de.properties b/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_de.properties
index 3f3e284..1581faf 100644
--- a/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_de.properties
+++ b/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_de.properties
@@ -295,7 +295,7 @@ ERR_ORGANIZATION_DuplicateId=<Duplicate id for organization.>
ERR_ORGANIZATION_PartOf=<Organization should not be part of more than one other Organization.>
# ERR_ORGANIZATION_PartOf_en=Organization should not be part of more than one other Organization.
ERR_ORGANIZATION_InvalidScopeData=<Scope Data must be primitive Data (type String without DataPath) or Structured Data (with DataPath to String type).>
-# ERR_ORGANIZATION_InvalidScopeData_en=Scope Data must be primitive Data (type String without DataPath) or Structured Data (with DataPath to String type).
+# ERR_ORGANIZATION_InvalidScopeData_en=Scope Data must be Primitive(String w/o DataPath)\n or Structured Data(with DataPath to String).
ERR_ACTIVITY_NoPerformerSet=<No performer set for manual or interactive application activity.>
# ERR_ACTIVITY_NoPerformerSet_en=No performer set for manual or interactive application activity.
ERR_ACTIONTYPE_DuplicateId=<Duplicate id for action type.>
@@ -434,3 +434,5 @@ MSG_KEY_DESCRIPTOR_NO_SCHEMA=<No schema found for structured key descriptor.>
# MSG_KEY_DESCRIPTOR_NO_SCHEMA_en=No schema found for structured key descriptor.
MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR=<DataPath marked as key descriptor but it's not a descriptor.>
# MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR_en=DataPath marked as key descriptor but it's not a descriptor.
+MSG_Scantrigger_UnspecifiedParticipant=<Unspecified participant for scan trigger>
+# MSG_Scantrigger_UnspecifiedParticipant_en=Unspecified participant for scan trigger
diff --git a/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_en.properties b/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_en.properties
index d85cfcb..9a6ce0b 100644
--- a/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_en.properties
+++ b/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_en.properties
@@ -295,7 +295,7 @@ ERR_ORGANIZATION_DuplicateId=Duplicate id for organization.
ERR_ORGANIZATION_PartOf=Organization should not be part of more than one other Organization.
# ERR_ORGANIZATION_PartOf_en=Organization should not be part of more than one other Organization.
ERR_ORGANIZATION_InvalidScopeData=Scope Data must be Primitive(String w/o DataPath)\n or Structured Data(with DataPath to String).
-# ERR_ORGANIZATION_InvalidScopeData_en=Scope Data must be a Primitive (String without DataPath) or Structured Data (with DataPath to String type).
+# ERR_ORGANIZATION_InvalidScopeData_en=Scope Data must be Primitive(String w/o DataPath)\n or Structured Data(with DataPath to String).
ERR_ACTIVITY_NoPerformerSet=No performer set for manual or interactive application activity.
# ERR_ACTIVITY_NoPerformerSet_en=No performer set for manual or interactive application activity.
ERR_ACTIONTYPE_DuplicateId=Duplicate id for action type.
@@ -434,3 +434,5 @@ MSG_KEY_DESCRIPTOR_NO_SCHEMA=No schema found for structured key descriptor.
# MSG_KEY_DESCRIPTOR_NO_SCHEMA_en=No schema found for structured key descriptor.
MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR=DataPath marked as key descriptor but it's not a descriptor.
# MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR_en=DataPath marked as key descriptor but it's not a descriptor.
+MSG_Scantrigger_UnspecifiedParticipant=Unspecified participant for scan trigger
+# MSG_Scantrigger_UnspecifiedParticipant_en=Unspecified participant for scan trigger
diff --git a/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_ja.properties b/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_ja.properties
index b8408af..5319af7 100644
--- a/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_ja.properties
+++ b/modeling/org.eclipse.stardust.modeling.validation.nl/src/org/eclipse/stardust/modeling/validation/validation-messages_ja.properties
@@ -295,7 +295,7 @@ ERR_ORGANIZATION_DuplicateId= \u7D44\u7E54\u306EID\u304C\u91CD\u8907\u3057\u3066
ERR_ORGANIZATION_PartOf= \u7D44\u7E54\u306F\u4ED6\u306E\u8907\u6570\u306E\u7D44\u7E54\u306E\u4E00\u90E8\u3068\u306A\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
# ERR_ORGANIZATION_PartOf_en=Organization should not be part of more than one other Organization.
ERR_ORGANIZATION_InvalidScopeData= \u30B9\u30B3\u30FC\u30D7\u30C7\u30FC\u30BF\u306F\u30D7\u30EA\u30DF\u30C6\u30A3\u30D6\u30C7\u30FC\u30BF\uFF08\u30C7\u30FC\u30BF\u30D1\u30B9\u306E\u306A\u3044String\u578B\u306E\u5024\uFF09\u307E\u305F\u306F\u69CB\u9020\u5316\u30C7\u30FC\u30BF\uFF08String\u578B\u306E\u5024\u3092\u53C2\u7167\u3059\u308B\u30C7\u30FC\u30BF\u30D1\u30B9\uFF09\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# ERR_ORGANIZATION_InvalidScopeData_en=Scope Data must be primitive Data (type String without DataPath) or Structured Data (with DataPath to String type).
+# ERR_ORGANIZATION_InvalidScopeData_en=Scope Data must be Primitive(String w/o DataPath)\n or Structured Data(with DataPath to String).
ERR_ACTIVITY_NoPerformerSet= \u30DE\u30CB\u30E5\u30A2\u30EB\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u306B\u30D1\u30D5\u30A9\u30FC\u30DE\u30FC\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
# ERR_ACTIVITY_NoPerformerSet_en=No performer set for manual or interactive application activity.
ERR_ACTIONTYPE_DuplicateId= \u30A2\u30AF\u30B7\u30E7\u30F3\u30BF\u30A4\u30D7\u306EID\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002
@@ -434,3 +434,5 @@ MSG_KEY_DESCRIPTOR_NO_SCHEMA=<No schema found for structured key descriptor.>
# MSG_KEY_DESCRIPTOR_NO_SCHEMA_en=No schema found for structured key descriptor.
MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR=<DataPath marked as key descriptor but it's not a descriptor.>
# MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR_en=DataPath marked as key descriptor but it's not a descriptor.
+MSG_Scantrigger_UnspecifiedParticipant=<Unspecified participant for scan trigger>
+# MSG_Scantrigger_UnspecifiedParticipant_en=Unspecified participant for scan trigger
diff --git a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/Validation_Messages.java b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/Validation_Messages.java
index 2b0481c..23b953f 100644
--- a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/Validation_Messages.java
+++ b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/Validation_Messages.java
@@ -212,6 +212,8 @@ public class Validation_Messages extends NLS
public static String MSG_JMSTRIGGER_NoValidTypeForParameter;
public static String MSG_Trigger_UnspecifiedParticipant;
+
+ public static String MSG_Scantrigger_UnspecifiedParticipant;
public static String MSG_Trigger_InvalidParticipant;
diff --git a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/validation-messages.properties b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/validation-messages.properties
index 391d412..d9a4b69 100644
--- a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/validation-messages.properties
+++ b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/validation-messages.properties
@@ -220,4 +220,5 @@ MSG_KEY_DESCRIPTOR_PRIMITIVE_STRUCTURED=Key descriptors must be either primitive
MSG_KEY_DESCRIPTOR_PRIMITIVE=Structured key descriptors must have primitive type.
MSG_KEY_DESCRIPTOR_INDEXED_PERSISTENT=Structured key descriptors must be indexed and persistent.
MSG_KEY_DESCRIPTOR_NO_SCHEMA=No schema found for structured key descriptor.
-MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR=DataPath marked as key descriptor but it's not a descriptor. \ No newline at end of file
+MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR=DataPath marked as key descriptor but it's not a descriptor.
+MSG_Scantrigger_UnspecifiedParticipant=Unspecified participant for scan trigger \ No newline at end of file