use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class MappingEditor method getProcessVariables.
public Map<Integer, VariableVO> getProcessVariables() {
Map<Integer, VariableVO> processVariables = new TreeMap<Integer, VariableVO>();
List<VariableVO> processVariableVOs = getOwningProcess().getVariables();
for (int i = 0; i < processVariableVOs.size(); i++) {
VariableVO processVariableVO = (VariableVO) processVariableVOs.get(i);
processVariables.put(new Integer(i), processVariableVO);
}
return processVariables;
}
use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class OsgiAdapterDesignSection method getResultVariableOptions.
private List<String> getResultVariableOptions() {
List<String> options = activity.getProcess().getDocRefVariableNames();
// add string variables
for (VariableVO var : activity.getProcess().getVariables()) {
if (String.class.getName().equals(var.getVariableType()))
options.add(var.getName());
}
Collections.sort(options);
return options;
}
use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class TaskTemplateEditor method addPage.
private void addPage(String section) {
ScrolledComposite scrolledComposite = new ScrolledComposite(getContainer(), SWT.V_SCROLL);
scrolledComposite.setLayout(new GridLayout());
scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
scrolledComposite.setAlwaysShowScrollBars(true);
Composite composite = new Composite(scrolledComposite, SWT.NONE);
composite.setLayout(new FillLayout());
// create the grid layout
GridLayout gl = new GridLayout();
gl.numColumns = PropertyEditor.COLUMNS;
gl.marginTop = 6;
gl.marginLeft = 3;
composite.setLayout(gl);
for (PropertyEditor propertyEditor : propertyEditors) {
boolean belongs;
if (section == null)
belongs = propertyEditor.getSection() == null;
else
belongs = section.equals(propertyEditor.getSection());
if (belongs) {
if ("Notices".equals(propertyEditor.getName())) {
// special handling for notices
String attrVal = taskTemplate.getAttribute(TaskAttributeConstant.NOTICES);
if (StringHelper.isEmpty(attrVal) || attrVal.equals("$DefaultNotices"))
taskTemplate.setAttribute(TaskAttributeConstant.NOTICES, TaskVO.getDefaultNotices());
if (noticesValueChangeListener != null)
taskTemplate.removeAttributeValueChangeListener(noticesValueChangeListener);
noticesValueChangeListener = new NoticesValueChangeListener(propertyEditor);
taskTemplate.addAttributeValueChangeListener(noticesValueChangeListener);
propertyEditor.render(composite);
} else if ("Variables".equals(propertyEditor.getName())) {
// special handling for variables
TableEditor tableEditor = (TableEditor) propertyEditor;
// support for value expressions
tableEditor.setCellModifier(tableEditor.new DefaultCellModifier() {
@Override
public boolean canModify(Object element, String property) {
boolean editable = super.canModify(element, property);
if (editable && getColumnIndex(property) == 1) {
for (VariableVO var : getProcessVariables()) {
if (var.getName().equals(getValue(element, property)))
// can't edit process var rows
return false;
}
}
return editable;
}
});
tableEditor.setHorizontalSpan(4);
propertyEditor.render(composite);
tableEditor.getAddButton().setText("Expression");
GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
gridData.widthHint = 80;
tableEditor.getAddButton().setLayoutData(gridData);
final Button deleteBtn = tableEditor.getDeleteButton();
tableEditor.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel = (IStructuredSelection) event.getSelection();
if (sel.getFirstElement() instanceof DefaultRowImpl) {
DefaultRowImpl row = (DefaultRowImpl) sel.getFirstElement();
for (VariableVO var : getProcessVariables()) {
if (var.getName().equals(row.getColumnValue(1))) {
deleteBtn.setEnabled(false);
return;
}
}
deleteBtn.setEnabled(true);
} else {
deleteBtn.setEnabled(false);
}
}
});
} else {
propertyEditor.render(composite);
}
propertyEditor.setValue(taskTemplate);
if (!propertyEditor.getType().equals(PropertyEditor.TYPE_LINK)) {
propertyEditor.setEditable(!(propertyEditor.isReadOnly() || taskTemplate.isReadOnly()));
}
}
}
scrolledComposite.setContent(composite);
scrolledComposite.setExpandVertical(true);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
String pageName = section == null ? "General" : section;
setPageText(addPage(scrolledComposite), pageName);
pages.put(pageName, scrolledComposite);
}
use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class WorkflowProcess method getVariableNames.
public List<String> getVariableNames() {
List<String> variableNames = new ArrayList<>();
List<VariableVO> variableVOs = getVariables();
for (VariableVO variableVO : variableVOs) {
variableNames.add(variableVO.getVariableName());
}
Collections.sort(variableNames, new Comparator<String>() {
public int compare(String n1, String n2) {
return n1.compareToIgnoreCase(n2);
}
});
return variableNames;
}
use of com.centurylink.mdw.model.value.variable.VariableVO in project mdw-designer by CenturyLinkCloud.
the class WorkflowProcess method getNonDocRefVariableNames.
public List<String> getNonDocRefVariableNames() {
List<String> nonDocRefVariableNames = new ArrayList<>();
List<VariableVO> variableVOs = getVariables();
for (VariableVO variableVO : variableVOs) {
String varType = variableVO.getVariableType();
if (!VariableTranslator.isDocumentReferenceVariable(null, varType))
nonDocRefVariableNames.add(variableVO.getVariableName());
}
Collections.sort(nonDocRefVariableNames);
return nonDocRefVariableNames;
}
Aggregations