Search in sources :

Example 1 with BaseTaskMorphPropertyDefinition

use of org.kie.workbench.common.stunner.bpmn.definition.morph.BaseTaskMorphPropertyDefinition in project kie-wb-common by kiegroup.

the class BPMNDiagramMarshallerBaseTest method init.

@SuppressWarnings("unchecked")
protected void init() {
    initMocks(this);
    cloneManager = mock(CloneManager.class);
    try {
        api = StunnerTestingGraphBackendAPI.build(BPMNDefinitionSet.class, new BPMNTestDefinitionFactory());
    } catch (Exception e) {
        fail("Cannot instantiate DefinitionSet [message=" + e.getMessage() + "]");
    }
    BackendBindableMorphAdapter<Object> morphAdapter = new BackendBindableMorphAdapter(api.getDefinitionUtils(), api.getFactoryManager(), cloneManager, singletonList(new BaseTaskMorphPropertyDefinition()));
    doReturn(morphAdapter).when(api.getAdapterRegistry()).getMorphAdapter(eq(UserTask.class));
    doReturn(morphAdapter).when(api.getAdapterRegistry()).getMorphAdapter(eq(NoneTask.class));
    doReturn(morphAdapter).when(api.getAdapterRegistry()).getMorphAdapter(eq(ScriptTask.class));
    doReturn(morphAdapter).when(api.getAdapterRegistry()).getMorphAdapter(eq(BusinessRuleTask.class));
    workItemDefinitionMockRegistry = new WorkItemDefinitionMockRegistry();
    WorkItemDefinitionLookupService widService = mock(WorkItemDefinitionLookupService.class);
    when(widService.execute(any(Metadata.class))).thenReturn(workItemDefinitionMockRegistry.items());
    marshaller = new BPMNDirectDiagramMarshaller(new XMLEncoderDiagramMetadataMarshaller(), api.getDefinitionManager(), api.getRuleManager(), widService, api.getFactoryManager(), api.commandFactory, api.commandManager, dataTypeCacheServer);
}
Also used : CloneManager(org.kie.workbench.common.stunner.core.definition.clone.CloneManager) BPMNTestDefinitionFactory(org.kie.workbench.common.stunner.bpmn.BPMNTestDefinitionFactory) NoneTask(org.kie.workbench.common.stunner.bpmn.definition.NoneTask) BPMNDefinitionSet(org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) BusinessRuleTask(org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask) WorkItemDefinitionMockRegistry(org.kie.workbench.common.stunner.bpmn.WorkItemDefinitionMockRegistry) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) BackendBindableMorphAdapter(org.kie.workbench.common.stunner.core.backend.definition.adapter.bind.BackendBindableMorphAdapter) WorkItemDefinitionLookupService(org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService) ScriptTask(org.kie.workbench.common.stunner.bpmn.definition.ScriptTask) XMLEncoderDiagramMetadataMarshaller(org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller) BPMNDirectDiagramMarshaller(org.kie.workbench.common.stunner.bpmn.backend.BPMNDirectDiagramMarshaller) BaseTaskMorphPropertyDefinition(org.kie.workbench.common.stunner.bpmn.definition.morph.BaseTaskMorphPropertyDefinition)

Aggregations

BPMNDefinitionSet (org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet)1 BPMNTestDefinitionFactory (org.kie.workbench.common.stunner.bpmn.BPMNTestDefinitionFactory)1 WorkItemDefinitionMockRegistry (org.kie.workbench.common.stunner.bpmn.WorkItemDefinitionMockRegistry)1 BPMNDirectDiagramMarshaller (org.kie.workbench.common.stunner.bpmn.backend.BPMNDirectDiagramMarshaller)1 BusinessRuleTask (org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask)1 NoneTask (org.kie.workbench.common.stunner.bpmn.definition.NoneTask)1 ScriptTask (org.kie.workbench.common.stunner.bpmn.definition.ScriptTask)1 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)1 BaseTaskMorphPropertyDefinition (org.kie.workbench.common.stunner.bpmn.definition.morph.BaseTaskMorphPropertyDefinition)1 WorkItemDefinitionLookupService (org.kie.workbench.common.stunner.bpmn.workitem.service.WorkItemDefinitionLookupService)1 BackendBindableMorphAdapter (org.kie.workbench.common.stunner.core.backend.definition.adapter.bind.BackendBindableMorphAdapter)1 XMLEncoderDiagramMetadataMarshaller (org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller)1 CloneManager (org.kie.workbench.common.stunner.core.definition.clone.CloneManager)1 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)1