diff options
author | a.sreekumar <ajith.sreekumar@bell.ca> | 2021-06-29 13:57:14 +0100 |
---|---|---|
committer | a.sreekumar <ajith.sreekumar@bell.ca> | 2021-07-02 16:03:51 +0100 |
commit | 5f0ec1c2d95c377fbec428f11464e93fe442b5ef (patch) | |
tree | 4aef07097fa4d64550db116a1b1b4acd1aa42590 /examples | |
parent | ba55109db1e5eea013dcffd1be29cf06fe2bbcb1 (diff) |
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 <ajith.sreekumar@bell.ca>
Diffstat (limited to 'examples')
2 files changed, 2 insertions, 70 deletions
diff --git a/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AadmDomainModelFactory.java b/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AadmDomainModelFactory.java index c0003ac68..09fd9a105 100644 --- a/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AadmDomainModelFactory.java +++ b/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AadmDomainModelFactory.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -366,94 +367,64 @@ public class AadmDomainModelFactory { .setLogicPackage(this.getClass().getPackage().getName()).setDefaultLogic(null); final AxTask aadmMatchTask = new AxTask(new AxArtifactKey("AADMMatchTask", DEFAULT_VERSION)); - aadmMatchTask.duplicateInputFields(aadmEvent.getParameterMap()); - aadmMatchTask.duplicateOutputFields(aadmEvent.getParameterMap()); aadmMatchTask.getContextAlbumReferences().add(eNodeBStatusAlbum.getKey()); aadmMatchTask.getContextAlbumReferences().add(imsiStatusAlbum.getKey()); aadmMatchTask.getContextAlbumReferences().add(ipAddressStatusAlbum.getKey()); aadmMatchTask.setTaskLogic(new AxTaskLogic(aadmMatchTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask aadmEstablishTask = new AxTask(new AxArtifactKey("AADMEstablishTask", DEFAULT_VERSION)); - aadmEstablishTask.duplicateInputFields(aadmEvent.getParameterMap()); - aadmEstablishTask.duplicateOutputFields(aadmEvent.getParameterMap()); logicReader.setDefaultLogic(DEFAULT_TASK_LOGIC); aadmEstablishTask.setTaskLogic(new AxTaskLogic(aadmEstablishTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask aadmDecideTask = new AxTask(new AxArtifactKey("AADMDecideTask", DEFAULT_VERSION)); - aadmDecideTask.duplicateInputFields(aadmEvent.getParameterMap()); - aadmDecideTask.duplicateOutputFields(aadmEvent.getParameterMap()); aadmDecideTask.setTaskLogic(new AxTaskLogic(aadmDecideTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); logicReader.setDefaultLogic(null); final AxTask aadmDoSSuggestionActTask = new AxTask( new AxArtifactKey("AADMDoSSuggestionActTask", DEFAULT_VERSION)); - aadmDoSSuggestionActTask.duplicateInputFields(aadmEvent.getParameterMap()); - aadmDoSSuggestionActTask.duplicateOutputFields(aadmXStreamActEvent.getParameterMap()); aadmDoSSuggestionActTask.getContextAlbumReferences().add(eNodeBStatusAlbum.getKey()); aadmDoSSuggestionActTask.getContextAlbumReferences().add(imsiStatusAlbum.getKey()); aadmDoSSuggestionActTask.setTaskLogic( new AxTaskLogic(aadmDoSSuggestionActTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask aadmNoActTask = new AxTask(new AxArtifactKey("AADMNoActTask", DEFAULT_VERSION)); - aadmNoActTask.duplicateInputFields(aadmEvent.getParameterMap()); - aadmNoActTask.duplicateOutputFields(aadmXStreamActEvent.getParameterMap()); aadmNoActTask.setTaskLogic(new AxTaskLogic(aadmNoActTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask aadmDoSProvenActTask = new AxTask(new AxArtifactKey("AADMDoSProvenActTask", DEFAULT_VERSION)); - aadmDoSProvenActTask.duplicateInputFields(aadmEvent.getParameterMap()); - aadmDoSProvenActTask.duplicateOutputFields(aadmXStreamActEvent.getParameterMap()); aadmDoSProvenActTask.getContextAlbumReferences().add(eNodeBStatusAlbum.getKey()); aadmDoSProvenActTask.getContextAlbumReferences().add(imsiStatusAlbum.getKey()); aadmDoSProvenActTask .setTaskLogic(new AxTaskLogic(aadmDoSProvenActTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask vMmeMatchTask = new AxTask(new AxArtifactKey("VMMEMatchTask", DEFAULT_VERSION)); - vMmeMatchTask.duplicateInputFields(vMmeEvent.getParameterMap()); - vMmeMatchTask.duplicateOutputFields(vMmeEvent.getParameterMap()); vMmeMatchTask.setTaskLogic(new AxTaskLogic(vMmeMatchTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask vMmeEstablishTask = new AxTask(new AxArtifactKey("VMMEEstablishTask", DEFAULT_VERSION)); - vMmeEstablishTask.duplicateInputFields(vMmeEvent.getParameterMap()); - vMmeEstablishTask.duplicateOutputFields(vMmeEvent.getParameterMap()); logicReader.setDefaultLogic(DEFAULT_TASK_LOGIC); vMmeEstablishTask.setTaskLogic(new AxTaskLogic(vMmeEstablishTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask vMmeDecideTask = new AxTask(new AxArtifactKey("VMMEDecideTask", DEFAULT_VERSION)); - vMmeDecideTask.duplicateInputFields(vMmeEvent.getParameterMap()); - vMmeDecideTask.duplicateOutputFields(vMmeEvent.getParameterMap()); vMmeDecideTask.setTaskLogic(new AxTaskLogic(vMmeDecideTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask vMmeNoActTask = new AxTask(new AxArtifactKey("VMMENoActTask", DEFAULT_VERSION)); - vMmeNoActTask.duplicateInputFields(vMmeEvent.getParameterMap()); - vMmeNoActTask.duplicateOutputFields(vMmeEvent.getParameterMap()); vMmeNoActTask.setTaskLogic(new AxTaskLogic(vMmeNoActTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask vMmeActTask = new AxTask(new AxArtifactKey("VMMEActTask", DEFAULT_VERSION)); - vMmeActTask.duplicateInputFields(vMmeEvent.getParameterMap()); - vMmeActTask.duplicateOutputFields(vMmeEvent.getParameterMap()); logicReader.setDefaultLogic(null); vMmeActTask.setTaskLogic(new AxTaskLogic(vMmeActTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask sapcMatchTask = new AxTask(new AxArtifactKey("SAPCMatchTask", DEFAULT_VERSION)); - sapcMatchTask.duplicateInputFields(sapcEvent.getParameterMap()); - sapcMatchTask.duplicateOutputFields(sapcBlacklistSubscriberEvent.getParameterMap()); sapcMatchTask.setTaskLogic(new AxTaskLogic(sapcMatchTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask sapcEstablishTask = new AxTask(new AxArtifactKey("SAPCEstablishTask", DEFAULT_VERSION)); - sapcEstablishTask.duplicateInputFields(sapcEvent.getParameterMap()); - sapcEstablishTask.duplicateOutputFields(sapcBlacklistSubscriberEvent.getParameterMap()); logicReader.setDefaultLogic(DEFAULT_TASK_LOGIC); sapcEstablishTask.setTaskLogic(new AxTaskLogic(sapcEstablishTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask sapcDecideTask = new AxTask(new AxArtifactKey("SAPCDecideTask", DEFAULT_VERSION)); - sapcDecideTask.duplicateInputFields(sapcEvent.getParameterMap()); - sapcDecideTask.duplicateOutputFields(sapcBlacklistSubscriberEvent.getParameterMap()); sapcDecideTask.setTaskLogic(new AxTaskLogic(sapcDecideTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask sapcActTask = new AxTask(new AxArtifactKey("SAPCActTask", DEFAULT_VERSION)); - sapcActTask.duplicateInputFields(sapcEvent.getParameterMap()); - sapcActTask.duplicateOutputFields(sapcBlacklistSubscriberEvent.getParameterMap()); sapcActTask.getContextAlbumReferences().add(imsiStatusAlbum.getKey()); logicReader.setDefaultLogic(null); sapcActTask.setTaskLogic(new AxTaskLogic(sapcActTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); @@ -461,24 +432,16 @@ public class AadmDomainModelFactory { logicReader.setDefaultLogic(DEFAULT_TASK_LOGIC); final AxTask periodicMatchTask = new AxTask(new AxArtifactKey("PeriodicMatchTask", DEFAULT_VERSION)); - periodicMatchTask.duplicateInputFields(periodicEvent.getParameterMap()); - periodicMatchTask.duplicateOutputFields(periodicEvent.getParameterMap()); periodicMatchTask.setTaskLogic(new AxTaskLogic(periodicMatchTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask periodicEstablishTask = new AxTask(new AxArtifactKey("PeriodicEstablishTask", DEFAULT_VERSION)); - periodicEstablishTask.duplicateInputFields(periodicEvent.getParameterMap()); - periodicEstablishTask.duplicateOutputFields(periodicEvent.getParameterMap()); periodicEstablishTask.setTaskLogic( new AxTaskLogic(periodicEstablishTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask periodicDecideTask = new AxTask(new AxArtifactKey("PeriodicDecideTask", DEFAULT_VERSION)); - periodicDecideTask.duplicateInputFields(periodicEvent.getParameterMap()); - periodicDecideTask.duplicateOutputFields(periodicEvent.getParameterMap()); periodicDecideTask.setTaskLogic(new AxTaskLogic(periodicDecideTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask periodicActTask = new AxTask(new AxArtifactKey("PeriodicActTask", DEFAULT_VERSION)); - periodicActTask.duplicateInputFields(periodicEvent.getParameterMap()); - periodicActTask.duplicateOutputFields(sapcBlacklistSubscriberEvent.getParameterMap()); periodicActTask.getContextAlbumReferences().add(imsiStatusAlbum.getKey()); logicReader.setDefaultLogic(null); periodicActTask.setTaskLogic(new AxTaskLogic(periodicActTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); diff --git a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelFactory.java b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelFactory.java index d13f93099..7dbb4ad23 100644 --- a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelFactory.java +++ b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelFactory.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -168,43 +169,31 @@ public class AdaptiveDomainModelFactory { final AxTask anomalyDetectionMatchTask = new AxTask( new AxArtifactKey("AnomalyDetectionMatchTask", DEFAULT_VERSION)); - anomalyDetectionMatchTask.duplicateInputFields(anomalyDetectionTriggerEvent.getParameterMap()); - anomalyDetectionMatchTask.duplicateOutputFields(anomalyDetectionMatchEvent.getParameterMap()); anomalyDetectionMatchTask.setTaskLogic( new AxTaskLogic(anomalyDetectionMatchTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask anomalyDetectionEstablishTask = new AxTask( new AxArtifactKey("AnomalyDetectionEstablishTask", DEFAULT_VERSION)); - anomalyDetectionEstablishTask.duplicateInputFields(anomalyDetectionMatchEvent.getParameterMap()); - anomalyDetectionEstablishTask.duplicateOutputFields(anomalyDetectionEstablishEvent.getParameterMap()); anomalyDetectionEstablishTask.setTaskLogic( new AxTaskLogic(anomalyDetectionEstablishTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask anomalyDetectionDecideTask0 = new AxTask( new AxArtifactKey("AnomalyDetectionDecideTask0", DEFAULT_VERSION)); - anomalyDetectionDecideTask0.duplicateInputFields(anomalyDetectionEstablishEvent.getParameterMap()); - anomalyDetectionDecideTask0.duplicateOutputFields(anomalyDetectionDecideEvent.getParameterMap()); anomalyDetectionDecideTask0.setTaskLogic( new AxTaskLogic(anomalyDetectionDecideTask0.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask anomalyDetectionDecideTask1 = new AxTask( new AxArtifactKey("AnomalyDetectionDecideTask1", DEFAULT_VERSION)); - anomalyDetectionDecideTask1.duplicateInputFields(anomalyDetectionEstablishEvent.getParameterMap()); - anomalyDetectionDecideTask1.duplicateOutputFields(anomalyDetectionDecideEvent.getParameterMap()); anomalyDetectionDecideTask1.setTaskLogic( new AxTaskLogic(anomalyDetectionDecideTask1.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask anomalyDetectionDecideTask2 = new AxTask( new AxArtifactKey("AnomalyDetectionDecideTask2", DEFAULT_VERSION)); - anomalyDetectionDecideTask2.duplicateInputFields(anomalyDetectionEstablishEvent.getParameterMap()); - anomalyDetectionDecideTask2.duplicateOutputFields(anomalyDetectionDecideEvent.getParameterMap()); anomalyDetectionDecideTask2.setTaskLogic( new AxTaskLogic(anomalyDetectionDecideTask2.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask anomalyDetectionActTask = new AxTask( new AxArtifactKey("AnomalyDetectionActTask", DEFAULT_VERSION)); - anomalyDetectionActTask.duplicateInputFields(anomalyDetectionDecideEvent.getParameterMap()); - anomalyDetectionActTask.duplicateOutputFields(anomalyDetectionActEvent.getParameterMap()); anomalyDetectionActTask.setTaskLogic( new AxTaskLogic(anomalyDetectionActTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); @@ -417,65 +406,45 @@ public class AdaptiveDomainModelFactory { .setDefaultLogic("DefaultAutoLearnTask_Logic"); final AxTask autoLearnMatchTask = new AxTask(new AxArtifactKey("AutoLearnMatchTask", DEFAULT_VERSION)); - autoLearnMatchTask.duplicateInputFields(autoLearnTriggerEvent.getParameterMap()); - autoLearnMatchTask.duplicateOutputFields(autoLearnMatchEvent.getParameterMap()); autoLearnMatchTask.setTaskLogic(new AxTaskLogic(autoLearnMatchTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask autoLearnEstablishTask = new AxTask(new AxArtifactKey("AutoLearnEstablishTask", DEFAULT_VERSION)); - autoLearnEstablishTask.duplicateInputFields(autoLearnMatchEvent.getParameterMap()); - autoLearnEstablishTask.duplicateOutputFields(autoLearnEstablishEvent.getParameterMap()); autoLearnEstablishTask.setTaskLogic( new AxTaskLogic(autoLearnEstablishTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); logicReader.setDefaultLogic(null); final AxTask autoLearnDecideTask0 = new AxTask(new AxArtifactKey("AutoLearnDecideTask0", DEFAULT_VERSION)); - autoLearnDecideTask0.duplicateInputFields(autoLearnEstablishEvent.getParameterMap()); - autoLearnDecideTask0.duplicateOutputFields(autoLearnDecideEvent.getParameterMap()); autoLearnDecideTask0 .setTaskLogic(new AxTaskLogic(autoLearnDecideTask0.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask autoLearnDecideTask1 = new AxTask(new AxArtifactKey("AutoLearnDecideTask1", DEFAULT_VERSION)); - autoLearnDecideTask1.duplicateInputFields(autoLearnEstablishEvent.getParameterMap()); - autoLearnDecideTask1.duplicateOutputFields(autoLearnDecideEvent.getParameterMap()); autoLearnDecideTask1 .setTaskLogic(new AxTaskLogic(autoLearnDecideTask1.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask autoLearnDecideTask2 = new AxTask(new AxArtifactKey("AutoLearnDecideTask2", DEFAULT_VERSION)); - autoLearnDecideTask2.duplicateInputFields(autoLearnEstablishEvent.getParameterMap()); - autoLearnDecideTask2.duplicateOutputFields(autoLearnDecideEvent.getParameterMap()); autoLearnDecideTask2 .setTaskLogic(new AxTaskLogic(autoLearnDecideTask2.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask autoLearnDecideTask3 = new AxTask(new AxArtifactKey("AutoLearnDecideTask3", DEFAULT_VERSION)); - autoLearnDecideTask3.duplicateInputFields(autoLearnEstablishEvent.getParameterMap()); - autoLearnDecideTask3.duplicateOutputFields(autoLearnDecideEvent.getParameterMap()); autoLearnDecideTask3 .setTaskLogic(new AxTaskLogic(autoLearnDecideTask3.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask autoLearnDecideTask4 = new AxTask(new AxArtifactKey("AutoLearnDecideTask4", DEFAULT_VERSION)); - autoLearnDecideTask4.duplicateInputFields(autoLearnEstablishEvent.getParameterMap()); - autoLearnDecideTask4.duplicateOutputFields(autoLearnDecideEvent.getParameterMap()); autoLearnDecideTask4 .setTaskLogic(new AxTaskLogic(autoLearnDecideTask4.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask autoLearnDecideTask5 = new AxTask(new AxArtifactKey("AutoLearnDecideTask5", DEFAULT_VERSION)); - autoLearnDecideTask5.duplicateInputFields(autoLearnEstablishEvent.getParameterMap()); - autoLearnDecideTask5.duplicateOutputFields(autoLearnDecideEvent.getParameterMap()); autoLearnDecideTask5 .setTaskLogic(new AxTaskLogic(autoLearnDecideTask5.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTask autoLearnDecideTask6 = new AxTask(new AxArtifactKey("AutoLearnDecideTask6", DEFAULT_VERSION)); - autoLearnDecideTask6.duplicateInputFields(autoLearnEstablishEvent.getParameterMap()); - autoLearnDecideTask6.duplicateOutputFields(autoLearnDecideEvent.getParameterMap()); autoLearnDecideTask6 .setTaskLogic(new AxTaskLogic(autoLearnDecideTask6.getKey(), TASK_LOGIC, "MVEL", logicReader)); logicReader.setDefaultLogic("DefaultAutoLearnTask_Logic"); final AxTask autoLearnActTask = new AxTask(new AxArtifactKey("AutoLearnActTask", DEFAULT_VERSION)); - autoLearnActTask.duplicateInputFields(autoLearnDecideEvent.getParameterMap()); - autoLearnActTask.duplicateOutputFields(autoLearnActEvent.getParameterMap()); autoLearnActTask.setTaskLogic(new AxTaskLogic(autoLearnActTask.getKey(), TASK_LOGIC, "MVEL", logicReader)); final AxTasks autoLearnTasks = new AxTasks(new AxArtifactKey("AutoLearnTasks", DEFAULT_VERSION)); |