use of org.kie.workbench.common.forms.data.modeller.model.DataObjectFormModel in project kie-wb-common by kiegroup.
the class NestedFormsBPMNVFSFormDefinitionGeneratorServiceTest method findVFSForms.
private List<FormDefinition> findVFSForms(InvocationOnMock invocationOnMock) {
String className = invocationOnMock.getArguments()[0].toString();
if (Expense.class.getName().equals(className)) {
FormModel formModel = new DataObjectFormModel(className, className);
// Creating empty form
FormDefinition emptyForm = new FormDefinition(formModel);
emptyForm.setName(EMPTY_FORM_ID);
emptyForm.setId(EMPTY_FORM_ID);
// Creating a form with a field
FormDefinition fullForm = new FormDefinition(formModel);
fullForm.setName(EXPENSE_FORM_ID);
fullForm.setId(EXPENSE_FORM_ID);
DatePickerFieldDefinition field = new DatePickerFieldDefinition();
field.setId(DATE_VARIABLE);
field.setName(DATE_VARIABLE);
field.setLabel(DATE_VARIABLE);
field.setBinding(DATE_VARIABLE);
fullForm.getFields().add(field);
return Arrays.asList(emptyForm, fullForm);
}
return null;
}
use of org.kie.workbench.common.forms.data.modeller.model.DataObjectFormModel in project kie-wb-common by kiegroup.
the class AbstractFormAdapter method createModelForDO.
protected FormModel createModelForDO(DataHolder dataHolder) {
String className = dataHolder.getClassName();
String modelName = className.substring(className.lastIndexOf(".") + 1);
DataObjectFormModel formModel = new DataObjectFormModel(modelName, className);
if (Boolean.TRUE.equals(Boolean.parseBoolean(dataHolder.getSupportedType()))) {
formModel.setSource(Source.EXTERNAL);
}
return formModel;
}
Aggregations