use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class ActivityDataIOEditorWidget method setData.
public void setData(final List<AssignmentRow> assignmentRows) {
// Hide the properties which shouldn't be shown
hiddenPropertyRows.clear();
if (disallowedNames != null && !disallowedNames.isEmpty()) {
for (int i = assignmentRows.size() - 1; i >= 0; i--) {
AssignmentRow row = assignmentRows.get(i);
if (row.getName() != null && !row.getName().isEmpty()) {
if (disallowedNames.contains(row.getName().toLowerCase())) {
assignmentRows.remove(i);
hiddenPropertyRows.add(0, row);
}
}
}
}
if (assignmentRows.isEmpty()) {
view.setNoneDisplayStyle();
} else {
view.setTableDisplayStyle();
}
view.setAssignmentRows(assignmentRows);
for (int i = 0; i < assignmentRows.size(); i++) {
view.getAssignmentWidget(i).setParentWidget(this);
view.getAssignmentWidget(i).setDisallowedNames(disallowedNames, disallowedNameErrorMessage);
view.getAssignmentWidget(i).setAllowDuplicateNames(allowDuplicateNames, duplicateNameErrorMessage);
}
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class ActivityDataIOEditorTest method getAssignmentsWithSameNames.
private List<AssignmentRow> getAssignmentsWithSameNames() {
List<AssignmentRow> rows = new ArrayList<AssignmentRow>();
rows.add(new AssignmentRow("varName", null, null, null, "varName", null));
rows.add(new AssignmentRow("varName2", null, null, null, "varName2", null));
return rows;
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class ActivityDataIOEditorTest method testSaveClickCallback.
@Test
public void testSaveClickCallback() {
AssignmentRow row = new AssignmentRow("name", Variable.VariableType.INPUT, "String", "Object", "var", null);
List<AssignmentRow> input = new ArrayList<AssignmentRow>();
input.add(row);
List<AssignmentRow> output = new ArrayList<AssignmentRow>();
output.add(row);
when(ioEditorView.getInputAssignmentData()).thenReturn(input);
when(ioEditorView.getOutputAssignmentData()).thenReturn(output);
List<String> dataTypes = new ArrayList<String>();
List<String> dataTypesDisplayNames = new ArrayList<String>();
dataTypes.add("a.b.c.Name");
dataTypesDisplayNames.add("Name");
ActivityDataIOEditor.GetDataCallback mockCallback = mock(ActivityDataIOEditor.GetDataCallback.class);
ioEditor.setCallback(mockCallback);
ioEditor.handleSaveClick();
verify(ioEditorView).getInputAssignmentData();
verify(ioEditorView).getOutputAssignmentData();
verify(ioEditorView).hideView();
verify((ioEditor.callback)).getData(anyString());
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class ActivityDataIOEditorViewImplTest method setUp.
@Before
public void setUp() {
GwtMockito.initMocks(this);
view.inputAssignmentsWidget = inputAssignmentsWidget;
view.outputAssignmentsWidget = outputAssignmentsWidget;
view.presenter = presenter;
doCallRealMethod().when(view).setInputAssignmentRows(any(List.class));
doCallRealMethod().when(view).setOutputAssignmentRows(any(List.class));
doCallRealMethod().when(view).setPossibleInputAssignmentsDataTypes(anyList());
doCallRealMethod().when(view).setPossibleOutputAssignmentsDataTypes(anyList());
doCallRealMethod().when(view).setInputAssignmentsProcessVariables(anyList());
doCallRealMethod().when(view).setOutputAssignmentsProcessVariables(anyList());
doCallRealMethod().when(view).setInputAssignmentsDisallowedNames(anySet());
doCallRealMethod().when(view).setIsInputAssignmentSingleVar(anyBoolean());
doCallRealMethod().when(view).setIsOutputAssignmentSingleVar(anyBoolean());
doCallRealMethod().when(view).setInputAssignmentsVisibility(anyBoolean());
doCallRealMethod().when(view).setOutputAssignmentsVisibility(anyBoolean());
doCallRealMethod().when(view).getInputAssignmentData();
doCallRealMethod().when(view).getOutputAssignmentData();
rows = new ArrayList<AssignmentRow>();
rows.add(new AssignmentRow("varName", null, null, null, "varName", null));
rows.add(new AssignmentRow("varName2", null, null, null, "varName2", null));
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class AssignmentListItemWidgetTest method testSetModelInput.
@Test
public void testSetModelInput() {
when(widget.getVariableType()).thenReturn(Variable.VariableType.INPUT);
widget.setModel(new AssignmentRow());
verify(deleteButton).setIcon(IconType.TRASH);
verify(constant, never()).setVisible(anyBoolean());
verify(widget).getCustomDataType();
verify(widget).getDataType();
verify(widget).getConstant();
verify(widget).getProcessVar();
}
Aggregations