diff options
author | Sébastien Determe <sd378r@intl.att.com> | 2017-09-08 10:44:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-08 10:44:21 +0000 |
commit | f0c6215103464e860b756d9e781b7e4d34b30541 (patch) | |
tree | fc0caded616831b2d1ab41db39fedcb7364df0f0 /src/main | |
parent | 72e904aa818b14e0f3d869c94cac3cb90930749e (diff) | |
parent | 4c14395a640b3f0f1d0422b5ff7f840ebee8e92d (diff) |
Merge "Add Holmes to the Backend"
Diffstat (limited to 'src/main')
13 files changed, 411 insertions, 193 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDelegate.java b/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDelegate.java new file mode 100644 index 00000000..db7b5241 --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDelegate.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * =================================================================== + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.clamp.clds.client; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; + +import java.util.UUID; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.onap.clamp.clds.model.prop.Holmes; +import org.onap.clamp.clds.model.prop.ModelProperties; +import org.onap.clamp.clds.model.refprop.RefProp; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * Send Holmes info to policy api. + */ +public class HolmesPolicyDelegate implements JavaDelegate { + protected static final EELFLogger logger = EELFManager.getInstance().getLogger(HolmesPolicyDelegate.class); + protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger(); + + @Autowired + private PolicyClient policyClient; + + @Autowired + private RefProp refProp; + + /** + * Perform activity. Send Holmes info to policy api. + * + * @param execution + */ + @Override + public void execute(DelegateExecution execution) throws Exception { + String holmesPolicyRequestUuid = UUID.randomUUID().toString(); + execution.setVariable("holmesPolicyRequestUuid", holmesPolicyRequestUuid); + + ModelProperties prop = ModelProperties.create(execution); + Holmes holmes = prop.getType(Holmes.class); + if (holmes.isFound()) { + String responseMessage = policyClient.sendMicroServiceInJson(holmes.getCorrelationLogic(), prop, + holmesPolicyRequestUuid); + if (responseMessage != null) { + execution.setVariable("holmesPolicyResponseMessage", responseMessage.getBytes()); + } + } + } + +} diff --git a/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegate.java b/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegate.java new file mode 100644 index 00000000..46b33ffe --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/client/HolmesPolicyDeleteDelegate.java @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * =================================================================== + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.clamp.clds.client; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.onap.clamp.clds.model.prop.Holmes; +import org.onap.clamp.clds.model.prop.ModelProperties; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * Delete Holmes Policy via policy api. + */ +public class HolmesPolicyDeleteDelegate implements JavaDelegate { + protected static final EELFLogger logger = EELFManager.getInstance() + .getLogger(HolmesPolicyDeleteDelegate.class); + protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger(); + + @Autowired + private PolicyClient policyClient; + + /** + * Perform activity. Delete Holmes Policy via policy api. + * + * @param execution + */ + @Override + public void execute(DelegateExecution execution) throws Exception { + ModelProperties prop = ModelProperties.create(execution); + Holmes holmes = prop.getType(Holmes.class); + if (holmes.isFound()) { + prop.setCurrentModelElementId(holmes.getId()); + + policyClient.deleteMicrosService(prop); + } + } + +} diff --git a/src/main/java/org/onap/clamp/clds/model/prop/Holmes.java b/src/main/java/org/onap/clamp/clds/model/prop/Holmes.java new file mode 100644 index 00000000..233f656e --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/model/prop/Holmes.java @@ -0,0 +1,71 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * =================================================================== + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.clamp.clds.model.prop; + +import com.fasterxml.jackson.databind.JsonNode; + +/** + * Parse Holmes bpmn parameters json properties. + * <p> + * Example json: + * [{"name":"correlationalLogic","value":"vcwx"},{"name":"operationalPolicy","value":"cccc"}] + * + */ +public class Holmes extends ModelElement { + + private static final String TYPE_HOLMES = "holmes"; + + private String correlationLogic; + + private String operationalPolicy; + + /** + * Default constructor for Holmes Element + * + * @param modelProp + * The ModelProperties containing the all the info, like bpmn, + * bpmn params, etc ... + * @param modelBpmn + * @param modelJson + */ + public Holmes(ModelProperties modelProp, ModelBpmn modelBpmn, JsonNode modelJson) { + super(TYPE_HOLMES, modelProp, modelBpmn, modelJson); + + correlationLogic = this.getValueByName("correlationalLogic"); + operationalPolicy = this.getValueByName("operationalPolicy"); + } + + public static final String getType() { + return TYPE_HOLMES; + } + + public String getCorrelationLogic() { + return correlationLogic; + } + + public String getOperationalPolicy() { + return operationalPolicy; + } + +} diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ModelBpmn.java b/src/main/java/org/onap/clamp/clds/model/prop/ModelBpmn.java index 63a03058..ae7028dc 100644 --- a/src/main/java/org/onap/clamp/clds/model/prop/ModelBpmn.java +++ b/src/main/java/org/onap/clamp/clds/model/prop/ModelBpmn.java @@ -23,6 +23,15 @@ package org.onap.clamp.clds.model.prop; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -33,15 +42,6 @@ import java.util.Map.Entry; import org.onap.clamp.clds.service.CldsService; -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - /** * Parse Model BPMN properties. * <p> @@ -50,9 +50,9 @@ import com.fasterxml.jackson.databind.node.ObjectNode; * :[{"id":"Policy_0oxeocn", "from":"StringMatch_0h6cbdv"}]} */ public class ModelBpmn { - protected static final EELFLogger logger = EELFManager.getInstance() + protected static final EELFLogger logger = EELFManager.getInstance() .getLogger(CldsService.class); - protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); + protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); // for each type, an array of entries private final Map<String, List<ModelBpmnEntry>> entriesByType = new HashMap<>(); @@ -123,12 +123,14 @@ public class ModelBpmn { } /** - * + * This method verifies if the ModelElement Type (collector, holmes, tca, + * ...) is in the list. * * @param type + * A model Element type (tca, collector, ...) * @return true if the element is found or false otherwise */ - public boolean getModelElementFound(String type) { + public boolean isModelElementTypeInList(String type) { return entriesByType.get(type) != null; } diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ModelElement.java b/src/main/java/org/onap/clamp/clds/model/prop/ModelElement.java index 42d11f4b..edf11426 100644 --- a/src/main/java/org/onap/clamp/clds/model/prop/ModelElement.java +++ b/src/main/java/org/onap/clamp/clds/model/prop/ModelElement.java @@ -32,20 +32,19 @@ import java.util.Iterator; import java.util.List; /** - * Provide base ModelElement functionality. + * Provide base ModelElement functionality. Perform base parsing of properties + * for a ModelElement (such as, Collector, StringMatch, Policy, Tca, Holmes, + * ...) */ public abstract class ModelElement { protected static final EELFLogger logger = EELFManager.getInstance().getLogger(ModelElement.class); protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); - public static final String TYPE_POLICY = "policy"; - public static final String TYPE_TCA = "tca"; - private final String type; private final ModelBpmn modelBpmn; private final String id; protected String topicPublishes; - protected final JsonNode meNode; + protected final JsonNode modelElementJsonNode; private boolean isFound; private final ModelProperties modelProp; @@ -64,12 +63,13 @@ public abstract class ModelElement { this.modelProp = modelProp; this.modelBpmn = modelBpmn; this.id = modelBpmn.getId(type); - this.meNode = modelJson.get(id); - this.isFound = modelBpmn.getModelElementFound(type); + this.modelElementJsonNode = modelJson.get(id); + this.isFound = modelBpmn.isModelElementTypeInList(type); } /** - * topicSubscribes is the topicPublishes of the from Model Element + * topicSubscribes is the topicPublishes of the from Model Element (the + * previous one in the chain). * * @return the topicSubscribes */ @@ -159,16 +159,14 @@ public abstract class ModelElement { while (i.hasNext()) { JsonNode node = i.next(); if (node.path("name").asText().equals(name)) { - String value; JsonNode vnode = node.path("value"); if (vnode.isArray()) { // if array, assume value is in first element - value = vnode.path(0).asText(); + values.add(vnode.path(0).asText()); } else { // otherwise, just return text - value = vnode.asText(); + values.add(vnode.asText()); } - values.add(value); } } } @@ -241,7 +239,7 @@ public abstract class ModelElement { * @return */ public String getValueByName(String name) { - return getValueByName(meNode, name); + return getValueByName(modelElementJsonNode, name); } /** @@ -252,7 +250,7 @@ public abstract class ModelElement { * @return */ public Integer getIntValueByName(String name) { - return getIntValueByName(meNode, name); + return getIntValueByName(modelElementJsonNode, name); } /** @@ -263,7 +261,7 @@ public abstract class ModelElement { * @return */ public List<String> getValuesByName(String name) { - return getValuesByName(meNode, name); + return getValuesByName(modelElementJsonNode, name); } /** diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ModelProperties.java b/src/main/java/org/onap/clamp/clds/model/prop/ModelProperties.java index 1cfd4616..9684eea8 100644 --- a/src/main/java/org/onap/clamp/clds/model/prop/ModelProperties.java +++ b/src/main/java/org/onap/clamp/clds/model/prop/ModelProperties.java @@ -23,6 +23,12 @@ package org.onap.clamp.clds.model.prop; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.HashSet; @@ -36,19 +42,13 @@ import org.onap.clamp.clds.model.CldsEvent; import org.onap.clamp.clds.model.CldsModel; import org.onap.clamp.clds.service.CldsService; -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - /** * Parse model properties. */ public class ModelProperties { - protected static final EELFLogger logger = EELFManager.getInstance() + protected static final EELFLogger logger = EELFManager.getInstance() .getLogger(CldsService.class); - protected static final EELFLogger auditLogger = EELFManager.getInstance() + protected static final EELFLogger auditLogger = EELFManager.getInstance() .getAuditLogger(); private ModelBpmn modelBpmn; @@ -58,10 +58,9 @@ public class ModelProperties { private final String controlName; private final String actionCd; // Flag indicate whether it is triggered by Validation Test button from UI - private final boolean isTest; + private final boolean isTest; private Global global; - private Tca tca; private final Map<String, ModelElement> modelElements = new ConcurrentHashMap<>(); @@ -93,8 +92,8 @@ public class ModelProperties { * @throws JsonProcessingException * @throws IOException */ - public ModelProperties(String modelName, String controlName, String actionCd, boolean isTest, String modelBpmnPropText, - String modelPropText) throws IOException { + public ModelProperties(String modelName, String controlName, String actionCd, boolean isTest, + String modelBpmnPropText, String modelPropText) throws IOException { this.modelName = modelName; this.controlName = controlName; this.actionCd = actionCd; @@ -150,7 +149,7 @@ public class ModelProperties { Global global = new Global(modelJson); vfs = global.getResourceVf(); } catch (IOException e) { - // VF is null + logger.warn("no VF found", e); } String vf = null; if (vfs != null && !vfs.isEmpty()) { @@ -168,13 +167,12 @@ public class ModelProperties { * @throws IOException */ public static ModelProperties create(DelegateExecution execution) throws IOException { - // String modelProp = (String) execution.getVariable("modelProp"); String modelProp = new String((byte[]) execution.getVariable("modelProp")); String modelBpmnProp = (String) execution.getVariable("modelBpmnProp"); String modelName = (String) execution.getVariable("modelName"); String controlName = (String) execution.getVariable("controlName"); String actionCd = (String) execution.getVariable("actionCd"); - boolean isTest = (boolean)execution.getVariable("isTest"); + boolean isTest = (boolean) execution.getVariable("isTest"); return new ModelProperties(modelName, controlName, actionCd, isTest, modelBpmnProp, modelProp); } @@ -303,12 +301,12 @@ public class ModelProperties { return actionCd; } - /** - * @return the isTest - */ - public boolean isTest() { - return isTest; - } + /** + * @return the isTest + */ + public boolean isTest() { + return isTest; + } /** * @return the isCreateRequest @@ -352,14 +350,4 @@ public class ModelProperties { String type = modelElementClasses.get(clazz); return (type != null ? (T) modelElements.get(type) : null); } - - /** - * @return the tca - */ - public Tca getTca() { - if (tca == null) { - tca = new Tca(this, modelBpmn, modelJson); - } - return tca; - } } diff --git a/src/main/java/org/onap/clamp/clds/model/prop/Policy.java b/src/main/java/org/onap/clamp/clds/model/prop/Policy.java index 6673af21..452af20c 100644 --- a/src/main/java/org/onap/clamp/clds/model/prop/Policy.java +++ b/src/main/java/org/onap/clamp/clds/model/prop/Policy.java @@ -23,14 +23,14 @@ package org.onap.clamp.clds.model.prop; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.fasterxml.jackson.databind.JsonNode; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + /** * Parse Policy json properties. * <p> @@ -49,12 +49,12 @@ import com.fasterxml.jackson.databind.JsonNode; * "vf3RtPi"]}]]}] */ public class Policy extends ModelElement { - protected static final EELFLogger logger = EELFManager.getInstance().getLogger(Policy.class); + protected static final EELFLogger logger = EELFManager.getInstance().getLogger(Policy.class); protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); - private List<PolicyChain> policyChains; + private List<PolicyChain> policyChains; - private static final String TYPE_POLICY = "policy"; + private static final String TYPE_POLICY = "policy"; /** * Parse Policy given json node. @@ -64,12 +64,12 @@ public class Policy extends ModelElement { * @param modelJson */ public Policy(ModelProperties modelProp, ModelBpmn modelBpmn, JsonNode modelJson) { - super(ModelElement.TYPE_POLICY, modelProp, modelBpmn, modelJson); + super(TYPE_POLICY, modelProp, modelBpmn, modelJson); // process policies - if (meNode != null) { - Iterator<JsonNode> itr = meNode.elements(); - policyChains = new ArrayList<PolicyChain>(); + if (modelElementJsonNode != null) { + Iterator<JsonNode> itr = modelElementJsonNode.elements(); + policyChains = new ArrayList<>(); while (itr.hasNext()) { policyChains.add(new PolicyChain(itr.next())); } diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java b/src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java index de98333a..6e986bb0 100644 --- a/src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java +++ b/src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java @@ -23,14 +23,14 @@ package org.onap.clamp.clds.model.prop; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.fasterxml.jackson.databind.JsonNode; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + /** * Parse Resource Group json properties. * @@ -63,8 +63,8 @@ import com.fasterxml.jackson.databind.JsonNode; */ public class ResourceGroup { - protected static final EELFLogger logger = EELFManager.getInstance().getLogger(ResourceGroup.class); - protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); + protected static final EELFLogger logger = EELFManager.getInstance().getLogger(ResourceGroup.class); + protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); private String groupNumber; private String policyId; @@ -84,7 +84,7 @@ public class ResourceGroup { // process Server_Configurations JsonNode serviceConfigurationsNode = node.get(node.size() - 1).get("serviceConfigurations"); Iterator<JsonNode> itr = serviceConfigurationsNode.elements(); - serviceConfigurations = new ArrayList<ServiceConfiguration>(); + serviceConfigurations = new ArrayList<>(); while (itr.hasNext()) { serviceConfigurations.add(new ServiceConfiguration(itr.next())); } diff --git a/src/main/java/org/onap/clamp/clds/model/prop/StringMatch.java b/src/main/java/org/onap/clamp/clds/model/prop/StringMatch.java index b20db0af..7fcc1b1b 100644 --- a/src/main/java/org/onap/clamp/clds/model/prop/StringMatch.java +++ b/src/main/java/org/onap/clamp/clds/model/prop/StringMatch.java @@ -23,14 +23,12 @@ package org.onap.clamp.clds.model.prop; +import com.fasterxml.jackson.databind.JsonNode; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import com.fasterxml.jackson.databind.JsonNode; - /** * Parse StringMatch json properties. * <p> @@ -62,12 +60,10 @@ import com.fasterxml.jackson.databind.JsonNode; * */ public class StringMatch extends ModelElement { - protected static final EELFLogger logger = EELFManager.getInstance().getLogger(StringMatch.class); - protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); - private List<ResourceGroup> resourceGroups; + private List<ResourceGroup> resourceGroups; - private static final String TYPE_STRING_MATCH = "stringMatch"; + private static final String TYPE_STRING_MATCH = "stringMatch"; /** * Parse StringMatch given json node. @@ -79,9 +75,9 @@ public class StringMatch extends ModelElement { super(TYPE_STRING_MATCH, modelProp, modelBpmn, modelJson); // process Server_Configurations - if (meNode != null) { - Iterator<JsonNode> itr = meNode.elements(); - resourceGroups = new ArrayList<ResourceGroup>(); + if (modelElementJsonNode != null) { + Iterator<JsonNode> itr = modelElementJsonNode.elements(); + resourceGroups = new ArrayList<>(); while (itr.hasNext()) { resourceGroups.add(new ResourceGroup(itr.next())); } diff --git a/src/main/java/org/onap/clamp/clds/model/prop/Tca.java b/src/main/java/org/onap/clamp/clds/model/prop/Tca.java index b94f5230..6bc68e23 100644 --- a/src/main/java/org/onap/clamp/clds/model/prop/Tca.java +++ b/src/main/java/org/onap/clamp/clds/model/prop/Tca.java @@ -23,14 +23,14 @@ package org.onap.clamp.clds.model.prop; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.fasterxml.jackson.databind.JsonNode; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + /** * Parse Tca json properties. * @@ -50,12 +50,12 @@ import com.fasterxml.jackson.databind.JsonNode; */ public class Tca extends ModelElement { - protected static final EELFLogger logger = EELFManager.getInstance().getLogger(Tca.class); + protected static final EELFLogger logger = EELFManager.getInstance().getLogger(Tca.class); protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); - private List<TcaItem> tcaItems; + private List<TcaItem> tcaItems; - private static final String TYPE_TCA = "tca"; + private static final String TYPE_TCA = "tca"; /** * Parse Tca given json node @@ -68,9 +68,9 @@ public class Tca extends ModelElement { super(TYPE_TCA, modelProp, modelBpmn, modelJson); // process Server_Configurations - if (meNode != null) { - Iterator<JsonNode> itr = meNode.elements(); - tcaItems = new ArrayList<TcaItem>(); + if (modelElementJsonNode != null) { + Iterator<JsonNode> itr = modelElementJsonNode.elements(); + tcaItems = new ArrayList<>(); while (itr.hasNext()) { tcaItems.add(new TcaItem(itr.next())); } diff --git a/src/main/java/org/onap/clamp/clds/transform/XslTransformer.java b/src/main/java/org/onap/clamp/clds/transform/XslTransformer.java index d15f67c7..684bae3f 100644 --- a/src/main/java/org/onap/clamp/clds/transform/XslTransformer.java +++ b/src/main/java/org/onap/clamp/clds/transform/XslTransformer.java @@ -34,6 +34,8 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; +import org.onap.clamp.clds.util.ResourceFileUtil; + /** * XSL Transformer. */ @@ -43,7 +45,7 @@ public class XslTransformer { public void setXslResourceName(String xslResourceName) throws TransformerConfigurationException { TransformerFactory tfactory = TransformerFactory.newInstance(); - templates = tfactory.newTemplates(new StreamSource(TransformUtil.getResourceAsStream(xslResourceName))); + templates = tfactory.newTemplates(new StreamSource(ResourceFileUtil.getResourceAsStream(xslResourceName))); } /** @@ -53,7 +55,7 @@ public class XslTransformer { * @throws TransformerException */ public String doXslTransformToString(String xml) throws TransformerException { - StringWriter output = new StringWriter(4000); + StringWriter output = new StringWriter(4096); Transformer transformer = templates.newTransformer(); transformer.transform(new StreamSource(new StringReader(xml)), new StreamResult(output)); diff --git a/src/main/resources/bpmn/clds-process-action.bpmn b/src/main/resources/bpmn/clds-process-action.bpmn index d9f8619c..78016240 100644 --- a/src/main/resources/bpmn/clds-process-action.bpmn +++ b/src/main/resources/bpmn/clds-process-action.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_-A31MBMpEea185sFktMJ7Q" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.2" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_-A31MBMpEea185sFktMJ7Q" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:collaboration id="_Collaboration_2"> <bpmn2:participant id="_Participant_2" name="Process Action" processRef="clds-process-action-wf" /> </bpmn2:collaboration> @@ -13,26 +13,27 @@ <bpmn2:flowNodeRef>sendOpPolicyReqDistribute</bpmn2:flowNodeRef> <bpmn2:flowNodeRef>StartEvent_1</bpmn2:flowNodeRef> <bpmn2:flowNodeRef>ServiceTask_0x8ypxf</bpmn2:flowNodeRef> - <bpmn2:flowNodeRef>sendStringMatchingReqDistribute</bpmn2:flowNodeRef> <bpmn2:flowNodeRef>sendTcaReqDistribute</bpmn2:flowNodeRef> + <bpmn2:flowNodeRef>sendStringMatchingReqDistribute</bpmn2:flowNodeRef> + <bpmn2:flowNodeRef>sendHolmesReqDistribute</bpmn2:flowNodeRef> </bpmn2:lane> <bpmn2:lane id="Lane_5" name="Delete"> <bpmn2:flowNodeRef>sendStringMatchingReqDelete</bpmn2:flowNodeRef> - <bpmn2:flowNodeRef>sendOpPolicyReqDelete</bpmn2:flowNodeRef> <bpmn2:flowNodeRef>sendTcaReqDelete</bpmn2:flowNodeRef> + <bpmn2:flowNodeRef>sendOpPolicyReqDelete</bpmn2:flowNodeRef> + <bpmn2:flowNodeRef>sendHolmesReqDelete</bpmn2:flowNodeRef> </bpmn2:lane> <bpmn2:lane id="Lane_4" name="Update"> <bpmn2:flowNodeRef>sendOpPolicyReqUpdate</bpmn2:flowNodeRef> <bpmn2:flowNodeRef>sendStringMatchingReqUpdate</bpmn2:flowNodeRef> <bpmn2:flowNodeRef>sendTcaReqUpdate</bpmn2:flowNodeRef> + <bpmn2:flowNodeRef>sendHolmesReqUpdate</bpmn2:flowNodeRef> </bpmn2:lane> <bpmn2:lane id="Lane_6" name="Stop"> <bpmn2:flowNodeRef>sendOpPolicyReqStop</bpmn2:flowNodeRef> - <bpmn2:flowNodeRef>ServiceTask_0d5zgbw</bpmn2:flowNodeRef> </bpmn2:lane> <bpmn2:lane id="Lane_7" name="Restart"> <bpmn2:flowNodeRef>sendOpPolicyReqRestart</bpmn2:flowNodeRef> - <bpmn2:flowNodeRef>ServiceTask_04d5jlr</bpmn2:flowNodeRef> </bpmn2:lane> </bpmn2:laneSet> <bpmn2:exclusiveGateway id="ExclusiveGateway_2"> @@ -69,34 +70,32 @@ <bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_7" name="" sourceRef="ExclusiveGateway_3" targetRef="insEvent" /> - <bpmn2:sequenceFlow id="SequenceFlow_14" name="" sourceRef="sendStringMatchingReqDistribute" targetRef="sendTcaReqDistribute" /> <bpmn2:serviceTask id="sendOpPolicyReqDistribute" name="Send Operation Policy Request [Submit]" camunda:delegateExpression="${operationalPolicyDelegate}"> - <bpmn2:incoming>SequenceFlow_1rga27p</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_1tu9g11</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_10</bpmn2:outgoing> </bpmn2:serviceTask> <bpmn2:sequenceFlow id="SequenceFlow_10" name="" sourceRef="sendOpPolicyReqDistribute" targetRef="ExclusiveGateway_3" /> <bpmn2:serviceTask id="sendOpPolicyReqUpdate" name="Send Operation Policy Request [Update]" camunda:delegateExpression="${operationalPolicyDelegate}"> - <bpmn2:incoming>SequenceFlow_1kegg6u</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_0ejpmee</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_28</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_26" name="" sourceRef="sendStringMatchingReqUpdate" targetRef="sendTcaReqUpdate" /> <bpmn2:sequenceFlow id="SequenceFlow_27" name="" sourceRef="ExclusiveGateway_2" targetRef="sendStringMatchingReqUpdate"> <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${ actionCd == 'UPDATE' }]]></bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_28" name="" sourceRef="sendOpPolicyReqUpdate" targetRef="ExclusiveGateway_3" /> <bpmn2:serviceTask id="sendOpPolicyReqStop" name="Send Operation Policy Request [Stop]" camunda:delegateExpression="${operationalPolicyDeleteDelegate}"> - <bpmn2:incoming>SequenceFlow_17snsdc</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_29</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_30</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_29" name="" sourceRef="ExclusiveGateway_2" targetRef="ServiceTask_0d5zgbw"> + <bpmn2:sequenceFlow id="SequenceFlow_29" name="" sourceRef="ExclusiveGateway_2" targetRef="sendOpPolicyReqStop"> <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${ actionCd == 'STOP' }]]></bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_30" name="" sourceRef="sendOpPolicyReqStop" targetRef="ExclusiveGateway_3" /> <bpmn2:serviceTask id="sendOpPolicyReqRestart" name="Send Operation Policy Request [Restart]" camunda:delegateExpression="${operationalPolicyDelegate}"> - <bpmn2:incoming>SequenceFlow_188n2z7</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_31</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_32</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_31" name="" sourceRef="ExclusiveGateway_2" targetRef="ServiceTask_04d5jlr"> + <bpmn2:sequenceFlow id="SequenceFlow_31" name="" sourceRef="ExclusiveGateway_2" targetRef="sendOpPolicyReqRestart"> <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${ actionCd == 'RESTART' }]]></bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_32" name="" sourceRef="sendOpPolicyReqRestart" targetRef="ExclusiveGateway_3" /> @@ -122,43 +121,50 @@ <bpmn2:incoming>SequenceFlow_1xlfq66</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0w39hon</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_188n2z7" sourceRef="ServiceTask_04d5jlr" targetRef="sendOpPolicyReqRestart" /> - <bpmn2:serviceTask id="ServiceTask_04d5jlr" name="Send HighlandPark Service request to Policy[Restart]" camunda:delegateExpression="${highlandParkPolicyDelegate}"> - <bpmn2:incoming>SequenceFlow_31</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_188n2z7</bpmn2:outgoing> + <bpmn2:sequenceFlow id="SequenceFlow_1rga27p" sourceRef="sendTcaReqDistribute" targetRef="sendHolmesReqDistribute" /> + <bpmn2:sequenceFlow id="SequenceFlow_0tpegxf" sourceRef="sendTcaReqDelete" targetRef="sendHolmesReqDelete" /> + <bpmn2:serviceTask id="sendTcaReqDelete" name="Send Tca Micro Service request to Policy [Delete]" camunda:delegateExpression="${tcaPolicyDeleteDelegate}"> + <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_0tpegxf</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_17snsdc" sourceRef="ServiceTask_0d5zgbw" targetRef="sendOpPolicyReqStop" /> - <bpmn2:serviceTask id="ServiceTask_0d5zgbw" name="Send HighlandPark Service request to Policy[Stop]" camunda:delegateExpression="${highlandParkPolicyDelegate}"> - <bpmn2:incoming>SequenceFlow_29</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_17snsdc</bpmn2:outgoing> + <bpmn2:sequenceFlow id="SequenceFlow_1kegg6u" sourceRef="sendTcaReqUpdate" targetRef="sendHolmesReqUpdate" /> + <bpmn2:serviceTask id="sendTcaReqDistribute" name="Send Tca Micro Service request to Policy [Submit]" camunda:delegateExpression="${tcaPolicyDelegate}"> + <bpmn2:incoming>SequenceFlow_14</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_1rga27p</bpmn2:outgoing> </bpmn2:serviceTask> <bpmn2:serviceTask id="sendStringMatchingReqDistribute" name="Send String Match Micro Service request to Policy [Submit]" camunda:delegateExpression="${stringMatchPolicyDelegate}"> <bpmn2:incoming>SequenceFlow_0w39hon</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_1rga27p" sourceRef="sendTcaReqDistribute" targetRef="sendOpPolicyReqDistribute" /> - <bpmn2:serviceTask id="sendTcaReqDistribute" name="Send Tca Micro Service request to Policy [Submit]" camunda:delegateExpression="${tcaPolicyDelegate}"> - <bpmn2:incoming>SequenceFlow_14</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_1rga27p</bpmn2:outgoing> + <bpmn2:sequenceFlow id="SequenceFlow_14" name="" sourceRef="sendStringMatchingReqDistribute" targetRef="sendTcaReqDistribute" /> + <bpmn2:sequenceFlow id="SequenceFlow_1tu9g11" sourceRef="sendHolmesReqDistribute" targetRef="sendOpPolicyReqDistribute" /> + <bpmn2:serviceTask id="sendHolmesReqDistribute" name="Send Holmes Micro Service request to Policy [Submit]" camunda:delegateExpression="${holmesPolicyDelegate}"> + <bpmn2:incoming>SequenceFlow_1rga27p</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_1tu9g11</bpmn2:outgoing> </bpmn2:serviceTask> <bpmn2:serviceTask id="sendOpPolicyReqDelete" name="Send Operation Policy Request [Delete]" camunda:delegateExpression="${operationalPolicyDeleteDelegate}"> - <bpmn2:incoming>SequenceFlow_0tpegxf</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_1mtizad</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_0tpegxf" sourceRef="sendTcaReqDelete" targetRef="sendOpPolicyReqDelete" /> - <bpmn2:serviceTask id="sendTcaReqDelete" name="Send Tca Micro Service request to Policy [Delete]" camunda:delegateExpression="${tcaPolicyDeleteDelegate}"> - <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_0tpegxf</bpmn2:outgoing> + <bpmn2:serviceTask id="sendHolmesReqDelete" name="Send Holmes Micro Service request to Policy [Delete]" camunda:delegateExpression="${holmesPolicyDeleteDelegate}"> + <bpmn2:incoming>SequenceFlow_0tpegxf</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_1mtizad</bpmn2:outgoing> </bpmn2:serviceTask> + <bpmn2:sequenceFlow id="SequenceFlow_1mtizad" sourceRef="sendHolmesReqDelete" targetRef="sendOpPolicyReqDelete" /> <bpmn2:serviceTask id="sendStringMatchingReqUpdate" name="Send String Match Micro Service request to Policy [Update]" camunda:delegateExpression="${stringMatchPolicyDelegate}"> <bpmn2:incoming>SequenceFlow_27</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_26</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_1kegg6u" sourceRef="sendTcaReqUpdate" targetRef="sendOpPolicyReqUpdate" /> <bpmn2:serviceTask id="sendTcaReqUpdate" name="Send Tca Micro Service request to Policy [Update]" camunda:delegateExpression="${tcaPolicyDelegate}"> <bpmn2:incoming>SequenceFlow_26</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1kegg6u</bpmn2:outgoing> </bpmn2:serviceTask> + <bpmn2:sequenceFlow id="SequenceFlow_26" name="" sourceRef="sendStringMatchingReqUpdate" targetRef="sendTcaReqUpdate" /> + <bpmn2:serviceTask id="sendHolmesReqUpdate" name="Send Holmes Micro Service request to Policy [Update]" camunda:delegateExpression="${holmesPolicyDelegate}"> + <bpmn2:incoming>SequenceFlow_1kegg6u</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_0ejpmee</bpmn2:outgoing> + </bpmn2:serviceTask> + <bpmn2:sequenceFlow id="SequenceFlow_0ejpmee" sourceRef="sendHolmesReqUpdate" targetRef="sendOpPolicyReqUpdate" /> </bpmn2:process> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="_Collaboration_2"> @@ -175,16 +181,16 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_8" bpmnElement="sendStringMatchingReqDistribute"> - <dc:Bounds x="615" y="89" width="100" height="80" /> + <dc:Bounds x="400" y="89" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_6" bpmnElement="sendOpPolicyReqDistribute"> <dc:Bounds x="912" y="89" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_8" targetElement="_BPMNShape_ServiceTask_6"> - <di:waypoint xsi:type="dc:Point" x="715" y="129" /> - <di:waypoint xsi:type="dc:Point" x="761" y="129" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_8" targetElement="ServiceTask_1r1brt6_di"> + <di:waypoint xsi:type="dc:Point" x="500" y="129" /> + <di:waypoint xsi:type="dc:Point" x="546" y="129" /> <bpmndi:BPMNLabel> - <dc:Bounds x="881" y="192" width="6" height="6" /> + <dc:Bounds x="624" y="192" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_7" bpmnElement="insEvent"> @@ -235,19 +241,19 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_ServiceTask_6" targetElement="_BPMNShape_ExclusiveGateway_4"> - <di:waypoint xsi:type="dc:Point" x="1012" y="127" /> - <di:waypoint xsi:type="dc:Point" x="1052" y="125" /> - <di:waypoint xsi:type="dc:Point" x="1052" y="229" /> - <di:waypoint xsi:type="dc:Point" x="1104" y="232" /> + <di:waypoint xsi:type="dc:Point" x="1012" y="130" /> + <di:waypoint xsi:type="dc:Point" x="1057" y="130" /> + <di:waypoint xsi:type="dc:Point" x="1057" y="233" /> + <di:waypoint xsi:type="dc:Point" x="1104" y="233" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1049" y="192" width="6" height="6" /> + <dc:Bounds x="1027" y="178.5" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_11" bpmnElement="sendStringMatchingReqDelete"> <dc:Bounds x="348" y="385" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_12" bpmnElement="sendOpPolicyReqDelete"> - <dc:Bounds x="645" y="385" width="100" height="80" /> + <dc:Bounds x="831" y="385" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_ServiceTask_11" targetElement="_BPMNShape_ServiceTask_12"> <di:waypoint xsi:type="dc:Point" x="448" y="425" /> @@ -260,22 +266,22 @@ <dc:Bounds x="30" y="484" width="1339" height="117" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_14" bpmnElement="sendStringMatchingReqUpdate"> - <dc:Bounds x="615" y="500" width="100" height="80" /> + <dc:Bounds x="350" y="500" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_15" bpmnElement="sendOpPolicyReqUpdate"> <dc:Bounds x="912" y="500" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_26" bpmnElement="SequenceFlow_26" sourceElement="_BPMNShape_ServiceTask_14" targetElement="_BPMNShape_ServiceTask_15"> - <di:waypoint xsi:type="dc:Point" x="715" y="540" /> - <di:waypoint xsi:type="dc:Point" x="761" y="540" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_26" bpmnElement="SequenceFlow_26" sourceElement="_BPMNShape_ServiceTask_14" targetElement="ServiceTask_08pqhb3_di"> + <di:waypoint xsi:type="dc:Point" x="450" y="540" /> + <di:waypoint xsi:type="dc:Point" x="496" y="540" /> <bpmndi:BPMNLabel> - <dc:Bounds x="887" y="540" width="6" height="6" /> + <dc:Bounds x="580" y="540" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_27" bpmnElement="SequenceFlow_27" sourceElement="_BPMNShape_ExclusiveGateway_3" targetElement="_BPMNShape_ServiceTask_14"> <di:waypoint xsi:type="dc:Point" x="169" y="262" /> <di:waypoint xsi:type="dc:Point" x="169" y="540" /> - <di:waypoint xsi:type="dc:Point" x="615" y="540" /> + <di:waypoint xsi:type="dc:Point" x="350" y="540" /> <bpmndi:BPMNLabel> <dc:Bounds x="139" y="398" width="90" height="6" /> </bpmndi:BPMNLabel> @@ -283,10 +289,10 @@ <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_28" sourceElement="_BPMNShape_ServiceTask_15" targetElement="_BPMNShape_ExclusiveGateway_4"> <di:waypoint xsi:type="dc:Point" x="1012" y="539" /> <di:waypoint xsi:type="dc:Point" x="1058" y="538" /> - <di:waypoint xsi:type="dc:Point" x="1058" y="230" /> - <di:waypoint xsi:type="dc:Point" x="1104" y="232" /> + <di:waypoint xsi:type="dc:Point" x="1058" y="233" /> + <di:waypoint xsi:type="dc:Point" x="1104" y="233" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1055" y="381" width="6" height="6" /> + <dc:Bounds x="1028" y="382.5" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_Lane_10" bpmnElement="Lane_6" isHorizontal="true"> @@ -297,11 +303,10 @@ </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_29" sourceElement="_BPMNShape_ExclusiveGateway_3" targetElement="_BPMNShape_ServiceTask_16"> <di:waypoint xsi:type="dc:Point" x="169" y="262" /> - <di:waypoint xsi:type="dc:Point" x="169" y="658" /> - <di:waypoint xsi:type="dc:Point" x="553" y="659" /> - <di:waypoint xsi:type="dc:Point" x="615" y="659" /> + <di:waypoint xsi:type="dc:Point" x="169" y="659" /> + <di:waypoint xsi:type="dc:Point" x="912" y="659" /> <bpmndi:BPMNLabel> - <dc:Bounds x="344" y="658" width="6" height="6" /> + <dc:Bounds x="139" y="457.5" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_30" bpmnElement="SequenceFlow_30" sourceElement="_BPMNShape_ServiceTask_16" targetElement="_BPMNShape_ExclusiveGateway_4"> @@ -310,7 +315,7 @@ <di:waypoint xsi:type="dc:Point" x="1058" y="233" /> <di:waypoint xsi:type="dc:Point" x="1104" y="233" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1055" y="441" width="6" height="6" /> + <dc:Bounds x="1028" y="442.5" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_Lane_11" bpmnElement="Lane_7" isHorizontal="true"> @@ -322,18 +327,18 @@ <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_31" bpmnElement="SequenceFlow_31" sourceElement="_BPMNShape_ExclusiveGateway_3" targetElement="_BPMNShape_ServiceTask_17"> <di:waypoint xsi:type="dc:Point" x="169" y="262" /> <di:waypoint xsi:type="dc:Point" x="169" y="775" /> - <di:waypoint xsi:type="dc:Point" x="615" y="775" /> + <di:waypoint xsi:type="dc:Point" x="912" y="775" /> <bpmndi:BPMNLabel> - <dc:Bounds x="285" y="775" width="6" height="6" /> + <dc:Bounds x="139" y="515.5" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_32" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ServiceTask_17" targetElement="_BPMNShape_ExclusiveGateway_4"> <di:waypoint xsi:type="dc:Point" x="1012" y="775" /> <di:waypoint xsi:type="dc:Point" x="1058" y="775" /> - <di:waypoint xsi:type="dc:Point" x="1058" y="232" /> - <di:waypoint xsi:type="dc:Point" x="1104" y="233" /> + <di:waypoint xsi:type="dc:Point" x="1058" y="234" /> + <di:waypoint xsi:type="dc:Point" x="1105" y="234" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1055" y="500" width="6" height="6" /> + <dc:Bounds x="1028" y="501.5" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ExclusiveGateway_3" targetElement="_BPMNShape_ServiceTask_11"> @@ -349,9 +354,9 @@ </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0w39hon_di" bpmnElement="SequenceFlow_0w39hon"> <di:waypoint xsi:type="dc:Point" x="304" y="129" /> - <di:waypoint xsi:type="dc:Point" x="615" y="129" /> + <di:waypoint xsi:type="dc:Point" x="400" y="129" /> <bpmndi:BPMNLabel> - <dc:Bounds x="414.5" y="114" width="90" height="0" /> + <dc:Bounds x="307" y="114" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1xlfq66_di" bpmnElement="SequenceFlow_1xlfq66"> @@ -362,56 +367,66 @@ <dc:Bounds x="184" y="170.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_188n2z7_di" bpmnElement="SequenceFlow_188n2z7"> - <di:waypoint xsi:type="dc:Point" x="715" y="775" /> - <di:waypoint xsi:type="dc:Point" x="912" y="775" /> + <bpmndi:BPMNEdge id="SequenceFlow_1rga27p_di" bpmnElement="SequenceFlow_1rga27p"> + <di:waypoint xsi:type="dc:Point" x="646" y="129" /> + <di:waypoint xsi:type="dc:Point" x="729" y="129" /> <bpmndi:BPMNLabel> - <dc:Bounds x="768" y="750" width="90" height="20" /> + <dc:Bounds x="642.5" y="104" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_04d5jlr_di" bpmnElement="ServiceTask_04d5jlr"> - <dc:Bounds x="615" y="735" width="100" height="80" /> + <bpmndi:BPMNShape id="ServiceTask_1r1brt6_di" bpmnElement="sendTcaReqDistribute"> + <dc:Bounds x="546" y="89" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_17snsdc_di" bpmnElement="SequenceFlow_17snsdc"> - <di:waypoint xsi:type="dc:Point" x="715" y="659" /> - <di:waypoint xsi:type="dc:Point" x="912" y="659" /> + <bpmndi:BPMNEdge id="SequenceFlow_0tpegxf_di" bpmnElement="SequenceFlow_0tpegxf"> + <di:waypoint xsi:type="dc:Point" x="596" y="425" /> + <di:waypoint xsi:type="dc:Point" x="665" y="425" /> <bpmndi:BPMNLabel> - <dc:Bounds x="768.5" y="634" width="90" height="20" /> + <dc:Bounds x="585.5" y="400" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0d5zgbw_di" bpmnElement="ServiceTask_0d5zgbw"> - <dc:Bounds x="615" y="619" width="100" height="80" /> + <bpmndi:BPMNShape id="ServiceTask_0y2gwy4_di" bpmnElement="sendTcaReqDelete"> + <dc:Bounds x="495.71500000000003" y="385" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1rga27p_di" bpmnElement="SequenceFlow_1rga27p"> - <di:waypoint xsi:type="dc:Point" x="861" y="129" /> + <bpmndi:BPMNEdge id="SequenceFlow_1kegg6u_di" bpmnElement="SequenceFlow_1kegg6u"> + <di:waypoint xsi:type="dc:Point" x="596" y="540" /> + <di:waypoint xsi:type="dc:Point" x="688" y="540" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="597" y="515" width="90" height="20" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_08pqhb3_di" bpmnElement="sendTcaReqUpdate"> + <dc:Bounds x="496" y="500" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1a6a3ro_di" bpmnElement="sendHolmesReqDistribute"> + <dc:Bounds x="729" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1tu9g11_di" bpmnElement="SequenceFlow_1tu9g11"> + <di:waypoint xsi:type="dc:Point" x="829" y="129" /> <di:waypoint xsi:type="dc:Point" x="912" y="129" /> <bpmndi:BPMNLabel> - <dc:Bounds x="841.5" y="119" width="90" height="20" /> + <dc:Bounds x="870.5" y="108" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1r1brt6_di" bpmnElement="sendTcaReqDistribute"> - <dc:Bounds x="760.715" y="89" width="100" height="80" /> + <bpmndi:BPMNShape id="ServiceTask_1234ame_di" bpmnElement="sendHolmesReqDelete"> + <dc:Bounds x="665" y="385" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0tpegxf_di" bpmnElement="SequenceFlow_0tpegxf"> - <di:waypoint xsi:type="dc:Point" x="596" y="425" /> - <di:waypoint xsi:type="dc:Point" x="645" y="425" /> + <bpmndi:BPMNEdge id="SequenceFlow_1mtizad_di" bpmnElement="SequenceFlow_1mtizad"> + <di:waypoint xsi:type="dc:Point" x="765" y="425" /> + <di:waypoint xsi:type="dc:Point" x="831" y="425" /> <bpmndi:BPMNLabel> - <dc:Bounds x="575.5" y="415" width="90" height="20" /> + <dc:Bounds x="798" y="404" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0y2gwy4_di" bpmnElement="sendTcaReqDelete"> - <dc:Bounds x="495.71500000000003" y="385" width="100" height="80" /> + <bpmndi:BPMNShape id="ServiceTask_17vvyrl_di" bpmnElement="sendHolmesReqUpdate"> + <dc:Bounds x="688" y="500" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1kegg6u_di" bpmnElement="SequenceFlow_1kegg6u"> - <di:waypoint xsi:type="dc:Point" x="861" y="540" /> + <bpmndi:BPMNEdge id="SequenceFlow_0ejpmee_di" bpmnElement="SequenceFlow_0ejpmee"> + <di:waypoint xsi:type="dc:Point" x="788" y="540" /> <di:waypoint xsi:type="dc:Point" x="912" y="540" /> <bpmndi:BPMNLabel> - <dc:Bounds x="841.5" y="530" width="90" height="20" /> + <dc:Bounds x="850" y="519" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_08pqhb3_di" bpmnElement="sendTcaReqUpdate"> - <dc:Bounds x="761" y="500" width="100" height="80" /> - </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn2:definitions> diff --git a/src/main/resources/xsl/clds-bpmn-transformer.xsl b/src/main/resources/xsl/clds-bpmn-transformer.xsl index 94af952f..8a39be55 100644 --- a/src/main/resources/xsl/clds-bpmn-transformer.xsl +++ b/src/main/resources/xsl/clds-bpmn-transformer.xsl @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- ============LICENSE_START======================================================= ONAP CLAMP @@ -56,6 +56,18 @@ <xsl:for-each select="bpmn2:tCA" > <xsl:call-template name="network-element" /> </xsl:for-each> + <xsl:text>],</xsl:text> + + <xsl:text>"holmes":[</xsl:text> + <xsl:for-each select="bpmn2:holmes" > + <xsl:call-template name="network-element" /> + </xsl:for-each> + <xsl:text>],</xsl:text> + + <xsl:text>"vesCollector":[</xsl:text> + <xsl:for-each select="bpmn2:vesCollector" > + <xsl:call-template name="network-element" /> + </xsl:for-each> <xsl:text>]</xsl:text> <xsl:text>}</xsl:text> |