Bpmn-js-differ project outdated


#1

Hi!

Will https://github.com/bpmn-io/bpmn-js-differ project maintained in the near future?
With the actual BPMN-JS library the differ project not working and also not considering a lot of properties.

Thank you,
Rómeó Nagy


#2

For sure! What is missing from the project, which properties does it not consider?


#3

Hi nikku!

First, thank you for this great tool! It is really good stuff to be able to compare two BPMN instances.

I already created two issues in github: https://github.com/bpmn-io/bpmn-js-differ/issues
What I found so far:

  • input / output parameters of tasks found but it throws an exception while parsing and lead to exception.
  • DMN task impementation decisionRef change not found.
    But I am pretty sure that there was a lot of changes in bpmn-js and its properties what was not covered in the differ since 2-3 years.

I already tried to parse input / output parameters but unfortunately I do not know the data model and its hard only to me to understand its properly. I can share you what I did so far its really just a sketch missing all type of coding design and it is ugly but here it is:

change-handler.js:
I put this function in a try-catch:

function isTracked(element) {
	try {
	  return element.$instanceOf('bpmn:FlowElement') ||
	         element.$instanceOf('bpmn:MessageFlow') ||
		 element.$instanceOf('bpmn:Participant') ||
		 element.$instanceOf('bpmn:Lane');
	} catch (e) {
		return false;
	}
}

differ.js:
From line 63:

...
if (isArray(d)) {
   handler.changed(model, key, d[0], d[1]);
} else if (d.values !== undefined && isArray(d.values[0])) {
   var newInputOutput = d.values[0][0],
       oldInputOutput = d.values._0[0];
   if (newInputOutput.$type === "camunda:inputOutput") {
	var newInputValues = [],
            newOutputValues = [];
	forEach(newInputOutput.$children, function(val) {
		if (val.$type === "camunda:inputParameter") {
                    var paramNameI = val.name,
                        paramValueI;
                    if(typeof val.$children !== 'undefined') {
                          paramValueI = val.$children[0].$body;
                     }
                     newInputValues.push({
                          paramName: paramNameI,
                          paramValue: paramValueI
                     });
		} else if (val.$type === "camunda:outputParameter") {
                    var paramNameO = val.name,
                          paramValueO;
                    if(typeof val.$children !== 'undefined') {
                          paramValueO = val.$children[0].$body;
                    }
                    newOutputValues.push({
                          paramName: paramNameO,
                          paramValue: paramValueO
                    });
		}
	});
	var oldInputValues = [],
              oldOutputValues = [];
	forEach(oldInputOutput.$children, function(val) {
		if (val.$type === "camunda:inputParameter") {
                    var paramNameI = val.name,
                          paramValueI;
                    if(typeof val.$children !== 'undefined') {
                          paramValueI = val.$children[0].$body;
                    }
                    oldInputValues.push({
                          paramName: paramNameI,
                          paramValue: paramValueI
                    });
		} else if (val.$type === "camunda:outputParameter") {
                        var paramNameO = val.name,
                              paramValueO;
                        if(typeof val.$children !== 'undefined') {
                            paramValueO = val.$children[0].$body;
                        }
                        oldOutputValues.push({
                            paramName: paramNameO,
                            paramValue: paramValueO
                        });
		}
	});
	if (newInputValues.length !== 0 || oldInputValues.length !== 0) {
            handler.changed(model, "inputParameter", JSON.stringify(oldInputValues), JSON.stringify(newInputValues));
        }
        if (newOutputValues.length !== 0 || oldOutputValues.length !== 0) {
            handler.changed(model, "outputParameter", JSON.stringify(oldOutputValues), JSON.stringify(newOutputValues));
        }
   }
} else {
   handler.changed(model, key);
   walk(d, model[key]);
}
...

These can parse input / output parameters and its simple body value.

Thank you!

Best regards,
Rómeó Nagy


#4

Hi!
Also appreciated such a great tool.
Nikku, could you please share sources of the site example https://demo.bpmn.io/diff? Those in diagram-diffing GitHub repo seems outdated.
Still hope the tool will be maintained.
Thank you.


#5

I’ve released a new version of the differ and verified that we correctly detect extensions, too.

Please create issues in the diffing project and attach test cases if you find more issues.

The diffing demo is now up to date once again, too.


#6

Thank you, Nikku.
Where can i find the diffing demo webpage sources? The bpmn-js-diffing repo is still outdated.


#7

Where can i find the diffing demo webpage sources?

We don’t publish the sources of the demo, including diffing. The diffing demo you liked should still work though.