git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorSweidan Omar <TFS\sweidan.omar>
Thu, 28 Apr 2022 06:38:27 +0000 (06:38 +0000)
committerSweidan Omar <TFS\sweidan.omar>
Thu, 28 Apr 2022 06:38:27 +0000 (06:38 +0000)
server/user.jobengine.osgi.server/src/user/jobengine/server/ast/JobTemplate.java

index 12e48f8c8326284167c55f3abdd3865ff0841656..546632f1d1d8d5517d2c381e3765ce4e4598e913 100644 (file)
@@ -1,5 +1,6 @@
 package user.jobengine.server.ast;\r
 \r
+import java.io.Serializable;\r
 import java.util.ArrayList;\r
 import java.util.HashMap;\r
 import java.util.List;\r
@@ -18,7 +19,7 @@ import org.w3c.dom.Element;
 /**\r
  * Gyökér osztály.\r
  */\r
-public class JobTemplate extends AST {\r
+public class JobTemplate extends AST implements Serializable {\r
        private static final Logger logger = LogManager.getLogger(JobTemplate.class);\r
 \r
        private CommandSequence commandSequence = null;\r
@@ -233,7 +234,9 @@ public class JobTemplate extends AST {
 \r
                        Element root = document.createElement("jobtemplate");\r
                        document.appendChild(root);\r
-                       root.setAttribute("name", getName());\r
+                       if (getName() != null) {\r
+                               root.setAttribute("name", getName());\r
+                       }\r
                        root.setAttribute("useSessionLog", Boolean.toString(isUseSessionLog()));\r
 \r
                        if (getDeclarationSequence() != null) {\r
@@ -283,17 +286,18 @@ public class JobTemplate extends AST {
                                        command.appendChild(inputs);\r
 \r
                                        OutputParameterSequence ops = (OutputParameterSequence) cjs.getOutputParameterSequence();\r
-                                       Element outputs = document.createElement("outputs");\r
-\r
-                                       for (int j = 0; j < ops.getParameters().size(); j++) {\r
-                                               OutputParameter op = (OutputParameter) (ops.getParameters().get(j));\r
-                                               Element output = document.createElement("output");\r
-                                               Element variable = document.createElement("variable");\r
-                                               variable.setAttribute("name", op.getVariableName().getName());\r
-                                               output.appendChild(variable);\r
-                                               outputs.appendChild(output);\r
+                                       if (ops != null) {\r
+                                               Element outputs = document.createElement("outputs");\r
+                                               for (int j = 0; j < ops.getParameters().size(); j++) {\r
+                                                       OutputParameter op = (OutputParameter) (ops.getParameters().get(j));\r
+                                                       Element output = document.createElement("output");\r
+                                                       Element variable = document.createElement("variable");\r
+                                                       variable.setAttribute("name", op.getVariableName().getName());\r
+                                                       output.appendChild(variable);\r
+                                                       outputs.appendChild(output);\r
+                                               }\r
+                                               command.appendChild(outputs);\r
                                        }\r
-                                       command.appendChild(outputs);\r
                                }\r
                        }\r
                } catch (ParserConfigurationException e) {\r