Search in sources :

Example 1 with Resource

use of org.kie.workbench.common.forms.migration.tool.Resource in project kie-wb-common by kiegroup.

the class AllFieldTypesFormGenerationTest method doInit.

@Override
protected void doInit() throws Exception {
    fieldMappings.put("subform", SubFormFieldDefinition.class);
    fieldMappings.put("multiple", MultipleSubFormFieldDefinition.class);
    fieldMappings.put("text", TextBoxBaseDefinition.class);
    fieldMappings.put("textarea", TextAreaFieldDefinition.class);
    fieldMappings.put("character", CharacterBoxFieldDefinition.class);
    fieldMappings.put("float", DecimalBoxFieldDefinition.class);
    fieldMappings.put("double", DecimalBoxFieldDefinition.class);
    fieldMappings.put("bigDecimal", DecimalBoxFieldDefinition.class);
    fieldMappings.put("bigInteger", IntegerBoxFieldDefinition.class);
    fieldMappings.put("byte", IntegerBoxFieldDefinition.class);
    fieldMappings.put("short", IntegerBoxFieldDefinition.class);
    fieldMappings.put("integer", IntegerBoxFieldDefinition.class);
    fieldMappings.put("long", IntegerBoxFieldDefinition.class);
    fieldMappings.put("email", TextBoxFieldDefinition.class);
    fieldMappings.put("boolean", CheckBoxFieldDefinition.class);
    fieldMappings.put("html", TextAreaFieldDefinition.class);
    fieldMappings.put("date", DatePickerFieldDefinition.class);
    fieldMappings.put("shortDate", DatePickerFieldDefinition.class);
    fieldMappings.put("document", DocumentFieldDefinition.class);
    fieldMappings.put("select", StringListBoxFieldDefinition.class);
    fieldMappings.put("radio", StringRadioGroupFieldDefinition.class);
    List<FormMigrationSummary> summaries = new ArrayList<>();
    initForm(form -> userForm = form, DATAOBJECTS_RESOURCES, ALL_FIELD_TYPES, userFormPath);
    summaries.add(new FormMigrationSummary(new Resource<>(userForm, userFormPath)));
    context = new MigrationContext(workspaceProject, weldContainer, migrationServicesCDIWrapper, new RealSystemAccess(), summaries);
}
Also used : MigrationContext(org.kie.workbench.common.forms.migration.tool.pipelines.MigrationContext) RealSystemAccess(org.kie.workbench.common.migration.cli.RealSystemAccess) FormMigrationSummary(org.kie.workbench.common.forms.migration.tool.FormMigrationSummary) ArrayList(java.util.ArrayList) Resource(org.kie.workbench.common.forms.migration.tool.Resource)

Example 2 with Resource

use of org.kie.workbench.common.forms.migration.tool.Resource in project kie-wb-common by kiegroup.

the class FormDefinitionGeneratorForBPMNForWrongTaskFormNameTest method doInit.

@Override
protected void doInit() throws Exception {
    List<FormMigrationSummary> summaries = new ArrayList<>();
    initForm(form -> wrongProcessForm = form, BPMN_RESOURCES, WRONG_PROCESS_FORM, wrongProcessPath);
    summaries.add(new FormMigrationSummary(new Resource<>(wrongProcessForm, wrongProcessPath)));
    initForm(form -> wrontTaskForm = form, BPMN_RESOURCES, WRONG_TASK_FORM, wrongTaskPath);
    summaries.add(new FormMigrationSummary(new Resource<>(wrontTaskForm, wrongTaskPath)));
    context = new MigrationContext(workspaceProject, weldContainer, migrationServicesCDIWrapper, new RealSystemAccess(), summaries);
    generator = new FormDefinitionGenerator(DataObjectFormAdapter::new, this::getBPMNAdapter);
}
Also used : MigrationContext(org.kie.workbench.common.forms.migration.tool.pipelines.MigrationContext) RealSystemAccess(org.kie.workbench.common.migration.cli.RealSystemAccess) FormMigrationSummary(org.kie.workbench.common.forms.migration.tool.FormMigrationSummary) ArrayList(java.util.ArrayList) Resource(org.kie.workbench.common.forms.migration.tool.Resource)

Example 3 with Resource

use of org.kie.workbench.common.forms.migration.tool.Resource in project kie-wb-common by kiegroup.

the class FormDefinitionGeneratorForBPMNWithComplexVariableTest method doInit.

@Override
protected void doInit() throws Exception {
    List<FormMigrationSummary> summaries = new ArrayList<>();
    initForm(form -> userForm = form, DATAOBJECTS_RESOURCES, USER_FORM, userFormPath);
    summaries.add(new FormMigrationSummary(new Resource<>(userForm, userFormPath)));
    initForm(form -> lineForm = form, DATAOBJECTS_RESOURCES, LINE_FORM, lineFormPath);
    summaries.add(new FormMigrationSummary(new Resource<>(lineForm, lineFormPath)));
    initForm(form -> processForm = form, BPMN_RESOURCES, PROCESS_FORM, processFormPath);
    summaries.add(new FormMigrationSummary(new Resource<>(processForm, processFormPath)));
    initForm(form -> taskForm = form, BPMN_RESOURCES, TASK_FORM, taskFormPath);
    summaries.add(new FormMigrationSummary(new Resource<>(taskForm, taskFormPath)));
    context = new MigrationContext(workspaceProject, weldContainer, migrationServicesCDIWrapper, new RealSystemAccess(), summaries);
    generator = new FormDefinitionGenerator(DataObjectFormAdapter::new, this::getBPMNAdapter);
}
Also used : MigrationContext(org.kie.workbench.common.forms.migration.tool.pipelines.MigrationContext) RealSystemAccess(org.kie.workbench.common.migration.cli.RealSystemAccess) FormMigrationSummary(org.kie.workbench.common.forms.migration.tool.FormMigrationSummary) ArrayList(java.util.ArrayList) Resource(org.kie.workbench.common.forms.migration.tool.Resource)

Example 4 with Resource

use of org.kie.workbench.common.forms.migration.tool.Resource in project kie-wb-common by kiegroup.

the class FormDefinitionGeneratorForDataObjectsTest method doInit.

@Override
protected void doInit() throws Exception {
    List<FormMigrationSummary> summaries = new ArrayList<>();
    initForm(form -> userForm = form, DATAOBJECTS_RESOURCES, USER_FORM, userFormPath);
    summaries.add(new FormMigrationSummary(new Resource<>(userForm, userFormPath)));
    initForm(form -> lineForm = form, DATAOBJECTS_RESOURCES, LINE_FORM, lineFormPath);
    summaries.add(new FormMigrationSummary(new Resource<>(lineForm, lineFormPath)));
    initForm(form -> invoiceForm = form, DATAOBJECTS_RESOURCES, INVOICE_FORM, invoiceFormPath);
    summaries.add(new FormMigrationSummary(new Resource<>(invoiceForm, invoiceFormPath)));
    context = new MigrationContext(workspaceProject, weldContainer, migrationServicesCDIWrapper, new RealSystemAccess(), summaries);
}
Also used : MigrationContext(org.kie.workbench.common.forms.migration.tool.pipelines.MigrationContext) RealSystemAccess(org.kie.workbench.common.migration.cli.RealSystemAccess) FormMigrationSummary(org.kie.workbench.common.forms.migration.tool.FormMigrationSummary) ArrayList(java.util.ArrayList) Resource(org.kie.workbench.common.forms.migration.tool.Resource)

Example 5 with Resource

use of org.kie.workbench.common.forms.migration.tool.Resource in project kie-wb-common by kiegroup.

the class FormDefinitionGeneratorForDataObjectsWithErrorsTest method doInit.

@Override
protected void doInit() throws Exception {
    List<FormMigrationSummary> summaries = new ArrayList<>();
    initForm(form -> basicDataHolderForm = form, DATAOBJECTS_RESOURCES, USER_BASIC_TYPE_DATA_HOLDER_FORM, basicDataHolderPath);
    summaries.add(new FormMigrationSummary(new Resource<>(basicDataHolderForm, basicDataHolderPath)));
    initForm(form -> noDataHoldersForm = form, DATAOBJECTS_RESOURCES, USER_NO_DATA_HOLDERS_FORM, noDataHoldersPath);
    summaries.add(new FormMigrationSummary(new Resource<>(noDataHoldersForm, noDataHoldersPath)));
    initForm(form -> multipleDataHoldersForm = form, DATAOBJECTS_RESOURCES, USER_MULTIPLE_DATA_HOLDERS_FORM, multipleDataHoldersPath);
    summaries.add(new FormMigrationSummary(new Resource<>(multipleDataHoldersForm, multipleDataHoldersPath)));
    context = new MigrationContext(workspaceProject, weldContainer, migrationServicesCDIWrapper, new RealSystemAccess(), summaries);
}
Also used : MigrationContext(org.kie.workbench.common.forms.migration.tool.pipelines.MigrationContext) RealSystemAccess(org.kie.workbench.common.migration.cli.RealSystemAccess) FormMigrationSummary(org.kie.workbench.common.forms.migration.tool.FormMigrationSummary) ArrayList(java.util.ArrayList) Resource(org.kie.workbench.common.forms.migration.tool.Resource)

Aggregations

Resource (org.kie.workbench.common.forms.migration.tool.Resource)8 ArrayList (java.util.ArrayList)7 FormMigrationSummary (org.kie.workbench.common.forms.migration.tool.FormMigrationSummary)7 MigrationContext (org.kie.workbench.common.forms.migration.tool.pipelines.MigrationContext)7 RealSystemAccess (org.kie.workbench.common.migration.cli.RealSystemAccess)6 Form (org.kie.workbench.common.forms.migration.legacy.model.Form)2 FormDefinition (org.kie.workbench.common.forms.model.FormDefinition)2 File (java.io.File)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Set (java.util.Set)1 Function (java.util.function.Function)1 Predicate (java.util.function.Predicate)1 Collectors (java.util.stream.Collectors)1 JBPMFormModel (org.kie.workbench.common.forms.jbpm.model.authoring.JBPMFormModel)1 DataHolder (org.kie.workbench.common.forms.migration.legacy.model.DataHolder)1 Field (org.kie.workbench.common.forms.migration.legacy.model.Field)1 FieldTypeManager (org.kie.workbench.common.forms.migration.legacy.services.FieldTypeManager)1 FormSerializationManager (org.kie.workbench.common.forms.migration.legacy.services.FormSerializationManager)1 FieldTypeBuilder (org.kie.workbench.common.forms.migration.legacy.services.impl.FieldTypeBuilder)1