Fix undefined runtimeID in examples
diff --git a/examples/plugins/org.eclipse.bpmn2.modeler.examples.customtask/plugin.xml b/examples/plugins/org.eclipse.bpmn2.modeler.examples.customtask/plugin.xml
index 67a8ad8..7245cdd 100644
--- a/examples/plugins/org.eclipse.bpmn2.modeler.examples.customtask/plugin.xml
+++ b/examples/plugins/org.eclipse.bpmn2.modeler.examples.customtask/plugin.xml
@@ -77,7 +77,7 @@
icon="TemporalDepedency.png"
id="org.eclipse.bpmn2.modeler.examples.customtask.temporalDependency"
name="Temporal Dependency"
- runtimeId="org.eclipse.bpmn2.modeler.examples.timebpmn.runtime"
+ runtimeId="org.eclipse.bpmn2.modeler.examples.customtask.runtime"
type="TemporalDependency">
<property name="lagTime" type="EString" value="3hr"/>
</customTask>
@@ -89,7 +89,7 @@
featureContainer="org.eclipse.bpmn2.modeler.examples.customtask.MessageStartEventFeatureContainer"
id="org.eclipse.bpmn2.modeler.examples.customtask.messageStartEvent"
name="Message Event"
- runtimeId="org.eclipse.bpmn2.modeler.examples.timebpmn.runtime"
+ runtimeId="org.eclipse.bpmn2.modeler.examples.customtask.runtime"
type="StartEvent">
</customTask>
diff --git a/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/plugin.xml b/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/plugin.xml
index f2eff3d..42049ed 100644
--- a/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/plugin.xml
+++ b/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/plugin.xml
@@ -41,7 +41,7 @@
</propertyTab>
<propertyTab
- id="org.eclipse.bpmn2.modeler.examples.dynamic.flow.tab"
+ id="org.eclipse.bpmn2.modeler.examples.dynamic.tab"
class="default"
features="priority"
type="org.eclipse.bpmn2.SequenceFlow"
@@ -85,7 +85,7 @@
name="Mitigation Flow"
category="Risk & Mitigation"
icon="flow.png"
- runtimeId="org.eclipse.bpmn2.modeler.examples.dynamic.flow"
+ runtimeId="org.eclipse.bpmn2.modeler.examples.dynamic"
type="SequenceFlow">
<property name="name" value="Mitigate" type="EString"/>
<property name="priority" value="1" type="EInt"/>
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java
index f5725fc..7086887 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java
@@ -498,12 +498,18 @@
}
static TargetRuntime getRuntime(IConfigurationElement e, TargetRuntime currentRuntime) {
- TargetRuntime rt = getRuntime( getRuntimeId(e) );
+ String id = getRuntimeId(e);
+ TargetRuntime rt = getRuntime(id);
if (rt==null) {
if (currentRuntime!=null)
rt = currentRuntime;
else
rt = getDefaultRuntime();
+ if (id!=null && rt!=null && !id.equals(rt.getId())) {
+ throw new IllegalArgumentException("Runtime ID "+id+
+ " referenced in plugin "+e.getContributor().getName()+
+ " is not defined.");
+ }
}
return rt;
}