summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-01-19 03:14:21 (EST)
committer Stephan Born2012-04-24 04:29:42 (EDT)
commitb1e157579549286a3d9d8291296fac6c6e37a9f7 (patch)
treebad07aa58db20dc8a081dd768a551931002c5e92
parentf9f8742a893539a6c7e2856d1a4e56dd3ac530a3 (diff)
downloadorg.eclipse.stardust.ide-b1e157579549286a3d9d8291296fac6c6e37a9f7.zip
org.eclipse.stardust.ide-b1e157579549286a3d9d8291296fac6c6e37a9f7.tar.gz
org.eclipse.stardust.ide-b1e157579549286a3d9d8291296fac6c6e37a9f7.tar.bz2
Jira-ID: CRNT-22739 Activity Criticality: Delete options of configuration variable not working with Activity Criticality Property.
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@52959 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/VariableContext.java18
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ActivityCriticalityPropertyPage.java19
2 files changed, 34 insertions, 3 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/VariableContext.java b/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/VariableContext.java
index eeb4c7a..e432d9d 100644
--- a/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/VariableContext.java
+++ b/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/VariableContext.java
@@ -43,7 +43,8 @@ public class VariableContext
private ModelType model;
-
+ private boolean criticalityFormulaChanged;
+
public VariableContext()
{
super();
@@ -398,6 +399,11 @@ public class VariableContext
String value = (String) attribute.getValue();
value = replace(modelVariable, newValue, value);
attribute.setValue(value);
+ // CRNT-22739
+ if (attribute.getName().equalsIgnoreCase("ipp:criticalityFormula"))
+ {
+ setCriticalityFormulaChanged(true);
+ }
}
else
{
@@ -522,5 +528,15 @@ public class VariableContext
}
return true;
}
+
+ public boolean isCriticalityFormulaChanged()
+ {
+ return criticalityFormulaChanged;
+ }
+
+ public void setCriticalityFormulaChanged(boolean criticalityFormulaChanged)
+ {
+ this.criticalityFormulaChanged = criticalityFormulaChanged;
+ }
}
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ActivityCriticalityPropertyPage.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ActivityCriticalityPropertyPage.java
index 44e9530..2fa00ee 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ActivityCriticalityPropertyPage.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ActivityCriticalityPropertyPage.java
@@ -19,6 +19,8 @@ import org.eclipse.stardust.model.xpdl.carnot.IModelElementNodeSymbol;
import org.eclipse.stardust.model.xpdl.carnot.ModelType;
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.VariableContext;
+import org.eclipse.stardust.model.xpdl.carnot.util.VariableContextHelper;
import org.eclipse.stardust.modeling.common.ui.jface.utils.FormBuilder;
import org.eclipse.stardust.modeling.core.editors.WorkflowModelEditor;
import org.eclipse.stardust.modeling.javascript.editor.EditorUtils;
@@ -70,6 +72,11 @@ public class ActivityCriticalityPropertyPage extends AbstractModelElementPropert
{
ModelType model = ModelUtils.findContainingModel(element);
controller.intializeModel(model);
+ loadFormula(element);
+ }
+
+ private void loadFormula(IModelElement element)
+ {
String formula = AttributeUtil.getAttributeValue((IExtensibleElement) element,
"ipp:criticalityFormula");
this.refreshDocument();
@@ -85,8 +92,16 @@ public class ActivityCriticalityPropertyPage extends AbstractModelElementPropert
ModelType model = ModelUtils.findContainingModel(element);
String formula = criticalityFormulaEditor.getAdaptedSourceViewer().getTextWidget()
.getText().trim();
- AttributeUtil.setAttribute((IExtensibleElement) model, "ipp:criticalityFormula",
- "String", formula);
+ VariableContext variableContext = VariableContextHelper.getInstance().getContext(
+ model);
+ if (!variableContext.isCriticalityFormulaChanged())
+ {
+ AttributeUtil.setAttribute((IExtensibleElement) model, "ipp:criticalityFormula",
+ "String", formula);
+ variableContext.setCriticalityFormulaChanged(false);
+ } else {
+ loadFormula(element);
+ }
}
public void refreshDocument()