diff options
author | hekeguang <hekeguang@chinamobile.com> | 2022-08-30 11:39:28 +0800 |
---|---|---|
committer | hekeguang <hekeguang@chinamobile.com> | 2022-08-30 11:41:06 +0800 |
commit | 89c02e9c1b4328f68848fe4a6230d583089130b8 (patch) | |
tree | ba63e427557d55a618138a86e2fb55dd4ca72b44 /intentanalysis/src/main | |
parent | a6a29c67cbb22b9b120d08fe5310a45a16d987c6 (diff) |
Add intent definition process code .
Issue-ID: USECASEUI-696
Change-Id: I698ce892c116ebef22390a9844fd0d82bf6ed275
Signed-off-by: hekeguang <hekeguang@chinamobile.com>
Diffstat (limited to 'intentanalysis/src/main')
5 files changed, 36 insertions, 9 deletions
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessActuationModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessActuationModule.java index 1612090..4209c1b 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessActuationModule.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessActuationModule.java @@ -17,24 +17,33 @@ package org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule import org.onap.usecaseui.intentanalysis.bean.models.Intent; +import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean; import org.onap.usecaseui.intentanalysis.intentBaseService.IntentHandleService; import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule; import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction; import org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService.IntentProcessService; +import org.onap.usecaseui.intentanalysis.service.IntentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + @Service public class CLLBusinessActuationModule implements ActuationModule { @Autowired IntentProcessService processService; @Autowired IntentHandleService intentHandleService; + @Autowired + IntentService intentService; @Override public void sendToIntentHandler(IntentManagementFunction IntentHandler) { - } @Override @@ -48,7 +57,16 @@ public class CLLBusinessActuationModule implements ActuationModule { } @Override - public void saveIntentToDb() { + public void saveIntentToDb(List<Map<IntentGoalBean,IntentManagementFunction>> intentMapList) { + List<IntentGoalBean> subIntentGoalLit = new ArrayList<>(); + for (Map<IntentGoalBean,IntentManagementFunction> map:intentMapList) { + subIntentGoalLit.addAll(map.keySet()); + } + List<Intent> subIntentList = subIntentGoalLit.stream().map(IntentGoalBean::getIntent) + .collect(Collectors.toList()); + for (Intent subIntent:subIntentList) { + intentService.createIntent(subIntent); + } } } diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/ActuationModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/ActuationModule.java index 34ae57c..2800c1e 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/ActuationModule.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/ActuationModule.java @@ -15,14 +15,18 @@ */ package org.onap.usecaseui.intentanalysis.intentBaseService.intentModule; +import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean; import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction; +import java.util.List; +import java.util.Map; + public interface ActuationModule { //actuationModel & knownledgeModel interact void sendToIntentHandler(IntentManagementFunction IntentHandler); void sendToNonIntentHandler();//直接操作 void interactWithIntentHandle(); //Save intent information to the intent instance database - void saveIntentToDb(); + void saveIntentToDb(List<Map<IntentGoalBean,IntentManagementFunction>> intentMapList); } diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDefinitionService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDefinitionService.java index 9407f91..a75701d 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDefinitionService.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDefinitionService.java @@ -16,11 +16,16 @@ package org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService; +import org.onap.usecaseui.intentanalysis.bean.models.Intent; +import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean; import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction; import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule; import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; + @Service public class IntentDefinitionService { @@ -36,10 +41,10 @@ public class IntentDefinitionService { } } - public void definitionPorcess() { + public void definitionPorcess(List<Map<IntentGoalBean,IntentManagementFunction>> intentMapList) { DecisionModule intentDecisionModule = intentOwner.getDecisionModule(); ActuationModule intentActuationModule = intentOwner.getActuationModule(); intentDecisionModule.intentDefinition(); - intentActuationModule.saveIntentToDb(); + intentActuationModule.saveIntentToDb(intentMapList);//id type } } diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentOperationService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentOperationService.java index 6ffbc2d..47fe679 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentOperationService.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentOperationService.java @@ -38,9 +38,9 @@ public class IntentOperationService { public void operationProcess() { DecisionModule intentDecisionModule = intentOwner.getDecisionModule(); - ActuationModule intentActuationModule = intentOwner.getActuationModule(); + ActuationModule intentActuationModule = intentHandler.getActuationModule(); - intentDecisionModule.interactWithTemplateDb(); + //intentDecisionModule.interactWithTemplateDb(); intentActuationModule.interactWithIntentHandle(); intentActuationModule.sendToIntentHandler(intentHandler); diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessService.java index 6bff142..ec4037e 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessService.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessService.java @@ -60,9 +60,9 @@ public class IntentProcessService { for (Map<IntentGoalBean,IntentManagementFunction> map : intentListMap) { - //definition process + //definition process save subintent intentDefinitionService.setIntentRole(intentOwner,intentHandler); - intentDefinitionService.definitionPorcess(); + intentDefinitionService.definitionPorcess(intentListMap); //distribution process intentDistributionService.setIntentRole(intentOwner,intentHandler); |