camunda-bpmn.js icon indicating copy to clipboard operation
camunda-bpmn.js copied to clipboard

any example how to run the engine on server side? with nodejs?

Open eriknyk opened this issue 11 years ago • 2 comments

I made the respective changes to get it work on node.js, and it was working until determined point,.. but I've a problem on Transformer.js

camunda-bpmn.js/src/bpmn/Transformer.js:25
    if (source instanceof Document) {
                          ^
ReferenceError: Document is not defined
    at getXmlObject (/Users/erik/Web/camunda-bpmn.js/src/bpmn/Transformer.js:25:27)
    at Transformer.transform (/Users/erik/Web/camunda-bpmn.js/src/bpmn/Transformer.js:48:15)
    at Object.Engine.startInstance (/Users/erik/Web/camunda-bpmn.js/src/bpmn/Engine.js:30:43)
    at Object.<anonymous> (/Users/erik/Web/camunda-bpmn.js/test/engine/executionlistener.js:71:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)

my problem, obviously, I don't know how to translate this section of code for node.js :(

function getXmlObject(source) {
    var xmlDoc;
    if (source instanceof Document) {
        xmlDoc = source;
    } else if (window.DOMParser) {
      var parser = new DOMParser();
      xmlDoc = parser.parseFromString(source,"text/xml");
    } else {
      xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.async=false;
      xmlDoc.loadXML(source);
    }
    return xmlDoc;

I would appreciate a lot if you can help me,.. I know that the engine is not a fully bpmn engine functional,. but I wish got it running on node.js

Best Regards.

eriknyk avatar Sep 16 '14 14:09 eriknyk

I'm interested too.

ScalaWilliam avatar May 28 '17 13:05 ScalaWilliam

two years with no answer dude @scalaWilliam

eriknyk avatar May 28 '17 18:05 eriknyk