Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set propagateAllParentVariables default value to true #52

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion resources/zeebe.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@
{
"name": "propagateAllParentVariables",
"isAttr": true,
"type": "Boolean"
"type": "Boolean",
"default": true
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<bpmn:callActivity
id="task-A" name="A"
xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:zeebe="http://camunda.org/schema/zeebe/1.0"
>
<bpmn:extensionElements>
<zeebe:calledElement processId="child-process-id" propagateAllParentVariables="false" />
</bpmn:extensionElements>
</bpmn:callActivity>
61 changes: 61 additions & 0 deletions test/spec/xml/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,67 @@ describe('read', function() {
});
});

describe('with propagateAllParentVariables', function() {

it('default value', function() {

// when
var bo = moddle.create('zeebe:CalledElement');

// then
expect(bo.get('zeebe:propagateAllParentVariables')).to.be.true;
});


it('default value read from BPMN', async function() {

// given
var xml = readFile('test/fixtures/xml/call-activity-zeebe-calledElement.part.bpmn');

// when
const {
rootElement: proc
} = await moddle.fromXML(xml, 'bpmn:CallActivity');

const extensionElements = proc.get('extensionElements');
const values = extensionElements.get('values');
const calledElement = values[0];

// then
expect(calledElement.get('zeebe:propagateAllParentVariables')).to.be.true;
});


it('disabled in BPMN', async function() {

// given
var xml = readFile('test/fixtures/xml/call-activity-zeebe-calledElement-propagateAllParentVariables.part.bpmn');

// when
const {
rootElement: proc
} = await moddle.fromXML(xml, 'bpmn:CallActivity');

// then
expect(proc).to.jsonEqual({
$type: 'bpmn:CallActivity',
id: 'task-A',
name: 'A',
extensionElements: {
$type: 'bpmn:ExtensionElements',
values: [
{
$type: 'zeebe:CalledElement',
processId: 'child-process-id',
propagateAllParentVariables: false
}
]
}
});

});
});

});


Expand Down
3 changes: 1 addition & 2 deletions test/spec/xml/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ describe('write', function() {
});

var expectedXML = '<zeebe:calledElement ' +
'xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" ' +
'propagateAllParentVariables="true" />';
'xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" />';

// when
const xml = await write(fieldElem);
Expand Down
Loading