1 /* Copyright (c) 2019 AT&T Intellectual Property. #
\r
3 # Licensed under the Apache License, Version 2.0 (the "License"); #
\r
4 # you may not use this file except in compliance with the License. #
\r
5 # You may obtain a copy of the License at #
\r
7 # http://www.apache.org/licenses/LICENSE-2.0 #
\r
9 # Unless required by applicable law or agreed to in writing, software #
\r
10 # distributed under the License is distributed on an "AS IS" BASIS, #
\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
\r
12 # See the License for the specific language governing permissions and #
\r
13 # limitations under the License. #
\r
14 ##############################################################################*/
\r
17 package org.oran.otf.camunda.plugin;
\r
19 import org.oran.otf.camunda.workflow.handler.ExternalTaskIncidentHandler;
\r
20 import org.oran.otf.camunda.workflow.handler.FailedJobIncidentHandler;
\r
21 import java.util.Arrays;
\r
22 import org.camunda.bpm.engine.ProcessEngine;
\r
23 import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
\r
24 import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin;
\r
25 import org.slf4j.Logger;
\r
26 import org.slf4j.LoggerFactory;
\r
27 import org.springframework.beans.factory.annotation.Autowired;
\r
28 import org.springframework.stereotype.Component;
\r
31 public class OtfIncidentHandlerPlugin implements ProcessEnginePlugin {
\r
33 private static final Logger logger = LoggerFactory.getLogger(OtfIncidentHandlerPlugin.class);
\r
36 private FailedJobIncidentHandler failedJobIncidentHandler;
\r
38 private ExternalTaskIncidentHandler externalTaskIncidentHandler;
\r
41 public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
\r
42 logger.info("Adding Open Test Framework custom incident handlers.");
\r
43 processEngineConfiguration.setCustomIncidentHandlers(
\r
44 Arrays.asList(failedJobIncidentHandler, externalTaskIncidentHandler));
\r
48 public void postInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
\r
52 public void postProcessEngineBuild(ProcessEngine processEngine) {
\r