Search in sources :

Example 1 with DefaultProfileImpl

use of org.kie.workbench.common.stunner.bpmn.backend.legacy.profile.impl.DefaultProfileImpl in project kie-wb-common by kiegroup.

the class BaseDiagramMarshaller method unmarshall.

@Override
public Graph unmarshall(final Metadata metadata, final InputStream inputStream) throws IOException {
    LOG.debug("Starting diagram unmarshalling...");
    // No rule checking for marshalling/unmarshalling, current jbpm designer marshallers should do it for us.
    final Bpmn2UnMarshaller parser = new Bpmn2UnMarshaller(bpmnGraphBuilderFactory, definitionManager, factoryManager, rulesManager, oryxManager, graphCommandManager, commandFactory, indexBuilder, getDiagramDefinitionSetClass(), getDiagramDefinitionClass());
    Graph result = null;
    try {
        // Unmarshall the diagram definition
        final Definitions definitions = parseDefinitions(inputStream);
        parser.setProfile(new DefaultProfileImpl());
        result = parser.unmarshall(definitions, getPreProcessingData(metadata));
        // Update diagram's settings.
        updateRootUUID(metadata, result);
    } catch (IOException e) {
        LOG.error("Error unmarshalling file.", e);
    }
    LOG.debug("Diagram unmarshalling finished successfully.");
    return result;
}
Also used : Bpmn2UnMarshaller(org.kie.workbench.common.stunner.bpmn.backend.marshall.json.Bpmn2UnMarshaller) Graph(org.kie.workbench.common.stunner.core.graph.Graph) Definitions(org.eclipse.bpmn2.Definitions) IOException(java.io.IOException) DefaultProfileImpl(org.kie.workbench.common.stunner.bpmn.backend.legacy.profile.impl.DefaultProfileImpl)

Aggregations

IOException (java.io.IOException)1 Definitions (org.eclipse.bpmn2.Definitions)1 DefaultProfileImpl (org.kie.workbench.common.stunner.bpmn.backend.legacy.profile.impl.DefaultProfileImpl)1 Bpmn2UnMarshaller (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.Bpmn2UnMarshaller)1 Graph (org.kie.workbench.common.stunner.core.graph.Graph)1