Search in sources :

Example 1 with PluginDataAccess

use of com.centurylink.mdw.plugin.designer.PluginDataAccess in project mdw-designer by CenturyLinkCloud.

the class MdwWorkbenchWindowAdvisor method getProcessInstance.

private WorkflowProcess getProcessInstance(Long processInstanceId) {
    PluginDataAccess dataAccess = projectToImport.getDataAccess();
    ProcessInstanceVO processInstanceInfo = dataAccess.getProcessInstance(processInstanceId);
    ProcessVO processVO = new ProcessVO();
    processVO.setProcessId(processInstanceInfo.getProcessId());
    processVO.setProcessName(processInstanceInfo.getProcessName());
    WorkflowProcess instanceVersion = new WorkflowProcess(projectToImport, processVO);
    instanceVersion.setProcessInstance(processInstanceInfo);
    return instanceVersion;
}
Also used : ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO) PluginDataAccess(com.centurylink.mdw.plugin.designer.PluginDataAccess)

Example 2 with PluginDataAccess

use of com.centurylink.mdw.plugin.designer.PluginDataAccess in project mdw-designer by CenturyLinkCloud.

the class WorkflowAssetCustomSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    workflowAsset = (WorkflowAsset) selection;
    // attr definition text area
    customAttrsPropEditor = new PropertyEditor(workflowAsset, PropertyEditor.TYPE_TEXT);
    customAttrsPropEditor.setLabel("Custom Attr Definition\n(Pagelet Syntax)");
    customAttrsPropEditor.setMultiLine(true);
    customAttrsPropEditor.setWidth(475);
    customAttrsPropEditor.setHeight(80);
    customAttrsPropEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            String def = newValue == null || ((String) newValue).length() == 0 ? null : (String) newValue;
            if (customAttribute == null)
                customAttribute = new CustomAttributeVO("RULE_SET", workflowAsset.getLanguage());
            customAttribute.setDefinition(def);
        }
    });
    customAttrsPropEditor.render(composite);
    // roles picklist
    rolesPropertyEditor = new PropertyEditor(workflowAsset, PropertyEditor.TYPE_PICKLIST);
    rolesPropertyEditor.setValueConverter(new ListConverter());
    rolesPropertyEditor.setLabel("Custom Attr Edit Roles:Unselected~Permitted");
    PluginDataAccess dataAccess = workflowAsset.getProject().getDataAccess();
    rolesPropertyEditor.setValueOptions(dataAccess.getRoleNames(false));
    rolesPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        @SuppressWarnings("unchecked")
        public void propertyValueChanged(Object newValue) {
            if (customAttribute == null)
                customAttribute = new CustomAttributeVO("RULE_SET", workflowAsset.getLanguage());
            if (newValue == null)
                customAttribute.setRoles(null);
            else
                customAttribute.setRoles((List<String>) newValue);
        }
    });
    rolesPropertyEditor.render(composite);
    rolesPropertyEditor.setValue("");
    // save button
    savePropertyEditor = new PropertyEditor(workflowAsset, PropertyEditor.TYPE_BUTTON);
    savePropertyEditor.setLabel("Save");
    savePropertyEditor.setComment("Save Custom Attrs:");
    savePropertyEditor.setWidth(65);
    savePropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            saveCustomAttribute();
        }
    });
    savePropertyEditor.render(composite);
    // help link
    helpLinkPropertyEditor = new PropertyEditor(workflowAsset, PropertyEditor.TYPE_LINK);
    helpLinkPropertyEditor.setLabel("Custom Attributes Help");
    helpLinkPropertyEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) CustomAttributeVO(com.centurylink.mdw.model.value.attribute.CustomAttributeVO) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor) ListConverter(com.centurylink.mdw.plugin.designer.properties.convert.ListConverter) PluginDataAccess(com.centurylink.mdw.plugin.designer.PluginDataAccess)

Example 3 with PluginDataAccess

use of com.centurylink.mdw.plugin.designer.PluginDataAccess in project mdw-designer by CenturyLinkCloud.

the class CopyDialog method nameAlreadyExists.

private boolean nameAlreadyExists(String name) {
    WorkflowProject workflowProject = workflowElement.getProject();
    PluginDataAccess dataAccess = workflowProject.getDataAccess();
    if (workflowElement instanceof WorkflowProcess)
        return dataAccess.processNameExists(targetPackage.getPackageVO(), name);
    else if (workflowElement instanceof ExternalEvent)
        return workflowProject.externalEventNameExists(name);
    else if (workflowElement instanceof WorkflowAsset)
        return targetPackage == null ? workflowProject.workflowAssetNameExists(name) : targetPackage.workflowAssetNameExists(name);
    else
        return false;
}
Also used : WorkflowAsset(com.centurylink.mdw.plugin.designer.model.WorkflowAsset) ExternalEvent(com.centurylink.mdw.plugin.designer.model.ExternalEvent) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) PluginDataAccess(com.centurylink.mdw.plugin.designer.PluginDataAccess)

Example 4 with PluginDataAccess

use of com.centurylink.mdw.plugin.designer.PluginDataAccess in project mdw-designer by CenturyLinkCloud.

the class ProcessSaveAsDialog method nameAlreadyExists.

private boolean nameAlreadyExists(String name) {
    WorkflowProject workflowProject = process.getProject();
    PluginDataAccess dataAccess = workflowProject.getDataAccess();
    if (process instanceof WorkflowProcess)
        return dataAccess.processNameExists(newPackage.getPackageVO(), name);
    else
        return false;
}
Also used : WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) PluginDataAccess(com.centurylink.mdw.plugin.designer.PluginDataAccess)

Example 5 with PluginDataAccess

use of com.centurylink.mdw.plugin.designer.PluginDataAccess in project mdw-designer by CenturyLinkCloud.

the class WorkflowAssetCustomSection method setSelection.

public void setSelection(WorkflowElement selection) {
    workflowAsset = (WorkflowAsset) selection;
    customAttrsPropEditor.setElement(workflowAsset);
    rolesPropertyEditor.setElement(workflowAsset);
    savePropertyEditor.setElement(workflowAsset);
    PluginDataAccess dataAccess = workflowAsset.getProject().getDataAccess();
    customAttribute = dataAccess.getAssetCustomAttribute(workflowAsset.getLanguage());
    if (customAttribute != null) {
        customAttrsPropEditor.setValue(customAttribute.getDefinition());
        rolesPropertyEditor.setValue(customAttribute.getRoles());
    }
    helpLinkPropertyEditor.setElement(workflowAsset);
    helpLinkPropertyEditor.setValue("/MDWHub/doc/customAttributes.html");
}
Also used : PluginDataAccess(com.centurylink.mdw.plugin.designer.PluginDataAccess)

Aggregations

PluginDataAccess (com.centurylink.mdw.plugin.designer.PluginDataAccess)5 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)3 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)2 CustomAttributeVO (com.centurylink.mdw.model.value.attribute.CustomAttributeVO)1 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)1 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)1 ExternalEvent (com.centurylink.mdw.plugin.designer.model.ExternalEvent)1 WorkflowAsset (com.centurylink.mdw.plugin.designer.model.WorkflowAsset)1 ListConverter (com.centurylink.mdw.plugin.designer.properties.convert.ListConverter)1 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)1 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)1