Search in sources :

Example 1 with WorkflowConfigProperties

use of org.wso2.carbon.apimgt.core.models.WorkflowConfigProperties in project carbon-apimgt by wso2.

the class WorkflowConfigHolder method loadProperties.

private void loadProperties(List<WorkflowConfigProperties> properties, WorkflowExecutor workFlowExecutor) throws WorkflowException {
    for (Iterator iterator = properties.iterator(); iterator.hasNext(); ) {
        WorkflowConfigProperties workflowConfigProperties = (WorkflowConfigProperties) iterator.next();
        String propertyName = workflowConfigProperties.getName();
        String propertyValue = workflowConfigProperties.getValue();
        if (propertyName == null) {
            handleException("An Executor class property must specify the name attribute");
        } else {
            setInstanceProperty(propertyName, propertyValue, workFlowExecutor);
        }
    }
}
Also used : Iterator(java.util.Iterator) WorkflowConfigProperties(org.wso2.carbon.apimgt.core.models.WorkflowConfigProperties)

Example 2 with WorkflowConfigProperties

use of org.wso2.carbon.apimgt.core.models.WorkflowConfigProperties in project carbon-apimgt by wso2.

the class WorkflowConfigHolder method loadWorkflowConfigurations.

private void loadWorkflowConfigurations(WorkflowExecutorInfo workflowConfig, String workflowExecutorType) throws ClassNotFoundException, IllegalAccessException, InstantiationException, WorkflowException {
    String executorClass = workflowConfig.getExecutor();
    Class clazz = WorkflowConfigHolder.class.getClassLoader().loadClass(executorClass);
    WorkflowExecutor workFlowExecutor = (WorkflowExecutor) clazz.newInstance();
    List<WorkflowConfigProperties> properties = workflowConfig.getProperty();
    if (properties != null) {
        loadProperties(properties, workFlowExecutor);
    }
    workflowExecutorMap.put(workflowExecutorType, workFlowExecutor);
}
Also used : WorkflowExecutor(org.wso2.carbon.apimgt.core.api.WorkflowExecutor) WorkflowConfigProperties(org.wso2.carbon.apimgt.core.models.WorkflowConfigProperties)

Aggregations

WorkflowConfigProperties (org.wso2.carbon.apimgt.core.models.WorkflowConfigProperties)2 Iterator (java.util.Iterator)1 WorkflowExecutor (org.wso2.carbon.apimgt.core.api.WorkflowExecutor)1