@Override
- public void sendToIntentHandler(IntentManagementFunction IntentHandler) {
+ public void sendToIntentHandler(Intent intent,IntentManagementFunction IntentHandler) {
+ processService.setIntentRole(IntentHandler, null);
+ processService.intentProcess(intent);
}
@Override
public void interactWithIntentHandle() {
}
-
- @Override
- 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);
- }
-
- }
}
package org.onap.usecaseui.intentanalysis.formatintentinputMgt;
import lombok.Data;
-import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule.CLLBusinessActuationModule;
-import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule.CLLBusinessDecisionModule;
-import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule.CLLBusinessKnowledgeModule;
-import org.onap.usecaseui.intentanalysis.formatintentinputMgt.formatintentinputModule.FormatIntentInputActuationModule;
-import org.onap.usecaseui.intentanalysis.formatintentinputMgt.formatintentinputModule.FormatIntentInputDecisionModule;
-import org.onap.usecaseui.intentanalysis.formatintentinputMgt.formatintentinputModule.FormatIntentInputKnowledgeModule;
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.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
this.knowledgeModule=knowledgeModule;
}
@Resource(name= "formatIntentInputActuationModule")
- public void setKnowledgeModule(ActuationModule actuationModule) {
+ public void setActuationModule(ActuationModule actuationModule) {
+
this.actuationModule=actuationModule;
}
@Resource(name= "formatIntentInputDecisionModule")
- public void setKnowledgeModule(DecisionModule decisionModule) {
+ public void setDecisionModule(DecisionModule decisionModule) {
+
this.decisionModule=decisionModule;
}
}
*/
package org.onap.usecaseui.intentanalysis.formatintentinputMgt.formatintentinputModule;
-import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule;
+import org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService.IntentProcessService;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-
-import java.util.List;
-import java.util.Map;
@Component
public class FormatIntentInputActuationModule extends ActuationModule {
+ @Autowired
+ IntentProcessService processService;
@Override
- public void sendToIntentHandler(IntentManagementFunction IntentHandler) {
+ public void sendToIntentHandler(Intent intent, IntentManagementFunction IntentHandler) {
+ processService.setIntentRole(IntentHandler, null);
+ processService.intentProcess(intent);
}
@Override
@Override
public void interactWithIntentHandle() {
}
-
- @Override
- public void saveIntentToDb(List<Map<IntentGoalBean, IntentManagementFunction>> intentMapList) {
- //
- }
-
- @Override
- public boolean distrubuteIntentToHandler(Map<IntentGoalBean, IntentManagementFunction> intentMap) {
- return false;
- }
}
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.stream.Collectors;
@Component
public class FormatIntentInputDecisionModule extends DecisionModule {
@Override
public IntentManagementFunction exploreIntentHandlers(IntentGoalBean intentGoalBean) {
// if intentName contain cll return
- if (StringUtils.equalsIgnoreCase(intentGoalBean.getIntent().getIntentName(), "cll")) {
- return (IntentManagementFunction) applicationContext.getBean(CLLBusinessIntentManagementFunction.class.getName());
+ if (intentGoalBean.getIntent().getIntentName().toLowerCase(Locale.ROOT).contains("cll")) {
+ return (IntentManagementFunction) applicationContext.getBean(CLLBusinessIntentManagementFunction.class.getSimpleName());
}
return null;
}
@Override
public List<Map<IntentGoalBean, IntentManagementFunction>> findHandler(IntentGoalBean intentGoalBean) {
+ List<Map<IntentGoalBean, IntentManagementFunction>> intentMapList = new ArrayList<>();
boolean needDecompostion = needDecompostion(intentGoalBean);
if (needDecompostion) {
intentDecomposition(intentGoalBean);
+ }else{
+ Map<IntentGoalBean, IntentManagementFunction> map = new HashMap<>();
+ map.put(intentGoalBean, exploreIntentHandlers(intentGoalBean));
+ intentMapList.add(map);
}
- exploreIntentHandlers(intentGoalBean);
- return null;
+ return intentMapList;
}
public boolean needDecompostion(IntentGoalBean intentGoalBean) {
import org.apache.commons.lang.StringUtils;
import org.onap.usecaseui.intentanalysis.bean.enums.IntentGoalType;
+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.intentinterfaceservice.IntentInterfaceService;
+import org.onap.usecaseui.intentanalysis.service.IntentService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
public abstract class ActuationModule {
@Autowired
IntentInterfaceService intentInterfaceService;
+ @Autowired
+ IntentService intentService;
//actuationModel & knownledgeModel interact
- public abstract void sendToIntentHandler(IntentManagementFunction IntentHandler);
+ public abstract void sendToIntentHandler(Intent intent, IntentManagementFunction IntentHandler);
public abstract void sendToNonIntentHandler();//直接操作
public abstract void interactWithIntentHandle();
//Save intent information to the intent instance database
- public abstract void saveIntentToDb(List<Map<IntentGoalBean, IntentManagementFunction>> intentMapList);
+ public void saveIntentToDb(Map<IntentGoalBean, IntentManagementFunction> intentMap) {
+ List<Intent> subIntentList = intentMap.keySet().stream().map(IntentGoalBean::getIntent)
+ .collect(Collectors.toList());
+ for (Intent subIntent : subIntentList) {
+ intentService.createIntent(subIntent);
+ }
+ }
public boolean distrubuteIntentToHandler(Map<IntentGoalBean, IntentManagementFunction> intentMap) {
for (Map.Entry<IntentGoalBean, IntentManagementFunction> entry : intentMap.entrySet()) {
}
}
- public void definitionPorcess(List<Map<IntentGoalBean,IntentManagementFunction>> intentMapList) {
+ public void definitionPorcess(Map<IntentGoalBean,IntentManagementFunction> intentMap) {
DecisionModule intentDecisionModule = intentOwner.getDecisionModule();
ActuationModule intentActuationModule = intentOwner.getActuationModule();
intentDecisionModule.intentDefinition();
- intentActuationModule.saveIntentToDb(intentMapList);//id type
+ intentActuationModule.saveIntentToDb(intentMap);//id type
}
}
package org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService;
-import org.apache.commons.lang.StringUtils;
-import org.onap.usecaseui.intentanalysis.bean.enums.IntentGoalType;
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.intentinterfaceservice.IntentInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.util.List;
import java.util.Map;
@Service
public boolean distributionProcess(Map<IntentGoalBean, IntentManagementFunction> intentMap) {
- intentOwner.getActuationModule().distrubuteIntentToHandler(intentMap);
- return false;
+ return intentOwner.getActuationModule().distrubuteIntentToHandler(intentMap);
+
}
}
package org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService;
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule;
}
}
- public void operationProcess() {
+ public void operationProcess(Intent intent) {
DecisionModule intentDecisionModule = intentOwner.getDecisionModule();
- ActuationModule intentActuationModule = intentHandler.getActuationModule();
+ ActuationModule intentActuationModule = intentOwner.getActuationModule();
//intentDecisionModule.interactWithTemplateDb();
intentActuationModule.interactWithIntentHandle();
- intentActuationModule.sendToIntentHandler(intentHandler);
+
+ intentActuationModule.sendToIntentHandler(intent,intentHandler);
intentActuationModule.sendToNonIntentHandler();
}
for (Map<IntentGoalBean,IntentManagementFunction> map : intentListMap) {
//definition process save subintent
intentDefinitionService.setIntentRole(intentOwner,intentHandler);
- intentDefinitionService.definitionPorcess(intentListMap);
+ intentDefinitionService.definitionPorcess(map);
//distribution process
intentDistributionService.setIntentRole(intentOwner,intentHandler);
intentDistributionService.distributionProcess(map);
- //operation process
- intentOperationService.setIntentRole(intentOwner,intentHandler);
- intentOperationService.operationProcess();
+ //operation process enery entry only have one key-value
+ for (Map.Entry<IntentGoalBean, IntentManagementFunction> entry : map.entrySet()) {
+ intentOperationService.setIntentRole(intentOwner,entry.getValue());
+ intentOperationService.operationProcess(entry.getKey().getIntent());
+ }
+
}
}
<insert id="insertIMFRegInfoRegInfo">
insert into intent_management_function_reg_info(imfr_info_id, imfr_info_description, support_model,handle_name,intent_function_type)
values
- (#{imfregInfo.id}, #{imfregInfo.description}, #{imfregInfo.supportArea},#{imfregInfo.handleName},#{imfregInfo.intentFunctionType})
+ (#{imfregInfo.id}, #{imfregInfo.description}, #{imfregInfo.supportModel},#{imfregInfo.handleName},#{imfregInfo.intentFunctionType})
</insert>
<select id="getImfRegInfoList" resultType="org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionRegInfo">