bpmn-io / bpmn-js-differ

A diffing utility for BPMN 2.0 documents.
44 stars 16 forks source link

Update documentation to be compatible with newer versions of moddle-xml #10

Closed ChrisSchoe closed 4 years ago

ChrisSchoe commented 4 years ago

Newer Versions of moddle-xml (v. 7.0.0 onwards) support loading of XMLs using the Java Script promise structure. The documentation of the bpmn-js-differ on how to import xml should reflect that.

The readme part on "Reading BPMN 2.0 documents" could e.g. be updated to something along the following lines:

Load diagrams using bpmn-moddle:

import BpmnModdle from 'bpmn-moddle';

 var oldDefinitions, newDefinitions

 try{
        oldDefinitions = (await new BpmnModdle().fromXML(a)).rootElement;
        newDefinitions = (await new BpmnModdle().fromXML(b)).rootElement;

    } catch(err){
        console.log('something went wrong', err);
    }
pinussilvestrus commented 4 years ago

Thanks for reporting this one! You already suggested some changes, mind you creating a Pull Request which solves the problem? We're open for contributions 🚀

ChrisSchoe commented 4 years ago

Will do =)