@processmaker/modeler 1.36.9 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/modeler",
3
- "version": "1.36.9",
3
+ "version": "1.37.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "test:unit": "vue-cli-service test:unit",
@@ -637,7 +637,6 @@ export default {
637
637
  this.translateConfig(nodeType.inspectorConfig[0]);
638
638
  addLoopCharacteristics(nodeType);
639
639
  this.nodeRegistry[nodeType.id] = nodeType;
640
-
641
640
  Vue.component(nodeType.id, nodeType.component);
642
641
  this.nodeTypes.push(nodeType);
643
642
 
@@ -678,6 +677,10 @@ export default {
678
677
  : [pmBlockNode.bpmnType];
679
678
 
680
679
  types.forEach(bpmnType => {
680
+ if (!this.parsers[bpmnType]) {
681
+ this.parsers[bpmnType] = { custom: [], implementation: [], default: []};
682
+ }
683
+
681
684
  if (customParser) {
682
685
  this.parsers[bpmnType].custom.push(customParser);
683
686
  return;
@@ -846,16 +849,20 @@ export default {
846
849
  }
847
850
 
848
851
  this.removeUnsupportedElementAttributes(definition);
849
- const type = parser(definition, this.moddle);
850
852
 
853
+ const config = definition.config ? JSON.parse(definition.config) : {};
854
+ const type = config?.processKey || parser(definition, this.moddle);
855
+
851
856
  const unnamedElements = ['bpmn:TextAnnotation', 'bpmn:Association', 'bpmn:DataOutputAssociation', 'bpmn:DataInputAssociation'];
852
857
  const requireName = unnamedElements.indexOf(bpmnType) === -1;
853
858
  if (requireName && !definition.get('name')) {
854
859
  definition.set('name', '');
855
860
  }
856
861
 
857
- const node = this.createNode(type, definition, diagram);
858
-
862
+ this.createNodeAsync(type, definition, diagram);
863
+ },
864
+ async createNodeAsync(type, definition, diagram) {
865
+ const node = this.createNode(type, definition, diagram);
859
866
  store.commit('addNode', node);
860
867
  },
861
868
  createNode(type, definition, diagram) {
@@ -65,6 +65,9 @@ export default merge(cloneDeep(boundaryEventConfig), {
65
65
  const eventDefinitions = [
66
66
  moddle.create('bpmn:TimerEventDefinition', eventDefinition),
67
67
  ];
68
+
69
+ eventDefinitions[0].id = node.definition.get('eventDefinitions')[0].id;
70
+
68
71
  setNodeProp(node, 'eventDefinitions', eventDefinitions);
69
72
  } else {
70
73
  setNodeProp(node, key, value[key]);
@@ -0,0 +1,9 @@
1
+ import bpmnExtension from '@processmaker/processmaker-bpmn-moddle/resources/processmaker';
2
+
3
+ const nodeTypes = window.ProcessMaker.pmBlockNodes;
4
+
5
+ export default function registerPmBlock({ registerPmBlock, registerBpmnExtension }) {
6
+ nodeTypes.forEach(config => registerPmBlock(config));
7
+
8
+ registerBpmnExtension('pm', bpmnExtension);
9
+ }