aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'intentanalysis/src/main')
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java26
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceDecisionModule.java25
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryDecisionModule.java11
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java12
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/DecisionModule.java7
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDefinitionService.java4
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentOperationService.java6
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessService.java4
8 files changed, 89 insertions, 6 deletions
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java
index 722fce9..3e4a53c 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java
@@ -26,6 +26,7 @@ import org.onap.usecaseui.intentanalysis.bean.models.*;
import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule;
import org.onap.usecaseui.intentanalysis.service.ImfRegInfoService;
+import org.onap.usecaseui.intentanalysis.service.IntentService;
import org.onap.usecaseui.intentanalysis.util.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
@@ -42,6 +43,9 @@ public class CLLBusinessDecisionModule extends DecisionModule {
@Autowired
private ApplicationContext applicationContext;
+ @Autowired
+ IntentService intentService;
+
@Override
public void determineUltimateGoal() {
}
@@ -141,5 +145,27 @@ public class CLLBusinessDecisionModule extends DecisionModule {
return intentMap;
}
+ @Override
+ public void updateIntentInfo(Intent originIntent, IntentGoalBean intentGoalBean){
+
+ Intent subIntent = intentGoalBean.getIntent();
+ if (subIntent.getIntentName().contains("delivery")){
+ List<Expectation> deliveryIntentExpectationList = intentGoalBean.getIntent().getIntentExpectations();
+ List<Expectation> originIntentExpectationList = originIntent.getIntentExpectations();
+ ExpectationObject deliveryExpectationObject = deliveryIntentExpectationList.get(0).getExpectationObject();
+ String objectInstance = deliveryExpectationObject.getObjectInstance();
+
+ for (Expectation originExpectation : originIntentExpectationList) {
+ ExpectationObject originExpectationObject = originExpectation.getExpectationObject();
+ originExpectationObject.setObjectInstance(objectInstance);
+ }
+ }
+ }
+
+ @Override
+ public void updateIntentWithOriginIntent(Intent originIntent, Intent intent){
+
+ }
+
}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceDecisionModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceDecisionModule.java
index b2bf018..3e60bf5 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceDecisionModule.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceDecisionModule.java
@@ -15,6 +15,9 @@
*/
package org.onap.usecaseui.intentanalysis.cllassuranceIntentmgt.cllassurancemodule;
+import java.util.List;
+import org.onap.usecaseui.intentanalysis.bean.models.Expectation;
+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.DecisionModule;
@@ -29,6 +32,11 @@ public class CLLAssuranceDecisionModule extends DecisionModule {
}
@Override
+ public void updateIntentInfo(Intent originIntent, IntentGoalBean intentGoalBean){
+
+ }
+
+ @Override
public IntentManagementFunction exploreIntentHandlers(IntentGoalBean intentGoalBean) {
return null;
}
@@ -48,4 +56,21 @@ public class CLLAssuranceDecisionModule extends DecisionModule {
public LinkedHashMap<IntentGoalBean, IntentManagementFunction> findHandler(IntentGoalBean intentGoalBean) {
return null;
}
+
+ @Override
+ public void updateIntentWithOriginIntent(Intent originIntent, Intent intent){
+ List<Expectation> originIntentExpectationList = originIntent.getIntentExpectations();
+
+ String instanceId = "";
+ for (Expectation expectation : originIntentExpectationList) {
+ if (expectation.getExpectationName().contains("assurance")){
+ instanceId = expectation.getExpectationObject().getObjectInstance();
+ break;
+ }
+ }
+
+ for (Expectation expectation : intent.getIntentExpectations()) {
+ expectation.getExpectationObject().setObjectInstance(instanceId);
+ }
+ }
}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryDecisionModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryDecisionModule.java
index 62d7d4c..0ae0867 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryDecisionModule.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryDecisionModule.java
@@ -15,6 +15,7 @@
*/
package org.onap.usecaseui.intentanalysis.clldeliveryIntentmgt.clldeliverymodule;
+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.DecisionModule;
@@ -48,4 +49,14 @@ public class CLLDeliveryDecisionModule extends DecisionModule {
public LinkedHashMap<IntentGoalBean, IntentManagementFunction> findHandler(IntentGoalBean intentGoalBean) {
return null;
}
+
+ @Override
+ public void updateIntentWithOriginIntent(Intent originIntent, Intent intent){
+
+ }
+
+ @Override
+ public void updateIntentInfo(Intent originIntent, IntentGoalBean intentGoalBean){
+
+ }
}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java
index dddadc6..7a24bf2 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java
@@ -17,6 +17,7 @@ package org.onap.usecaseui.intentanalysis.formatintentinputMgt.formatintentinput
import org.apache.commons.lang.StringUtils;
import org.onap.usecaseui.intentanalysis.bean.models.Expectation;
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.CLLBusinessIntentManagementFunction;
import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
@@ -87,4 +88,15 @@ public class FormatIntentInputDecisionModule extends DecisionModule {
//todo
return null;
}
+
+
+ @Override
+ public void updateIntentWithOriginIntent(Intent originIntent, Intent intent){
+
+ }
+
+ @Override
+ public void updateIntentInfo(Intent originIntent, IntentGoalBean intentGoalBean){
+
+ }
}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/DecisionModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/DecisionModule.java
index 7701acc..a8beef3 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/DecisionModule.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/DecisionModule.java
@@ -32,18 +32,23 @@ public abstract class DecisionModule {
// find intentManageFunction
public abstract IntentManagementFunction exploreIntentHandlers(IntentGoalBean intentGoalBean);
- public Intent intentDefinition(Intent intent) {
+ public Intent intentDefinition(Intent originIntent, Intent intent) {
intent.setIntentId(CommonUtil.getUUid());
List<Expectation> originalExpectationList = intent.getIntentExpectations();
List<Expectation> newExpectationList = getNewExpectationList(originalExpectationList);
intent.setIntentExpectations(newExpectationList);
+ updateIntentWithOriginIntent(originIntent, intent);
return intent;
}
+ public abstract void updateIntentWithOriginIntent(Intent originIntent, Intent intent);
+
public abstract void decideSuitableAction();
public abstract void interactWithTemplateDb();
+ public abstract void updateIntentInfo(Intent originIntent, IntentGoalBean intentGoalBean);
+
public abstract LinkedHashMap<IntentGoalBean, IntentManagementFunction> findHandler(IntentGoalBean intentGoalBean);
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 a0e2eed..d2fc54f 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
@@ -40,10 +40,10 @@ public class IntentDefinitionService {
}
}
- public void definitionPorcess(Map.Entry<IntentGoalBean, IntentManagementFunction> entry) {
+ public void definitionPorcess(Intent originIntent, Map.Entry<IntentGoalBean, IntentManagementFunction> entry) {
DecisionModule intentDecisionModule = intentOwner.getDecisionModule();
ActuationModule intentActuationModule = intentOwner.getActuationModule();
- Intent newIdIntent = intentDecisionModule.intentDefinition(entry.getKey().getIntent());
+ Intent newIdIntent = intentDecisionModule.intentDefinition(originIntent, entry.getKey().getIntent());
intentActuationModule.saveIntentToDb(newIdIntent);//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 74cd89c..575ca55 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
@@ -16,6 +16,7 @@
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;
@@ -37,7 +38,7 @@ public class IntentOperationService {
}
}
- public void operationProcess(IntentGoalBean intentGoalBean) {
+ public void operationProcess(Intent originIntent, IntentGoalBean intentGoalBean) {
DecisionModule intentDecisionModule = intentOwner.getDecisionModule();
ActuationModule intentActuationModule = intentHandler.getActuationModule();
@@ -45,5 +46,8 @@ public class IntentOperationService {
intentActuationModule.interactWithIntentHandle();
//determine whether to operate directly or send to next intent handler
intentActuationModule.fulfillIntent(intentGoalBean, intentHandler);
+
+ //update origin intent if need
+ intentDecisionModule.updateIntentInfo(originIntent, intentGoalBean);
}
}
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 3bc58e1..8b50a47 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
@@ -67,14 +67,14 @@ public class IntentProcessService {
Map.Entry<IntentGoalBean, IntentManagementFunction> next = iterator.next();
//definition process save subintent
intentDefinitionService.setIntentRole(intentOwner, intentHandler);
- intentDefinitionService.definitionPorcess(next);
+ intentDefinitionService.definitionPorcess(intent, next);
//distribution process
intentDistributionService.setIntentRole(intentOwner, intentHandler);
intentDistributionService.distributionProcess(next);
intentOperationService.setIntentRole(intentOwner, next.getValue());
- intentOperationService.operationProcess(next.getKey());
+ intentOperationService.operationProcess(intent, next.getKey());
}
}