diff options
10 files changed, 183 insertions, 118 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/CommonTimestampGenerator.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/CommonTimestampGenerator.java new file mode 100644 index 0000000000..02ce540265 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/CommonTimestampGenerator.java @@ -0,0 +1,26 @@ +package org.onap.so.bpmn.common.util; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; + +public class CommonTimestampGenerator { + + private final DateTimeFormatter formatter; + + public CommonTimestampGenerator(String format) { + this.formatter = DateTimeFormatter.ofPattern(format).withZone(ZoneId.systemDefault()); + } + + public CommonTimestampGenerator() { + this.formatter = null; + } + + public String generateCurrentTimestamp() { + if (formatter != null) { + return formatter.format(Instant.now()); + } else { + return Instant.now().toString(); + } + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/TimestampGeneratorUtil.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/TimestampGeneratorUtil.java new file mode 100644 index 0000000000..f74bd57c00 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/TimestampGeneratorUtil.java @@ -0,0 +1,19 @@ +package org.onap.so.bpmn.common.util; + +public final class TimestampGeneratorUtil { + + private static final String APPC_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'.0Z'"; + private static final CommonTimestampGenerator APPC_TIMESTAMP_GENERATOR = new CommonTimestampGenerator(APPC_FORMAT); + + public static final CommonTimestampGenerator COMMON_GENERATOR = new CommonTimestampGenerator(); + + private TimestampGeneratorUtil() {} + + public static String generateCurrentTimestamp(String contollerType) { + if (contollerType.equals("APPC")) { + return APPC_TIMESTAMP_GENERATOR.generateCurrentTimestamp(); + } else { + return COMMON_GENERATOR.generateCurrentTimestamp(); + } + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerClient.java index e810fc0259..c73299ffc3 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerClient.java @@ -7,9 +7,9 @@ * 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. @@ -20,15 +20,12 @@ package org.onap.so.client.appc; +import static org.onap.so.bpmn.common.util.TimestampGeneratorUtil.generateCurrentTimestamp; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.time.Instant; import java.util.Properties; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; -import org.onap.so.bpmn.core.UrnPropertiesReader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.onap.appc.client.lcm.api.AppcClientServiceFactoryProvider; import org.onap.appc.client.lcm.api.AppcLifeCycleManagerServiceFactory; import org.onap.appc.client.lcm.api.ApplicationContext; @@ -43,6 +40,9 @@ import org.onap.appc.client.lcm.model.Flags.Mode; import org.onap.appc.client.lcm.model.Payload; import org.onap.appc.client.lcm.model.Status; import org.onap.appc.client.lcm.model.ZULU; +import org.onap.so.bpmn.core.UrnPropertiesReader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ApplicationControllerClient { @@ -77,7 +77,7 @@ public class ApplicationControllerClient { /** * Creates an ApplicationControllerClient for the specified controller type. - * + * * @param controllerType the controller type: "appc" or "sdnc". */ public ApplicationControllerClient(String controllerType) { @@ -90,7 +90,7 @@ public class ApplicationControllerClient { /** * Gets the controller type. - * + * * @return the controllertype */ public String getControllerType() { @@ -100,11 +100,11 @@ public class ApplicationControllerClient { /** * Returns the AppC client object associated with this ApplicationControllerClient. AppC client objects are shared * objects. One is created if it does not exist. - * + * * @return the client object, or null if creation failed */ public LifeCycleManagerStateful getAppCClient() { - return appCClients.computeIfAbsent(controllerType, k -> createAppCClient(k)); + return appCClients.computeIfAbsent(controllerType, this::createAppCClient); } protected LifeCycleManagerStateful createAppCClient(String controllerType) { @@ -194,8 +194,7 @@ public class ApplicationControllerClient { flags.setForce(force); flags.setTtl(FLAGS_TTL); commonHeader.setFlags(flags); - Instant timestamp = Instant.now(); - ZULU zulu = new ZULU(timestamp.toString()); + ZULU zulu = new ZULU(generateCurrentTimestamp(this.controllerType)); commonHeader.setTimestamp(zulu); return commonHeader; } diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn index c46d504186..065d7e0c4b 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn @@ -7,7 +7,7 @@ <bpmn:sequenceFlow id="SequenceFlow_0gmfit3" sourceRef="StartEvent_1" targetRef="ServiceTask_0inxg9l" /> <bpmn:endEvent id="EndEvent_0lgvk82"> <bpmn:incoming>SequenceFlow_1mkhog2</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0no1qag</bpmn:incoming> + <bpmn:incoming>Flow_0qmjpxv</bpmn:incoming> </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_1mkhog2" sourceRef="Task_1hs1mn0" targetRef="EndEvent_0lgvk82" /> <bpmn:serviceTask id="Task_1hs1mn0" name="Update AAI" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatus(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")), execution.getVariable("scope"), execution.getVariable("action"))}"> @@ -24,7 +24,7 @@ <bpmn:outgoing>SequenceFlow_07tqu82</bpmn:outgoing> <bpmn:outgoing>SequenceFlow_15gxql1</bpmn:outgoing> </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_07tqu82" name="success" sourceRef="ExclusiveGateway_13q340y" targetRef="Task_1hs1mn0"> + <bpmn:sequenceFlow id="SequenceFlow_07tqu82" name="successCDS" sourceRef="ExclusiveGateway_13q340y" targetRef="Task_1hs1mn0"> <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:endEvent id="EndEvent_0mnaj50"> @@ -44,8 +44,10 @@ <bpmn:sequenceFlow id="SequenceFlow_1lspfyy" sourceRef="ServiceTask_0inxg9l" targetRef="ExclusiveGateway_0plxwkg" /> <bpmn:callActivity id="BBToExecute" name="BB to Execute " calledElement="${bbName}"> <bpmn:extensionElements> + <camunda:in source="gBuildingBlockExecution" target="gBuildingBlockExecution" /> <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:out source="WorkflowExceptionErrorMessage" target="WorkflowExceptionErrorMessage" /> + <camunda:out source="ControllerStatus" target="ControllerStatus" /> <camunda:in source="executionObject" target="executionObject" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="isRollback" target="isRollback" /> @@ -53,10 +55,9 @@ </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0fv03vt</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0no1qag</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0op5irz</bpmn:outgoing> </bpmn:callActivity> <bpmn:sequenceFlow id="SequenceFlow_1t7hs4k" sourceRef="ExclusiveGateway_0plxwkg" targetRef="Task_1rc2j9" /> - <bpmn:sequenceFlow id="SequenceFlow_0no1qag" sourceRef="BBToExecute" targetRef="EndEvent_0lgvk82" /> + <bpmn:sequenceFlow id="SequenceFlow_0no1qag" sourceRef="BBToExecute" targetRef="Gateway_065nxpu" /> <bpmn:sequenceFlow id="SequenceFlow_0fv03vt" sourceRef="Task_1rc2j9" targetRef="BBToExecute" /> <bpmn:serviceTask id="Task_1rc2j9" name="select BB " camunda:expression="${ControllerExecution.selectBB(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_1t7hs4k</bpmn:incoming> @@ -66,33 +67,94 @@ <bpmn:incoming>SequenceFlow_0op5irz</bpmn:incoming> <bpmn:errorEventDefinition id="ErrorEventDefinition_0z001cu" errorRef="Error_0aovtfv" /> </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0op5irz" sourceRef="BBToExecute" targetRef="EndEvent_1lxwuh2" /> + <bpmn:sequenceFlow id="SequenceFlow_0op5irz" sourceRef="Gateway_065nxpu" targetRef="EndEvent_1lxwuh2" /> <bpmn:sequenceFlow id="SequenceFlow_0vzx2yr" name="Actor= CDS" sourceRef="ExclusiveGateway_0plxwkg" targetRef="Task_0bhf6tp"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("actor") == "CDS"}</bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("actor") == "CDS"}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:exclusiveGateway id="Gateway_065nxpu" default="SequenceFlow_0op5irz"> + <bpmn:incoming>SequenceFlow_0no1qag</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0op5irz</bpmn:outgoing> + <bpmn:outgoing>Flow_0qmjpxv</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:sequenceFlow id="Flow_0qmjpxv" name="success" sourceRef="Gateway_065nxpu" targetRef="EndEvent_0lgvk82"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression> </bpmn:sequenceFlow> </bpmn:process> <bpmn:error id="Error_0aovtfv" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ControllerExecutionBB"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> - <dc:Bounds x="160" y="323" width="36" height="36" /> + <bpmndi:BPMNEdge id="Flow_0qmjpxv_di" bpmnElement="Flow_0qmjpxv"> + <di:waypoint x="1147" y="233" /> + <di:waypoint x="1147" y="323" /> <bpmndi:BPMNLabel> - <dc:Bounds x="-17" y="279" width="90" height="20" /> + <dc:Bounds x="1170" y="263" width="41" height="14" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0gmfit3_di" bpmnElement="SequenceFlow_0gmfit3"> - <di:waypoint x="196" y="341" /> - <di:waypoint x="259" y="341" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0vzx2yr_di" bpmnElement="SequenceFlow_0vzx2yr"> + <di:waypoint x="424" y="366" /> + <di:waypoint x="424" y="462" /> + <di:waypoint x="572" y="462" /> <bpmndi:BPMNLabel> - <dc:Bounds x="32.5" y="236" width="90" height="20" /> + <dc:Bounds x="455" y="436" width="60" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_0lgvk82_di" bpmnElement="EndEvent_0lgvk82"> - <dc:Bounds x="1129" y="323" width="36" height="36" /> + <bpmndi:BPMNEdge id="SequenceFlow_0op5irz_di" bpmnElement="SequenceFlow_0op5irz"> + <di:waypoint x="1147" y="183" /> + <di:waypoint x="1147" y="128" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1025" y="251" width="90" height="20" /> + <dc:Bounds x="739" y="58" width="0" height="12" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0fv03vt_di" bpmnElement="SequenceFlow_0fv03vt"> + <di:waypoint x="672" y="208" /> + <di:waypoint x="824" y="208" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="598" y="107" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0no1qag_di" bpmnElement="SequenceFlow_0no1qag"> + <di:waypoint x="924" y="208" /> + <di:waypoint x="1122" y="208" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="840.5" y="107" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1t7hs4k_di" bpmnElement="SequenceFlow_1t7hs4k"> + <di:waypoint x="424" y="316" /> + <di:waypoint x="424" y="208" /> + <di:waypoint x="572" y="208" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="271" y="89" width="83" height="36" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1lspfyy_di" bpmnElement="SequenceFlow_1lspfyy"> + <di:waypoint x="359" y="341" /> + <di:waypoint x="399" y="341" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="229" y="240" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_15gxql1_di" bpmnElement="SequenceFlow_15gxql1"> + <di:waypoint x="893" y="487" /> + <di:waypoint x="893" y="565" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="713" y="436" width="90" height="20" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_07tqu82_di" bpmnElement="SequenceFlow_07tqu82"> + <di:waypoint x="918" y="462" /> + <di:waypoint x="979" y="462" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="908" y="443" width="64" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_05qembo_di" bpmnElement="SequenceFlow_05qembo"> + <di:waypoint x="672" y="462" /> + <di:waypoint x="868" y="462" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="725" y="437" width="90" height="20" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1mkhog2_di" bpmnElement="SequenceFlow_1mkhog2"> <di:waypoint x="1079" y="462" /> <di:waypoint x="1147" y="462" /> @@ -101,16 +163,28 @@ <dc:Bounds x="918" y="357" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0404s6a_di" bpmnElement="Task_1hs1mn0"> - <dc:Bounds x="979" y="422" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_05qembo_di" bpmnElement="SequenceFlow_05qembo"> - <di:waypoint x="672" y="462" /> - <di:waypoint x="868" y="462" /> + <bpmndi:BPMNEdge id="SequenceFlow_0gmfit3_di" bpmnElement="SequenceFlow_0gmfit3"> + <di:waypoint x="196" y="341" /> + <di:waypoint x="259" y="341" /> <bpmndi:BPMNLabel> - <dc:Bounds x="725" y="437" width="90" height="20" /> + <dc:Bounds x="32.5" y="236" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> + <dc:Bounds x="160" y="323" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="-17" y="279" width="90" height="20" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_0lgvk82_di" bpmnElement="EndEvent_0lgvk82"> + <dc:Bounds x="1129" y="323" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1025" y="251" width="90" height="20" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0404s6a_di" bpmnElement="Task_1hs1mn0"> + <dc:Bounds x="979" y="422" width="100" height="80" /> + </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_01mv1si_di" bpmnElement="Task_0bhf6tp"> <dc:Bounds x="572" y="422" width="100" height="80" /> </bpmndi:BPMNShape> @@ -120,26 +194,12 @@ <dc:Bounds x="698" y="327" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_07tqu82_di" bpmnElement="SequenceFlow_07tqu82"> - <di:waypoint x="918" y="462" /> - <di:waypoint x="979" y="462" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="856" y="409" width="41" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_0mnaj50_di" bpmnElement="EndEvent_0mnaj50"> <dc:Bounds x="875" y="565" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="698" y="531" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_15gxql1_di" bpmnElement="SequenceFlow_15gxql1"> - <di:waypoint x="893" y="487" /> - <di:waypoint x="893" y="565" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="713" y="436" width="90" height="20" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0inxg9l_di" bpmnElement="ServiceTask_0inxg9l"> <dc:Bounds x="259" y="301" width="100" height="80" /> </bpmndi:BPMNShape> @@ -149,63 +209,21 @@ <dc:Bounds x="309" y="255" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1lspfyy_di" bpmnElement="SequenceFlow_1lspfyy"> - <di:waypoint x="359" y="341" /> - <di:waypoint x="399" y="341" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="229" y="240" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_01dem38_di" bpmnElement="BBToExecute"> <dc:Bounds x="824" y="168" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1t7hs4k_di" bpmnElement="SequenceFlow_1t7hs4k"> - <di:waypoint x="424" y="316" /> - <di:waypoint x="424" y="208" /> - <di:waypoint x="572" y="208" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="271" y="89" width="83" height="36" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0no1qag_di" bpmnElement="SequenceFlow_0no1qag"> - <di:waypoint x="924" y="208" /> - <di:waypoint x="1147" y="208" /> - <di:waypoint x="1147" y="323" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="840.5" y="107" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0fv03vt_di" bpmnElement="SequenceFlow_0fv03vt"> - <di:waypoint x="672" y="208" /> - <di:waypoint x="824" y="208" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="598" y="107" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0qd9p4w_di" bpmnElement="Task_1rc2j9"> <dc:Bounds x="572" y="168" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1lxwuh2_di" bpmnElement="EndEvent_1lxwuh2"> - <dc:Bounds x="856" y="84" width="36" height="36" /> + <dc:Bounds x="1129" y="92" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="679" y="50" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0op5irz_di" bpmnElement="SequenceFlow_0op5irz"> - <di:waypoint x="874" y="168" /> - <di:waypoint x="874" y="120" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="739" y="58" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0vzx2yr_di" bpmnElement="SequenceFlow_0vzx2yr"> - <di:waypoint x="424" y="366" /> - <di:waypoint x="424" y="462" /> - <di:waypoint x="572" y="462" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="455" y="436" width="60" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="Gateway_065nxpu_di" bpmnElement="Gateway_065nxpu" isMarkerVisible="true"> + <dc:Bounds x="1122" y="183" width="50" height="50" /> + </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java index fd471e9d73..9521e68e16 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java @@ -26,7 +26,7 @@ import javax.annotation.PostConstruct; import org.junit.Rule; import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType; import org.onap.ccsdk.cds.controllerblueprints.common.api.Status; -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase; +import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; import org.slf4j.Logger; @@ -35,7 +35,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component -public class GrpcNettyServer extends BlueprintProcessingServiceImplBase { +public class GrpcNettyServer extends BluePrintProcessingServiceImplBase { private static final Logger logger = LoggerFactory.getLogger(GrpcNettyServer.class); @@ -55,7 +55,7 @@ public class GrpcNettyServer extends BlueprintProcessingServiceImplBase { @PostConstruct public void start() throws IOException { - final BlueprintProcessingServiceImplBase blueprintPrcessorImpl = new BlueprintProcessingServiceImplBase() { + final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() { @Override public StreamObserver<ExecutionServiceInput> process( StreamObserver<ExecutionServiceOutput> responseObserver) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java index 2d39cc185e..76c67eefc5 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java @@ -21,11 +21,12 @@ */ package org.onap.so.bpmn.infrastructure.flowspecific.tasks; +import static org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.common.SoPropertyConstants.CONTROLLER_STATUS; import java.util.HashMap; import java.util.Optional; -import org.onap.so.logger.LoggingAnchor; import org.camunda.bpm.engine.delegate.BpmnError; import org.onap.appc.client.lcm.model.Action; +import org.onap.logging.filter.base.ErrorCode; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; @@ -33,9 +34,9 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.appc.ApplicationControllerAction; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.db.catalog.beans.ControllerSelectionReference; -import org.onap.logging.filter.base.ErrorCode; +import org.onap.so.db.catalog.client.CatalogDbClient; +import org.onap.so.logger.LoggingAnchor; import org.onap.so.logger.MessageEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -90,13 +91,12 @@ public class GenericVnfHealthCheck { public void callAppcClient(BuildingBlockExecution execution) { logger.trace("Start runAppcCommand "); String appcCode = "1002"; - String appcMessage = ""; + String appcMessage; try { - Action action = null; - action = Action.valueOf(execution.getVariable("action")); + Action action = Action.valueOf(execution.getVariable("action")); String msoRequestId = execution.getVariable("msoRequestId"); String vnfId = execution.getVariable("vnfId"); - Optional<String> payload = null; + Optional<String> payload = Optional.empty(); if (execution.getVariable("payload") != null) { String pay = execution.getVariable("payload"); payload = Optional.of(pay); @@ -108,7 +108,7 @@ public class GenericVnfHealthCheck { payloadInfo.put(OAM_IP_ADDRESS, execution.getVariable(OAM_IP_ADDRESS)); payloadInfo.put(VNF_HOST_IP_ADDRESS, execution.getVariable(VNF_HOST_IP_ADDRESS)); - logger.debug("Running APP-C action: {}", action.toString()); + logger.debug("Running APP-C action: {}", action); logger.debug("VNFID: {}", vnfId); // PayloadInfo contains extra information that adds on to payload before making request to appc appCClient.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo, controllerType); @@ -134,11 +134,14 @@ public class GenericVnfHealthCheck { exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage); } } + logger.error("Error Message: " + appcMessage); logger.error("ERROR CODE: " + appcCode); - logger.trace("End of runAppCommand "); if (appcCode != null && !("0").equals(appcCode)) { exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage); } + + execution.setVariable(CONTROLLER_STATUS, "Success"); + logger.debug("Successfully end of runAppCommand "); } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java index a6e29227a0..a0a47a1d16 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java @@ -31,7 +31,7 @@ import javax.annotation.PostConstruct; import org.junit.Rule; import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType; import org.onap.ccsdk.cds.controllerblueprints.common.api.Status; -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase; +import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; import org.slf4j.Logger; @@ -40,7 +40,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component -public class GrpcNettyServer extends BlueprintProcessingServiceImplBase { +public class GrpcNettyServer extends BluePrintProcessingServiceImplBase { private static final Logger logger = LoggerFactory.getLogger(GrpcNettyServer.class); @@ -60,7 +60,7 @@ public class GrpcNettyServer extends BlueprintProcessingServiceImplBase { @PostConstruct public void start() throws IOException { - final BlueprintProcessingServiceImplBase blueprintPrcessorImpl = new BlueprintProcessingServiceImplBase() { + final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() { @Override public StreamObserver<ExecutionServiceInput> process( StreamObserver<ExecutionServiceOutput> responseObserver) { diff --git a/common/pom.xml b/common/pom.xml index 391c281d40..2822db8202 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -15,7 +15,7 @@ <grpc.version>1.25.0</grpc.version> <protobuf.version>3.10.0</protobuf.version> <grpc.netty.version>4.1.30.Final</grpc.netty.version> - <ccsdk.version>1.1.2</ccsdk.version> + <ccsdk.version>1.1.5</ccsdk.version> </properties> <dependencies> diff --git a/common/src/main/java/org/onap/so/client/cds/CDSProcessingHandler.java b/common/src/main/java/org/onap/so/client/cds/CDSProcessingHandler.java index a0a5577402..6097f7e3fd 100644 --- a/common/src/main/java/org/onap/so/client/cds/CDSProcessingHandler.java +++ b/common/src/main/java/org/onap/so/client/cds/CDSProcessingHandler.java @@ -24,8 +24,8 @@ import io.grpc.ManagedChannel; import io.grpc.stub.StreamObserver; import java.util.concurrent.CountDownLatch; import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers; -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc; -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceStub; +import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc; +import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceStub; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; import org.slf4j.Logger; @@ -50,7 +50,7 @@ class CDSProcessingHandler { final CountDownLatch finishLatch = new CountDownLatch(1); - final BlueprintProcessingServiceStub asyncStub = BlueprintProcessingServiceGrpc.newStub(channel); + final BluePrintProcessingServiceStub asyncStub = BluePrintProcessingServiceGrpc.newStub(channel); final StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<ExecutionServiceOutput>() { @Override diff --git a/common/src/test/java/org/onap/so/client/cds/CDSProcessingClientTest.java b/common/src/test/java/org/onap/so/client/cds/CDSProcessingClientTest.java index b92326cc89..5792c28f5f 100644 --- a/common/src/test/java/org/onap/so/client/cds/CDSProcessingClientTest.java +++ b/common/src/test/java/org/onap/so/client/cds/CDSProcessingClientTest.java @@ -41,7 +41,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.mockito.Mock; import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers; -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase; +import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; @@ -72,7 +72,7 @@ public class CDSProcessingClientTest { client = new CDSProcessingClient(InProcessChannelBuilder.forName(serverName).directExecutor().build(), handler); - final BlueprintProcessingServiceImplBase routeChatImpl = new BlueprintProcessingServiceImplBase() { + final BluePrintProcessingServiceImplBase routeChatImpl = new BluePrintProcessingServiceImplBase() { @Override public StreamObserver<ExecutionServiceInput> process( StreamObserver<ExecutionServiceOutput> responseObserver) { |