From 7c7a2e4b304e2ac8bb8e4505b47a797ca4f08c29 Mon Sep 17 00:00:00 2001 From: GihanAyesh Date: Thu, 14 Dec 2023 13:37:11 +0530 Subject: [PATCH] minor fix --- .../workflow/TenantWorkflowConfigHolder.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/workflow/TenantWorkflowConfigHolder.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/workflow/TenantWorkflowConfigHolder.java index 5020ffdfc160..c3db4cf8ff59 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/workflow/TenantWorkflowConfigHolder.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/workflow/TenantWorkflowConfigHolder.java @@ -137,17 +137,22 @@ public void load() throws WorkflowException, RegistryException { workflowElem = workflowExtensionsElem.getFirstChildWithName( new QName(WorkflowConstants.API_REVISION_DEPLOYMENT)); - executorClass = workflowElem.getAttributeValue(new QName(WorkflowConstants.EXECUTOR)); - try { - clazz = TenantWorkflowConfigHolder.class.getClassLoader().loadClass(executorClass); - workFlowExecutor = (WorkflowExecutor) clazz.newInstance(); - loadProperties(workflowElem, workFlowExecutor); - } catch (ClassNotFoundException e1) { + if (workflowElem != null) { + executorClass = workflowElem.getAttributeValue(new QName(WorkflowConstants.EXECUTOR)); + try { + clazz = TenantWorkflowConfigHolder.class.getClassLoader().loadClass(executorClass); + workFlowExecutor = (WorkflowExecutor) clazz.newInstance(); + loadProperties(workflowElem, workFlowExecutor); + } catch (ClassNotFoundException e) { + workFlowExecutor = new APIRevisionDeploymentSimpleWorkflowExecutor(); + } + + workflowExecutorMap.put(WorkflowConstants.WF_TYPE_AM_REVISION_DEPLOYMENT, workFlowExecutor); + } else { workFlowExecutor = new APIRevisionDeploymentSimpleWorkflowExecutor(); + workflowExecutorMap.put(WorkflowConstants.WF_TYPE_AM_REVISION_DEPLOYMENT, workFlowExecutor); } - workflowExecutorMap.put(WorkflowConstants.WF_TYPE_AM_REVISION_DEPLOYMENT, workFlowExecutor); - workflowElem = workflowExtensionsElem.getFirstChildWithName( new QName(WorkflowConstants.USER_SIGN_UP)); executorClass = workflowElem.getAttributeValue(new QName(WorkflowConstants.EXECUTOR));