final List<String> resultype) {
int res = snum;
if ("step".equals(node.getNodeName())) {
+
+ String name = ((Element)node).getAttribute("name");
HashMap<String, Node> tags = XDOM.getNamedChildNodes(node);
NamedNodeMap natr = tags.get("storage").getAttributes();
ProjectSettingsService.Step step = new ProjectSettingsService.Step(
- snum, ownerClass, natr.getNamedItem("path")
- .getNodeValue());
+ snum, ownerClass, natr.getNamedItem("path").getNodeValue());
+ step.setKey(name);
// Keeping flow and classification information for eventual later use
natr = tags.get("flow").getAttributes();
if (natr.getNamedItem("contents").getNodeValue()
.equals("knowledge")) {
if (Study.class.equals(ownerClass)) {
- LOG.error("Error: knowledges must be attached to scenarios.");
+ LOG
+ .error("Error: knowledges must be attached to scenarios.");
} else {
// TODO In a given scenario, only one step must contain knowledges
step._contents.add(KnowledgeElement.class);
} else {
step._contents.add(Document.class);
}
-
- Element module = (Element)tags.get("module");
+
+ Element module = (Element) tags.get("module");
if (module != null) {
step.setModule(module.getAttribute("name"));
}
int snum = 0;
for (Iterator<NamedNodeMap> i = _sclass.iterator(); i.hasNext(); snum++) {
NamedNodeMap clatr = i.next();
- if (clatr == null) {
- continue;
- }
-
- String[] clist = clatr.getNamedItem("context").getNodeValue()
- .split(",");
- for (int j = 0; j < clist.length; j++) {
- mapstep.put(clist[j], _steps.get(snum));
+ if (clatr != null) {
+ String[] clist = clatr.getNamedItem("context").getNodeValue()
+ .split(",");
+ for (int j = 0; j < clist.length; j++) {
+ mapstep.put(clist[j], _steps.get(snum));
+ }
}
}
try {
SimulationContextType tctex = null;
for (Iterator<String> i = _context.iterator(); i.hasNext();) {
String type = i.next();
- if (!mapstep.containsKey(type)) {
+ if (mapstep.containsKey(type)) {
+ tctex = getSimulationContextTypeService().createType(type,
+ mapstep.get(type)); // Creation of Simulation Context Types
+ getSimulationContextTypeService().approve(tctex);
+ } else {
LOG
.warn("Could not find \""
+ type
+ "\" classification. Simulation Context type ignored.");
- continue;
}
- tctex = getSimulationContextTypeService().createType(type,
- mapstep.get(type)); // Creation of Simulation Context Types
- getSimulationContextTypeService().approve(tctex);
}
} catch (Exception error) {
LOG.warn("Error creating context types, reason:", error); // Should not happen