Package org.jbpm.ui.custom

Source Code of org.jbpm.ui.custom.SQLHandlerCellEditorProvider

package org.jbpm.ui.custom;

import org.eclipse.jface.dialogs.Dialog;
import org.jbpm.ui.DesignerLogger;
import org.jbpm.ui.common.model.Delegable;
import org.jbpm.ui.common.model.GraphElement;
import org.jbpm.ui.common.model.ProcessDefinition;
import org.jbpm.ui.dialog.SQLActionHandlerConfigDialog;
import org.jbpm.ui.dialog.SQLActionHandlerConfigDialog.SQLTasksModel;

public class SQLHandlerCellEditorProvider extends DelegableProvider {

    @Override
    public String showConfigurationDialog(Delegable delegable) {
        ProcessDefinition definition = ((GraphElement) delegable).getProcessDefinition();
        SQLActionHandlerConfigDialog dialog = new SQLActionHandlerConfigDialog(
                definition, delegable.getDelegationConfiguration());
        if (dialog.open() == Dialog.OK) {
            return dialog.getResult();
        }
        return null;
    }

    @Override
    public boolean validateValue(Delegable delegable) {
        try {
            SQLTasksModel.fromXml(delegable.getDelegationConfiguration());
            return true;
        } catch (Exception e) {
            DesignerLogger.logErrorWithoutDialog("SQLActionHandler: invalid configuration", e);
            return false;
        }
    }
}
TOP

Related Classes of org.jbpm.ui.custom.SQLHandlerCellEditorProvider

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.