From b328b37f8e6b27cc4eed183bb0096d6603517e20 Mon Sep 17 00:00:00 2001 From: sebdet Date: Wed, 8 May 2019 15:36:55 +0200 Subject: [PATCH 1/1] Fix flows and error catching Fix flows, remove getLoop at the end and add better error catching in camel flows Issue-ID: CLAMP-369 Change-Id: I473d63d9189daf69e1e4e6d025f06ac586a9f2ab Signed-off-by: sebdet --- .../resources/clds/camel/rest/clamp-api-v2.xml | 57 +++++++++++----------- .../resources/clds/camel/routes/flexible-flow.xml | 5 -- 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml index 4d3c6b38..1883145d 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -202,25 +202,21 @@ excludePattern="loopName" /> + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DEPLOY the closed loop')" /> - - - + + + + message="Policy deployment status: ${exchangeProperty[policyStatus]}"> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED' - + + + @@ -241,9 +242,9 @@ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="DEPLOY request failed for loop: ${header.loopName}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> @@ -261,16 +262,13 @@ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Undeploy the closed loop')" /> - - + + ${exchangeProperty[dcaeStatus]} == 'DEPLOYED' - + + + @@ -291,9 +294,9 @@ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + message="UNDEPLOY request failed for loop: ${header.loopName}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> @@ -318,11 +321,9 @@ + message="STOP request successfully executed for loop: ${header.loopName}" /> - @@ -366,8 +367,6 @@ message="START request successfully executed for loop: ${header.loopName}" /> - @@ -474,8 +473,6 @@ message="SUBMIT request successfully executed for loop: ${header.loopName}" /> - @@ -581,7 +578,9 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> - + + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index 5f857772..43b231e4 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -497,11 +497,6 @@ message="Deploy the closed loop: ${exchangeProperty[loopObject].getName()}" /> - ${exchangeProperty[loopObject].getOperationalPolicies()} - - - ${body} - -- 2.16.6