use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class ActivityDataIOEditorWidget method addAssignment.
private void addAssignment() {
List<AssignmentRow> as = view.getAssignmentRows();
if (as.isEmpty()) {
view.setTableDisplayStyle();
}
AssignmentRow newAssignment = new AssignmentRow();
newAssignment.setVariableType(variableType);
as.add(newAssignment);
AssignmentListItemWidgetView widget = view.getAssignmentWidget(view.getAssignmentsCount() - 1);
widget.setDataTypes(dataTypeListBoxValues);
widget.setProcessVariables(processVarListBoxValues);
widget.setShowConstants(getShowConstants());
widget.setDisallowedNames(disallowedNames, disallowedNameErrorMessage);
widget.setAllowDuplicateNames(allowDuplicateNames, duplicateNameErrorMessage);
widget.setParentWidget(this);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class ActivityDataIOEditorWidgetViewImplTest method setUp.
@Before
public void setUp() {
GwtMockito.initMocks(this);
view = GWT.create(ActivityDataIOEditorWidgetViewImpl.class);
view.assignments = assignments;
view.addVarButton = button;
view.nameth = nameth;
view.datatypeth = datatypeth;
view.notification = notification;
doCallRealMethod().when(view).setAssignmentRows(any(List.class));
doCallRealMethod().when(view).init(any(ActivityDataIOEditorWidgetView.Presenter.class));
doCallRealMethod().when(view).handleAddVarButton(any(ClickEvent.class));
doCallRealMethod().when(view).showOnlySingleEntryAllowed();
doCallRealMethod().when(view).getAssignmentRows();
doCallRealMethod().when(view).getAssignmentWidget(anyInt());
doCallRealMethod().when(view).getAssignmentsCount();
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 AssignmentListItemWidgetViewImplTest method testSetModelOutputNormalConstant.
@Test
public void testSetModelOutputNormalConstant() {
AssignmentRow row = new AssignmentRow();
row.setProcessVar(null);
row.setConstant(CONSTANT_NAME);
row.setName(VARIABLE_NAME);
row.setCustomDataType(null);
row.setDataType(DATA_TYPE_NAME);
row.setVariableType(Variable.VariableType.OUTPUT);
doReturn(row).when(assignment).getModel();
view.setModel(row);
verify(assignment, times(1)).setModel(row);
verify(deleteButton, times(1)).setIcon(IconType.TRASH);
verify(constant, times(1)).setVisible(false);
verify(customDataType, never()).setValue(DATA_TYPE_NAME);
verify(dataType, times(1)).setValue(DATA_TYPE_NAME);
verify(constant, times(1)).setValue(CONSTANT_NAME);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class AssignmentListItemWidgetViewImplTest method testHandleDeleteButton.
@Test
public void testHandleDeleteButton() {
ActivityDataIOEditorWidget widget = mock(ActivityDataIOEditorWidget.class);
AssignmentRow model = mock(AssignmentRow.class);
when(view.getModel()).thenReturn(model);
view.setParentWidget(widget);
view.handleDeleteButton(null);
verify(widget).removeAssignment(model);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class AssignmentListItemWidgetViewImplTest method testSetModelInputCustomProcessVar.
@Test
public void testSetModelInputCustomProcessVar() {
AssignmentRow row = new AssignmentRow();
row.setProcessVar(VARIABLE_NAME);
row.setConstant(null);
row.setName(VARIABLE_NAME);
row.setCustomDataType(CUST_DATA_TYPE_NAME);
row.setDataType(null);
row.setVariableType(Variable.VariableType.INPUT);
doReturn(row).when(assignment).getModel();
view.setModel(row);
verify(assignment, times(1)).setModel(row);
verify(deleteButton, times(1)).setIcon(IconType.TRASH);
verify(constant, never()).setVisible(false);
verify(customDataType, times(1)).setValue(CUST_DATA_TYPE_NAME);
verify(dataType, times(1)).setValue(CUST_DATA_TYPE_NAME);
verify(processVar, times(1)).setValue(VARIABLE_NAME);
verify(constant, never()).setValue(anyString());
}
Aggregations