+ var num = 1
+ if (($('#formId'+num+' #tcaTable .highlight').length > 0 ) &&
+ (!($('#formId'+num+' #threshold').val()) || !($('#formId'+num+' #fieldPathM').val())) ) {
+ $('#formId'+num+' #tcaError').show();
+ return;
+ } else {
+ $('#formId'+num+' .tcaErr').hide();
+ if ($('#formId'+num+' #tcaTable .highlight').length > 0){
+ $('#formId'+num+' #tcaTable .highlight td').text(propertiesToString(num));
+ }
+ var saveP = {};
+ $('.formId').each(function(){
+ var count = $(this).attr('id').slice(-1);
+ var header = $(this).find('.tcaParentItems').serializeArray();
+ var sconf = {};
+ var sconfa = [];
+ var checkNF = true;
+ $('#formId' +count+' #tcaTable tr').each(function(){
+ $('td', this).each(function(){
+ var splitTd = $(this).text().split(' ');
+ splitTd[1]=defaults_props['tca']['operator'][splitTd[1]];
+ var checkByKpi = vf_Services["shared"]["byKpi"][splitTd[0].replace(/\s/g, "")];
+ if (checkByKpi["fieldPath"]){
+ splitTd.push(Object.keys(vf_Services["shared"]["byKpi"][splitTd[0].replace(/\s/g, "")]["fieldPath"])[0]);
+ };
+ if ((checkByKpi["nfNamingCode"]) && (checkNF)){
+ $.grep(header, function(e,i){
+ if (e.name == "tnfc"){
+ header[i]["value"] = (Object.keys(checkByKpi["nfNamingCode"])[0]);
+ }
+ });
+ checkNF = false;
+ }
+ sconfa.push(splitTd);
+ });
+
+ });
+ var polSel = $(this).find('.tcaParentItems #tcaPol').val();
+ $.grep(header, function(e,i){
+ if (e.name == "tcaPolId"){
+ if (polSel){
+ if (typeof allPolicies !== "undefined"){
+ header[i]["value"] = allPolicies[polSel][1]["value"];
+ } else if (typeof elementMap !== "undefined"){
+ for (key in elementMap){
+ if (key.indexOf("Policy")>-1){
+ header[i]["value"] = elementMap[key][polSel][1]["value"];
+ }
+ }
+ }
+ } else {
+ header[i]["value"]="";
+ }
+ }
+ });
+
+ sconf["serviceConfigurations"]=sconfa;
+ header.push(sconf);
+ saveP[$(this).find('.tcaParentItems #tname').val()] = header;
+ });