Search in sources :

Example 1 with BPMNVFSFormDefinitionGeneratorService

use of org.kie.workbench.common.forms.jbpm.server.service.formGeneration.impl.authoring.BPMNVFSFormDefinitionGeneratorService in project kie-wb-common by kiegroup.

the class FormDefinitionGeneratorImplTest method init.

@Before
public void init() throws Exception {
    SimpleFileSystemProvider simpleFileSystemProvider = new SimpleFileSystemProvider();
    simpleFileSystemProvider.forceAsDefault();
    Definitions processDefinitions = BPMN2Utils.getDefinitions(FormDefinitionGeneratorImplTest.class.getResourceAsStream(PROCESS_PATH));
    // Prepare BPMNFormModelGenerator
    when(kieModuleService.resolveModule(any())).thenReturn(module);
    when(module.getRootPath()).thenReturn(path);
    when(moduleClassLoaderHelper.getModuleClassLoader(module)).thenReturn(moduleClassLoader);
    when(moduleClassLoader.loadClass(anyString())).thenAnswer(invocation -> Object.class);
    BPMNFormModelGenerator bpmnFormModelGenerator = spy(new BPMNFormModelGeneratorImpl(kieModuleService, moduleClassLoaderHelper));
    FormModelHandlerManager formModelHandlerManager = new TestFormModelHandlerManager(kieModuleService, moduleClassLoaderHelper, new TestFieldManager());
    BPMNFormGeneratorService<Path> bpmnFormGeneratorService = new BPMNVFSFormDefinitionGeneratorService(new TestFieldManager(), formModelHandlerManager, formFinderService, formDefinitionSerializer, ioService, commentedOptionFactory, synchronizationUtil);
    generator = spy(new TestFormDefinitionGeneratorImpl(formGenerationModelProviders, ioService, bpmnFormModelGenerator, formDefinitionSerializer, bpmnFormGeneratorService, processDefinitions));
    when(diagram.getMetadata()).thenReturn(metadata);
    when(metadata.getPath()).thenReturn(diagramPath);
    when(diagram.getGraph()).thenReturn(graph);
    when(diagramPath.toURI()).thenReturn("default:///src/main/resources" + PROCESS_PATH);
}
Also used : SimpleFileSystemProvider(org.uberfire.java.nio.fs.file.SimpleFileSystemProvider) Path(org.uberfire.backend.vfs.Path) FormModelHandlerManager(org.kie.workbench.common.forms.editor.service.backend.FormModelHandlerManager) Definitions(org.eclipse.bpmn2.Definitions) BPMNFormModelGenerator(org.kie.workbench.common.forms.jbpm.server.service.BPMNFormModelGenerator) BPMNFormModelGeneratorImpl(org.kie.workbench.common.forms.jbpm.server.service.impl.BPMNFormModelGeneratorImpl) TestFieldManager(org.kie.workbench.common.forms.fields.test.TestFieldManager) BPMNVFSFormDefinitionGeneratorService(org.kie.workbench.common.forms.jbpm.server.service.formGeneration.impl.authoring.BPMNVFSFormDefinitionGeneratorService) Before(org.junit.Before)

Example 2 with BPMNVFSFormDefinitionGeneratorService

use of org.kie.workbench.common.forms.jbpm.server.service.formGeneration.impl.authoring.BPMNVFSFormDefinitionGeneratorService in project kie-wb-common by kiegroup.

the class FormGenerationIntegrationTest method init.

@Before
public void init() {
    final String nestedformsUri = getUriOfResource(PREPARED_NESTED_FORMS_FOLDER);
    final String modelUri = getUriOfResource(JAVA_MODEL_FOLDER);
    rootPathWithNestedForms = PathFactory.newPath(DATA_OBJECTS_FOLDER, nestedformsUri);
    rootPathWithoutNestedForms = PathFactory.newPath(DATA_OBJECTS_FOLDER, modelUri);
    finderService = new DataObjectFinderServiceImpl(moduleService, dataModelerService);
    formModelHandlerManager = new TestFormModelHandlerManager(moduleService, moduleClassLoaderHelper, fieldManager, finderService);
    formFinderService = new VFSFormFinderServiceImpl(ioService, moduleService, formSerializer);
    service = new BPMNVFSFormDefinitionGeneratorService(fieldManager, formModelHandlerManager, formFinderService, formSerializer, ioService, commentedOptionFactory, formModelSynchronizationUtil);
    when(moduleService.resolveModule(any())).thenReturn(module);
    when(moduleClassLoaderHelper.getModuleClassLoader(any())).thenReturn(moduleClassLoader);
    generator = new BPMNFormModelGeneratorImpl(moduleService, moduleClassLoaderHelper);
    processFormModel = generator.generateProcessFormModel(formGenerationProcessDefinitions, rootPathWithNestedForms);
    taskFormModels = generator.generateTaskFormModels(formGenerationProcessDefinitions, rootPathWithNestedForms);
}
Also used : VFSFormFinderServiceImpl(org.kie.workbench.common.forms.editor.backend.service.impl.VFSFormFinderServiceImpl) TestFormModelHandlerManager(org.kie.workbench.common.forms.jbpm.server.service.formGeneration.test.TestFormModelHandlerManager) BPMNFormModelGeneratorImpl(org.kie.workbench.common.forms.jbpm.server.service.impl.BPMNFormModelGeneratorImpl) DataObjectFinderServiceImpl(org.kie.workbench.common.forms.data.modeller.service.impl.DataObjectFinderServiceImpl) BPMNVFSFormDefinitionGeneratorService(org.kie.workbench.common.forms.jbpm.server.service.formGeneration.impl.authoring.BPMNVFSFormDefinitionGeneratorService) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 BPMNVFSFormDefinitionGeneratorService (org.kie.workbench.common.forms.jbpm.server.service.formGeneration.impl.authoring.BPMNVFSFormDefinitionGeneratorService)2 BPMNFormModelGeneratorImpl (org.kie.workbench.common.forms.jbpm.server.service.impl.BPMNFormModelGeneratorImpl)2 Definitions (org.eclipse.bpmn2.Definitions)1 DataObjectFinderServiceImpl (org.kie.workbench.common.forms.data.modeller.service.impl.DataObjectFinderServiceImpl)1 VFSFormFinderServiceImpl (org.kie.workbench.common.forms.editor.backend.service.impl.VFSFormFinderServiceImpl)1 FormModelHandlerManager (org.kie.workbench.common.forms.editor.service.backend.FormModelHandlerManager)1 TestFieldManager (org.kie.workbench.common.forms.fields.test.TestFieldManager)1 BPMNFormModelGenerator (org.kie.workbench.common.forms.jbpm.server.service.BPMNFormModelGenerator)1 TestFormModelHandlerManager (org.kie.workbench.common.forms.jbpm.server.service.formGeneration.test.TestFormModelHandlerManager)1 Path (org.uberfire.backend.vfs.Path)1 SimpleFileSystemProvider (org.uberfire.java.nio.fs.file.SimpleFileSystemProvider)1