\r
ArrayList<Resource> inputResources = new ArrayList<Resource>();\r
// Create inputs\r
- for (Parameter input : inputs) {\r
- Resource r = GraphUtils.create2(graph, sr.SysdynModelicaFunction_Input,\r
- l0.HasName, input.name, \r
- sr.Variable_type, input.type,\r
- sr.SysdynModelicaFunction_optional, input.optional ? l0.True : l0.False);\r
- if (input.description != null) {\r
- // Description is optional\r
- graph.claimLiteral(r, sr.SysdynModelicaFunction_definition, input.description);\r
+ if (inputs != null) {\r
+ for (Parameter input : inputs) {\r
+ Resource r = GraphUtils.create2(graph, sr.SysdynModelicaFunction_Input,\r
+ l0.HasName, input.name, \r
+ sr.Variable_type, input.type,\r
+ sr.SysdynModelicaFunction_optional, input.optional ? l0.True : l0.False);\r
+ if (input.description != null) {\r
+ // Description is optional\r
+ graph.claimLiteral(r, sr.SysdynModelicaFunction_definition, input.description);\r
+ }\r
+ inputResources.add(r);\r
}\r
- inputResources.add(r);\r
+ graph.claim(\r
+ function, \r
+ sr.SysdynModelicaFunction_inputs, \r
+ ListUtils.create(graph, inputResources));\r
}\r
- graph.claim(\r
- function, \r
- sr.SysdynModelicaFunction_inputs, \r
- ListUtils.create(graph, inputResources));\r
}\r
\r
private void removeOutputList(WriteGraph graph) throws DatabaseException {\r
\r
ArrayList<Resource> outputResources = new ArrayList<Resource>();\r
// Create outputs\r
- for (Parameter output : outputs) {\r
- Resource r = GraphUtils.create2(graph, sr.SysdynModelicaFunction_Output,\r
- l0.HasName, output.name, \r
- sr.Variable_type, output.type);\r
- if (output.description != null) {\r
- // Description is optional\r
- graph.claimLiteral(r, sr.SysdynModelicaFunction_definition, output.description);\r
+ if (outputs != null) {\r
+ for (Parameter output : outputs) {\r
+ Resource r = GraphUtils.create2(graph, sr.SysdynModelicaFunction_Output,\r
+ l0.HasName, output.name, \r
+ sr.Variable_type, output.type);\r
+ if (output.description != null) {\r
+ // Description is optional\r
+ graph.claimLiteral(r, sr.SysdynModelicaFunction_definition, output.description);\r
+ }\r
+ outputResources.add(r);\r
}\r
- outputResources.add(r);\r
+ graph.claim(\r
+ function, \r
+ sr.SysdynModelicaFunction_outputs, \r
+ ListUtils.create(graph, outputResources));\r
}\r
- graph.claim(\r
- function, \r
- sr.SysdynModelicaFunction_outputs, \r
- ListUtils.create(graph, outputResources));\r
\r
}\r
\r