Giter Site home page Giter Site logo

bpmn-moddle's Introduction

bpmn-moddle

CI

Read and write BPMN 2.0 diagram files in NodeJS and the browser.

bpmn-moddle uses the BPMN 2.0 meta-model to validate the input and produce correct BPMN 2.0 XML.

Usage

Get the library via npm package. Consume it in NodeJS, via UMD or bundle it using your favorite build tool.

import BpmnModdle from 'bpmn-moddle';

const moddle = new BpmnModdle();

const xmlStr =
  '<?xml version="1.0" encoding="UTF-8"?>' +
  '<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
                     'id="empty-definitions" ' +
                     'targetNamespace="http://bpmn.io/schema/bpmn">' +
  '</bpmn2:definitions>';


const {
  rootElement: definitions
} = await moddle.fromXML(xmlStr);

// update id attribute
definitions.set('id', 'NEW ID');

// add a root element
const bpmnProcess = moddle.create('bpmn:Process', { id: 'MyProcess_1' });
definitions.get('rootElements').push(bpmnProcess);

// xmlStrUpdated contains new id and the added process
const {
  xml: xmlStrUpdated
} = await moddle.toXML(definitions);

Resources

Building the Project

The tests include XSD schema validation. They required you to have a Java SDK installed and exposed through the JAVA_HOME variable.

# execute the test
npm test

# perform a full build
npm run all

Related

The library is built on top of moddle and moddle-xml.

License

Use under the terms of the MIT license.

bpmn-moddle's People

Contributors

barmac avatar falko avatar felixlinker avatar hawky-4s- avatar iso50 avatar maxtru avatar nikku avatar oguzeroglu avatar pedesen avatar philippfromme avatar renovate[bot] avatar sebastianstamm avatar wkit23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bpmn-moddle's Issues

Question: Can use an another namespace than bpmn

Can I use and retrieve the information of an particular namespace

<bpmn2:process id="approve-loan" name="Loan Approval" isExecutable="true" myNs:myProperty1="myVal1">
    <bpmn2:startEvent id="StartEvent_1" myNs:myProperty2="something/else" name="Loan Request&#xD;&#xA;Received">
      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
     ...

How I can retrieve the properties of myNs of each element?

Best Regards.

Allow custom extensions to be used

  • Add ability to include extension meta-models
  • Read / write custom meta-model extensions
  • Add ability to bootstrap bpmn-model with extensions
  • Ensure we can read BPMN 2.0 extension elements
  • Ensure we can write BPMN 2.0 extension elements

Extension features

  • Extensions can define short cuts for bpmn:extensionElements
  • Extensions can define short cuts for custom-ns:SomeAttribute
  • Extension elements can be imported as typed elements
  • custom extension elements can be created using bpmn-moddle and wired with an existing bpmn document

Why for '$type': 'bpmn:Participant' is not returning the processRef attribute

Hi,
Please I'm not sure but I have the following issue:

I have following XML (part):

  <bpmn2:collaboration id="_Collaboration_3">
    <bpmn2:participant id="Participant_1" name="Expenses Payment" processRef="Process_1"/>
    <bpmn2:participant id="Participant_2" name="MyProcess2" processRef="Process_2"/>
  </bpmn2:collaboration>

I've executing the following code:

console.log(rootElements[0].get('participants'));

I'm getting

[ { '$type': 'bpmn:Participant',
    id: 'Participant_1',
    name: 'Expenses Payment' },
  { '$type': 'bpmn:Participant',
    id: 'Participant_2',
    name: 'MyProcess2' } ]

why processRef attribute is not being returned? thanks.

Best Regards.

Correctly handle CallActivity#calledElement

This currently leads to a warning

[writer] missing namespace information for  calledElement = Process_ba16239e-181e-4b9f-bc5b-0bb2ee973450 on

because the calledElement property is not correctly defined in the meta-model.

Add explicit build for meta-model

Currently, the json metamodel is created from cmof when running the test suite. This has several drawbacks:

  • Tests should not persistently change resources outside their test environment
  • When changing the json, the tests fail initially, as the updated json is only respected in subsequent test runs

To solve this, I propose the following changes:

  • create a new grunt target (e.g. build), which performs the cmof to json conversion
  • remove "tests" from testsuite, that do not test anything, but perform the build (i.e. the whole spec/adapter directory)
  • optionally test the cmof to json conversion in a sandboxed test
  • optionally add additional grunt target "auto-build" (perform build on change and run the tests)

Verify correct handling of enumeration type properties

Looking into bpmn-io/moddle#18 it seems like we don't support handling of enumerations such associationDirection yet.

Example snippet:

<association xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
                     associationDirection="None"
                     id="association" />

Tasks

  • Verify correct export of enumeration properties
  • Verify correct export of enumeration properties

Should the import statements not specify the file with a ".js" extension?

I was trying to consume this project in a Chrome browser and ended up getting 404 not found errors. I'm not very skilled in ES6 modules but after some reading, it appears that Chrome requires the path to the module to include the ".js" suffix. Is there a reason that the suffix hasn't been added to the paths in this package? Would it be a good idea to add them?

$type field

hey! can you help me with one thing: is it possible to set $type field object descriptor to writable, just faced with the troubles when I need to modify type of element

Import BPMN file in NodeJS

Srs.,

I created a test BPMN file in order to test the import of the moddler, I get an error.

image

Save the file above as BPMN extension (it's the diagram I created as example)

diagram bpmn

The Code:

var BpmnModdle = require('bpmn-moddle');
var fs = require("fs");
var filename = "diagrama.bpmn";
var moddle = new BpmnModdle();
var xmlStr;
fs.readFile(filename, "utf8", function(err, data) {
        if (err) throw err;
        xmlStr = data;
        console.dir(xmlStr);
        console.log("diagrama read");
});

moddle.fromXML(xmlStr, function(err, definitions) {
  if (err) throw err;

  console.dir(definitions);

});

Choreography activity participantRef(s)

Hi everyone,

we're currently working on a BPMN 2.0 choreography diagram modeler (chor-js, chor-js-demo) based on bpmn-js and bpmn-moddle. We've noticed some inconsistencies regarding the name of the participantRefs association on Choreography Activity (and Conversation Node).

Apparently, depending on where you look, the trailing s is sometimes missing:

participantRef participantRefs (with s)
BPMN 2.0 XSD BPMN 2.0 CMOF
Signavio BPMN 2.0 standard document (in the text)
Eclipse BPMN2 Modeler bpmn-moddle

Our current plan is to be able to import both versions, and export the participantRef version for compatibility with Signavio and the Eclipse BPMN2 Modeler.

Suggestion: We are not aware of any tool using the participantRefs version found in the CMOF, so the workarounds could be scraped if the association was renamed to participantRef in bpmn-moddle as well.

XSD Extensions to JSON

Hi. I want to write a Activiti BPMN moddle extension, like the Camunda one.
Do you use some tool to parse the XSD and write the JSON equivalent?
Can anyone any documentation about it?

PS: The camunda extension that is used in test classes in this project uses the Activiti XSD Namespace many times. Camunda have more extensions than Activiti or they are compatible?

Thanks!

MultiInstanceLoopCharacteristics not correctly exported

Schema definition:

<xsd:element name="multiInstanceLoopCharacteristics" type="tMultiInstanceLoopCharacteristics"  substitutionGroup="loopCharacteristics"/>
<xsd:complexType name="tMultiInstanceLoopCharacteristics">
    <xsd:complexContent>
        <xsd:extension base="tLoopCharacteristics">
            <xsd:sequence>
                <xsd:element name="loopCardinality" type="tExpression" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="loopDataInputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="loopDataOutputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="inputDataItem" type="tDataInput" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="outputDataItem" type="tDataOutput" minOccurs="0" maxOccurs="1"/>
                <xsd:element ref="complexBehaviorDefinition" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element name="completionCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>
            </xsd:sequence>
            <xsd:attribute name="isSequential" type="xsd:boolean" default="false"/>
            <xsd:attribute name="behavior" type="tMultiInstanceFlowCondition" default="All"/>
            <xsd:attribute name="oneBehaviorEventRef" type="xsd:QName" use="optional"/>
            <xsd:attribute name="noneBehaviorEventRef" type="xsd:QName" use="optional"/>
        </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

Input XML:

<bpmn:multiInstanceLoopCharacteristics id="g9sdgh0sd" isSequential="false">
    <bpmn:loopDataInputRef>CheckDataTaskInput</bpmn:loopDataInputRef>
    <bpmn:loopDataOutputRef>CheckDataTaskOutput</bpmn:loopDataOutputRef>
    <bpmn:inputDataItem id="LoopInstanceInput" isCollection="false" itemSubjectRef="TravelOrderItem" name="CheckDataTask.TravelOrder"/>
    <bpmn:outputDataItem id="LoopInstanceOutput" isCollection="false" itemSubjectRef="TravelOrderItem" name="CheckDataTask.TravelOrder"/>
</bpmn:multiInstanceLoopCharacteristics>

Exported XML (wrong):

  <bpmn:multiInstanceLoopCharacteristics id="g9sdgh0sd" loopDataInputRef="CheckDataTaskInput" loopDataOutputRef="CheckDataTaskOutput">
    <bpmn:dataInput id="LoopInstanceInput" itemSubjectRef="TravelOrderItem" name="CheckDataTask.TravelOrder" />
    <bpmn:dataOutput id="LoopInstanceOutput" itemSubjectRef="TravelOrderItem" name="CheckDataTask.TravelOrder" />
  </bpmn:multiInstanceLoopCharacteristics>

See forum topic.

Bump moddle version

I get a global leak warning when running tests depending on bpmn-moddle. I have located it to moddle/Model.js (v0.0.2). This seems to be fixed in the latest version of moddle. Is it possible to bump the version of moddle in bpmn-moddle?

Edit: It seems that moddle has to be updated in npm. The version in bpmn-moddle is correct.

Best regards,

/pål

Error trying to export an XML

When we try to export a loaded XML we get a "Cannot read property 'uri' of undefined" error.
We are using some meta model extension.
Here is a basic JsFiddle example of the problem. The example does this:

  • extends the bpmn:Expression element with a custom attribute "expressionType"
  • loads a simple XML that contains this custom attribute
  • fires the XML export after a short delay -> here the error is thrown

See forum topic

how can i generate a .bpmn with events

I'm a bit inexperimented with bpmn and i'm trying to generate a bpmn file that i can open with camunda.
i understand that i need to add something like :

<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="MyProcess_1">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="173" y="102" width="36" height="36" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>

but i can't manage to make it work and i could use some exemples and how to create different shapes...

I tried this but the var result = "undefined"

function addEvent(){

moddle.fromXML(xmlStr, function(err, definitions) {

  // add a root element
  var bpmnTask = moddle.create('bpmn:Task', { id: "tache" });
  definitions.get('rootElements').push(bpmnTask);


  var bpmnShape = moddle.create('bpmndi:BPMNShape', { id: "shape_tache" , bpmnElement: "tache" });
  definitions.get('rootElements').push(bpmnShape);


  moddle.toXML(definitions, function(err, xmlStrUpdated) {

    result = xmlStrUpdated;
  });

});
}

Lane children not correctly exported

Correct order, as demanded in the BPMN 2.0 XML schema:

    <xsd:complexType name="tLane">
        <xsd:complexContent>
            <xsd:extension base="tBaseElement">
                <xsd:sequence>
                    <xsd:element name="partitionElement" type="tBaseElement" minOccurs="0" maxOccurs="1"/>
                    <xsd:element name="flowNodeRef" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element name="childLaneSet" type="tLaneSet" minOccurs="0" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:attribute name="name" type="xsd:string"/>
                <xsd:attribute name="partitionElementRef" type="xsd:QName"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

Correctly serialize data-types via xsi:type

There are many occasions where we need to serialize data types, such as expression -> formalExpression.

We must correctly serialize these types using xsi:type="tTypeName" to be compliant with the BPMN 2.0 spec for executable process diagrams.

Tasks

  • correctly read xsi:type
  • correctly serialize xsi:type
  • integration test against bpmn-js

Incorrect handling of expression elements

Current serialization:

<bpmn2:expression ... />

should be:

<bpmn2:conditionExpression ... />

Example:

<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">${sum > 100}</bpmn2:conditionExpression>

reading attributes with custom namespaces

Hi, I have a problem.

<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
  xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:foo="http://foobar"
  targetNamespace="http://foobar"
  >
  <bpmn2:process id="Process_2" name="Process 2" isExecutable="true">
    <bpmn2:userTask id="UserTask_1" name="the user task" foo:bar="some value">
      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
    </bpmn2:userTask>
    ...
</bpmn2:definitions>

If I want to get the userTask attributes:

     var parser = new BpmnModdle();
     parser.fromXML(bpmnXml, 'bpmn:Definitions', function(err, definitions) {
        if (err) console.log(err);

        for (var i=0; i<definitions.rootElements[0].flowElements.length; i++) {
            if (definitions.rootElements[0].flowElements[i].$type == 'bpmn:UserTask') {
                console.log('UserTask: ');
                console.log(definitions.rootElements[0].flowElements[i]);
            }
        }
    });

And my question is, How I can retrieve the property foo:bar = "some value" ??
I examined the object "definitions.rootElements[0].flowElements[i]" .. and its structure is the follwing:

{ '$type': 'bpmn:UserTask',
  id: 'UserTask_1',
  name: 'the user task' }

there is not and attribute containing the variable with a custom namespace,
in my case foo:bar = "some value".

I will appreciate it a lot that you can help me.

Best Regards.

Can proprieties inherit from 'type' while using 'name' for their xml tags

Hi,

I was wondering if it was possible for a propriety to inherit it's definition from a type but to use it's own name as the tag when serializing to xml.

I could almost do it by modifying the $descriptor.ns.localName attribute of my newly created moddle objects but as I quickly realized, the descriptor is bound to the type and shared across it's instances. This was almost a viable solution :P

I've included three snippets below in case this was not clear

{
    "name": "TypeDefinition",
    "properties": [
        {
            "name": "label",
            "type": "ProprietyDefinition"
        },
        {
            "name": "value",
            "type": "ProprietyDefinition"
        }
    ]
}

This is the result i'd be looking for

...
<abc:typeDefinition>
    <abc:label randomAttr="...">randomBody</abc:label>
    <abc:value randomAttr="...">randomBody</abc:value>
</abc:typeDefinition>
...

This is what I actually get right now

...
<abc:typeDefinition>
    <abc:proprietyDefinition randomAttr="...">randomBody</abc:proprietyDefinition>
    <abc:proprietyDefinition randomAttr="...">randomBody</abc:proprietyDefinition>
</abc:typeDefinition>
...

Thanks!

Correctly read/write di:extension

This is supported in the XSD-Schema, DI section and used extensively by Bizagi modeler.

<xsd:element name="extension" minOccurs="0">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>

We should import it.

Related to bpmn-io/bpmn-js#160

CatchEvent children serialized in wrong order

As mentioned here.

<xsd:complexType name="tCatchEvent" abstract="true">
<xsd:complexContent>
<xsd:extension base="tEvent">
<xsd:sequence>
<xsd:element ref="dataOutput" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="dataOutputAssociation" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="outputSet" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="eventDefinition" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="eventDefinitionRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="parallelMultiple" type="xsd:boolean" default="false"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

can't access to the sourceRef and targetRef attributes from a bpmn:sequenceFlow node

Hi, why I can't access to the sourceRef and targetRef attributes from a node defined as follow:

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
  <bpmn:process id="Process_1" isExecutable="false">
  ...
  <bpmn:sequenceFlow id="SequenceFlow_0p3d6eu" sourceRef="StartEvent_1" targetRef="Task_0i5g36n" />
  ...
  </bpmn:process>
</bpmn:definitions>

and reading the whole doc, with the following code:

moddle.fromXML(xmlStr, function(err, definitions) {
  const element = definitions.rootElements[0];

  element.flowElements.map(flowElement => {
    console.log(flowElement);
  })
});

it just returns:

Base { '$type': 'bpmn:StartEvent', id: 'StartEvent_1' }
Base { '$type': 'bpmn:Task', id: 'Task_0i5g36n', name: 'task1' }
Base { '$type': 'bpmn:SequenceFlow', id: 'SequenceFlow_0p3d6eu' }
Base { '$type': 'bpmn:EndEvent', id: 'EndEvent_0gunr19' }
Base { '$type': 'bpmn:SequenceFlow', id: 'SequenceFlow_0l1rp9v' }

the properties sourceRef and targetRef of bpmn:SequenceFlow are missing.

Fix broken example in README

Hi,
I just copy the example code:

    var BpmnModdle = require('bpmn-moddle');

    var moddle = new BpmnModdle();

    var xmlStr =
      '<?xml version="1.0" encoding="UTF-8"?>' +
      '<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" id="empty-definitions" targetNamespace="http://bpmn.io/schema/bpmn">' +
      '</bpmn2:definitions>';


    moddle.fromXML(xmlStr, function(err, definitions) {

      // update id attribute
      definitions.attr('id', 'NEW ID');

      // add a root element
      var bpmnProcess = moddle.create('bpmn:Process', { id: 'MyProcess_1' });
      definitions.get('rootElements').push(bpmnProcess);

      moddle.toXML(definitions, function(err, xmlStrUpdated) {
        // xmlStrUpdated contains new id and the added process
      });
    });

And it is throwing the following error:

    /Users/erik/test/bpmn/index.js:14
          definitions.attr('id', 'NEW ID');
                      ^
    TypeError: Cannot call method 'attr' of undefined
        at /Users/erik/test/bpmn/index.js:14:16
        at /Users/erik/test/bpmn/node_modules/bpmn-moddle/lib/bpmn-moddle.js:56:5
        at Object.fromXML (/Users/erik/test/bpmn/node_modules/bpmn-moddle/node_modules/moddle-xml/lib/Reader.js:522:7)
        at Moddle.BpmnModdle.fromXML (/Users/erik/test/bpmn/node_modules/bpmn-moddle/lib/bpmn-moddle.js:55:10)
        at Object.<anonymous> (/Users/erik/test/bpmn/index.js:11:9)
        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)

Can you help me please,..

Regards.

Tests reset "enumerations"-fields to "emumerations"

I don't know why this is happening but it might be the reason for why my PR #47 was necessary in the first place.

Whenever I run grunt or grunt test all occasions of enumerations are set to emumerations.

Steps to reproduce:

  1. git clone https://github.com/bpmn-io/bpmn-moddle.git
  2. npm install
  3. grunt test
  4. git diff => See and wonder

Tests fail on Windows

Some of the test cases fail on Windows because of issues either with os.EOL or UTF-8 encoding,

Incorrect script serialization as attribute

Scripts are serialized incorrectly:

Input XML:

<bpmn2:scriptTask id="ScriptTask_4" scriptFormat="Javascript">    
  <bpmn2:script><![CDATA[var items = [1, 3, 5, 10, 60, 20, 40];

execution.setVariable("items", items);]]></bpmn2:script>
</bpmn2:scriptTask>

Ouput XML:

<bpmn2:scriptTask id="ScriptTask_4" scriptFormat="Javascript" script="var items = [1, 3, 5, 10, 60, 20, 40]; execution.setVariable("items", items);]]">
</bpmn2:scriptTask>

The script is serialized as attribute instead of a child element wrapped in a CDATA section.

Nested unprefixed elements not properly serialized

We do not serialize the following stuff right now which is valid XML:

<bpmn:extensionElements>
  <foo:config>
    <Entry key="A" value="B" />
    <Nested>
      <Entry key="A" value="B" />
    </Nested>
  </foo:config>
</bpmn:extensionElements>

When attempting, the export just blows up.

Expose relationship to parent

We should expose the relationship to a parent element via an invisible (i.e. non-enumerable) $parent property.

By doing so we can access the information during model manipulation.

Make SubProcess an InteractionNode

The BPMN 2.0 spec states that a SubProcess is an Activity:

image

And it states that Message Flows can connect to Activities, too:

image

Mapping this to the meta-model, a SubProcess should actually be an InteractionNode.
It seems to be broken and thus our library (in this regard), too.

Need to fix this, need to make SubProcess an InteractionNode.

Custom namespace in attribute value not being serialized

Namespaces in attribute values, i.e. in ItemDefinition#structureRef are not being serialized at the moment. The reason is that we serialize and filter only the used namespaces.

We should restrict the filtering to well known namespaces only, giving users more control over where and how to serialize custom elements, attributes and attribute values.

Example

<bpmn:itemDefinition id="dhgdfhdfghd" structureRef="myNs:Text" />`

Not ẁorking:

renderer.definitions.set("xmlns:myNs", "http://...");

Via forum thread.

How is the tool creating the resulting bpmn file ?

Hi, I'm trying to convert a BPMN xml definition to javascript object with your library and I stumble with a couple of questions regarding to BPMNDiagram objects,
This is the output from bpmn-moddle

{
            "$type": "bpmndi:BPMNDiagram",
            "id": "BPMNDiagram_1",
            "name": "process",
            "plane": {
                "$type": "bpmndi:BPMNPlane",
                "id": "BPMNPlane_Process_1",
                "planeElement": [
                    {} ...  .. ... .. 
                ]
}

The xml source

 <bpmndi:BPMNDiagram id="BPMNDiagram_1" name="process name">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process">

How do you do the relation between the elements defined in rootElements ( process ) with the diagrams elements ? ( bpmnELement reference )

Thanks.. great library by the way.

Collaboration#artifacts serializes in wrong position

We serialize artifacts before participants when it should be the other way around.

Respective part of Semantic.xsd:

<xsd:element name="collaboration" type="tCollaboration" substitutionGroup="rootElement"/>
<xsd:complexType name="tCollaboration">
    <xsd:complexContent>
        <xsd:extension base="tRootElement">
            <xsd:sequence>
                <xsd:element ref="participant" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="messageFlow" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="conversationNode" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="conversationAssociation" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="messageFlowAssociation" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element name="choreographyRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="conversationLink" minOccurs="0" maxOccurs="unbounded"/>
            </xsd:sequence>
            <xsd:attribute name="name" type="xsd:string"/>
            <xsd:attribute name="isClosed" type="xsd:boolean" default="false"/>
        </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.