From 5f0ec1c2d95c377fbec428f11464e93fe442b5ef Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Tue, 29 Jun 2021 13:57:14 +0100 Subject: Cleanup input & outputFields from Task definition 1) Remove the usage of inputField and outputField from Task definition. 2) Fix issues around populating events to task in case of State Finalizer Logic. Change-Id: Ief17f400729410b83c6b7c665980d443e0cf6f28 Issue-ID: POLICY-3336 Signed-off-by: a.sreekumar --- .../tools/model/generator/model2cli/Model2Cli.java | 49 +--------------------- 1 file changed, 2 insertions(+), 47 deletions(-) (limited to 'tools/model-generator/src') diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java index 81d897762..b5f6f432a 100644 --- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java +++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java @@ -166,16 +166,13 @@ public class Model2Cli { // 2: tasks for (final AxTask t : policyModel.getTasks().getTaskMap().values()) { final AxArtifactKey key = t.getKey(); - final List infields = getInfieldsForTask(codeGen, t); - final List outfields = getOutfieldsForTask(codeGen, t); final ST logic = getLogicForTask(codeGen, t); final List parameters = getParametersForTask(codeGen, t); final List contextRefs = getCtxtRefsForTask(codeGen, t); codeGen.addTaskDeclaration(new TaskDeclarationBuilder().setName(kig.getName(key)) - .setVersion(kig.getVersion(key)).setUuid(kig.getUuid(key)) - .setDescription(kig.getDesc(key)).setInfields(infields).setOutfields(outfields) - .setLogic(logic).setParameters(parameters).setContextRefs(contextRefs)); + .setVersion(kig.getVersion(key)).setUuid(kig.getUuid(key)).setDescription(kig.getDesc(key)) + .setLogic(logic).setParameters(parameters).setContextRefs(contextRefs)); } // 3: events @@ -312,48 +309,6 @@ public class Model2Cli { return cg.createTaskDefLogic(kig.getName(tkey), kig.getVersion(tkey), tl.getLogicFlavour(), tl.getLogic()); } - /** - * Gets the output fields for task. - * - * @param cg the code generator - * @param task the task - * @return the output fields for task - */ - private List getOutfieldsForTask(final CodeGeneratorCliEditor cg, final AxTask task) { - final Collection fields = task.getOutputFields().values(); - final List ret = new ArrayList<>(fields.size()); - for (final AxField f : fields) { - final AxReferenceKey fkey = f.getKey(); - - final ST val = cg.createTaskDefinitionOutfields(kig.getPName(fkey), kig.getPVersion(fkey), - kig.getLName(fkey), kig.getName(f.getSchema()), kig.getVersion(f.getSchema())); - - ret.add(val); - } - return ret; - } - - /** - * Gets the input fields for task. - * - * @param cg the code generator - * @param task the task - * @return the input fields for task - */ - private List getInfieldsForTask(final CodeGeneratorCliEditor cg, final AxTask task) { - final Collection fields = task.getInputFields().values(); - final List ret = new ArrayList<>(fields.size()); - for (final AxField f : fields) { - final AxReferenceKey fkey = f.getKey(); - - final ST val = cg.createTaskDefinitionInfields(kig.getPName(fkey), kig.getPVersion(fkey), - kig.getLName(fkey), kig.getName(f.getSchema()), kig.getVersion(f.getSchema())); - - ret.add(val); - } - return ret; - } - /** * Gets the states for policy. * -- cgit 1.2.3-korg