From 09a3de8a57b883eb7af65dbbff47e725cc5ca270 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steven" Date: Wed, 23 Oct 2019 12:06:26 -0400 Subject: Adjust listener to actually execute on process end Adjust listener to actually execute on process end Issue-ID: SO-2481 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I97b284ac2ac14e2052fa845427494406e0274d36 --- .../so/bpmn/core/plugins/AsyncTaskExecutor.java | 21 -- .../core/plugins/BPMNProcessCompletePlugin.java | 51 ---- .../subprocess/BuildingBlock/WorkflowActionBB.bpmn | 331 +++++++++++---------- 3 files changed, 167 insertions(+), 236 deletions(-) delete mode 100644 bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/AsyncTaskExecutor.java delete mode 100644 bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/BPMNProcessCompletePlugin.java diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/AsyncTaskExecutor.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/AsyncTaskExecutor.java deleted file mode 100644 index 56526c7f89..0000000000 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/AsyncTaskExecutor.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.onap.so.bpmn.core.plugins; - -import org.camunda.bpm.engine.delegate.ExecutionListener; -import org.camunda.bpm.engine.impl.bpmn.parser.AbstractBpmnParseListener; -import org.camunda.bpm.engine.impl.pvm.process.ActivityImpl; -import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl; -import org.camunda.bpm.engine.impl.util.xml.Element; -import org.springframework.stereotype.Component; - -@Component -public class AsyncTaskExecutor extends AbstractBpmnParseListener { - - private void injectTaskExecutorExecutionListener(ActivityImpl activity) { - activity.addListener(ExecutionListener.EVENTNAME_END, new AsyncTaskExecutorListener()); - } - - @Override - public void parseEndEvent(Element endEventElement, ScopeImpl scope, ActivityImpl activity) { - injectTaskExecutorExecutionListener(activity); - } -} diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/BPMNProcessCompletePlugin.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/BPMNProcessCompletePlugin.java deleted file mode 100644 index 96c6af42ed..0000000000 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/BPMNProcessCompletePlugin.java +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * 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========================================================= - */ - -package org.onap.so.bpmn.core.plugins; - -import java.util.ArrayList; -import java.util.List; -import org.camunda.bpm.engine.impl.bpmn.parser.BpmnParseListener; -import org.camunda.bpm.engine.impl.cfg.AbstractProcessEnginePlugin; -import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - - - -@Component -public class BPMNProcessCompletePlugin extends AbstractProcessEnginePlugin { - - @Autowired - private AsyncTaskExecutor asyncTaskExecutor; - - @Override - public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) { - List preParseListeners = processEngineConfiguration.getCustomPreBPMNParseListeners(); - if (preParseListeners == null) { - preParseListeners = new ArrayList<>(); - processEngineConfiguration.setCustomPreBPMNParseListeners(preParseListeners); - } - preParseListeners.add(asyncTaskExecutor); - } - -} diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn index bb900420e3..e112fdc161 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn @@ -1,6 +1,9 @@ - + + + + SequenceFlow_15s0okp @@ -46,7 +49,7 @@ SequenceFlow_0l7kaba - + ${execution.getVariable("completed")==true&&execution.getVariable("isRollback")==false&&execution.getVariable("handlingCode")=="Success"} SequenceFlow_15s0okp @@ -83,7 +86,7 @@ - + ${execution.getVariable("isTopLevelFlow")==true&&execution.getVariable("sentSyncResponse")==false} @@ -92,10 +95,10 @@ - + ${execution.getVariable("handlingCode")=="Rollback"||execution.getVariable("handlingCode")=="RollbackToAssigned"||execution.getVariable("handlingCode")=="RollbackToCreated"} - + ${execution.getVariable("isRollbackNeeded")==true} SequenceFlow_0v588sm @@ -104,7 +107,7 @@ - + ${execution.getVariable("handlingCode")=="Abort"} SequenceFlow_02ksbt0 @@ -127,7 +130,7 @@ - + ${execution.getVariable("isTopLevelFlow")==false} SequenceFlow_11530ei @@ -136,7 +139,7 @@ - + ${execution.getVariable("isTopLevelFlow")==false} SequenceFlow_1m2eezj @@ -144,13 +147,13 @@ SequenceFlow_0kf5sen - + ${execution.getVariable("isTopLevelFlow")==false} SequenceFlow_1ui67mc - + ${execution.getVariable("isRollbackNeeded")==false} SequenceFlow_11dlyzt @@ -158,7 +161,7 @@ SequenceFlow_1ui67mc - + ${execution.getVariable("completed")==true&&execution.getVariable("isRollback")==true&&execution.getVariable("handlingCode")=="Success"} @@ -202,7 +205,7 @@ - + ${execution.getVariable("generateIdsOnly") == null || execution.getVariable("generateIdsOnly")==false} SequenceFlow_0ilo6lo @@ -213,406 +216,406 @@ - + - + - + - + - - + + - + - - + + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - + - - - + + + - + - - + + - + - - + + - - - + + + - + - + - + - + - - - - + + + + - - - - + + + + - + - + - + - - - + + + - + - - + + - + - + - + - - - + + + - + - - + + - + - + - + - - - - + + + + - + - + - + - - - + + + - + - + - + - - - - + + + + - + - - + + - - + + - - - - + + + + - + - + - - - - + + + + - + - - - + + + - + - - + + - + - + - + - + - + - + - - + + - - + + - + - - + + - - - + + + - + - - - - + + + + - + - + - - + + - - + + - - - + + + - + - + - - + + - - + + - + - + - + - - + + - + -- cgit 1.2.3-korg