Skip to content

Commit

Permalink
fix: remove lanes check
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Apr 6, 2022
1 parent 6497b69 commit b8a2071
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 95 deletions.
11 changes: 1 addition & 10 deletions rules/camunda-cloud-1-0-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const {
hasEventDefinitionOfType,
hasEventDefinitionOfTypeOrNone,
hasMessageReference,
hasNoLanes,
isNotBpmn,
withTranslations
} = require('./utils/element');
Expand Down Expand Up @@ -36,6 +35,7 @@ module.exports = [
'bpmn:MessageFlow',
'bpmn:ParallelGateway',
'bpmn:Participant',
'bpmn:Process',
'bpmn:SequenceFlow',
'bpmn:TextAnnotation',
{
Expand Down Expand Up @@ -135,15 +135,6 @@ module.exports = [
}
)
},
{
type: 'bpmn:Process',
check: withTranslations(
hasNoLanes,
{
'Element of type <bpmn:Process> (<bpmn:LaneSet>) not supported by {{ executionPlatform }}': 'A <Lane> is not supported by Camunda Platform 8 (Zeebe 1.0)'
}
)
},
{
type: 'bpmn:ReceiveTask',
check: withTranslations(
Expand Down
8 changes: 0 additions & 8 deletions rules/utils/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,6 @@ module.exports.hasMultiInstanceLoopCharacteristics = function(node) {
return true;
};

module.exports.hasNoLanes = function(node) {
const laneSets = node.get('laneSets');

return !laneSets
|| !laneSets.length
|| getElementNotSupportedError(node.$type, 'bpmn:LaneSet', [ 'laneSets' ]);
};

module.exports.isNotBpmn = function(node) {
return !is(node, 'bpmn:BaseElement');
};
Expand Down
42 changes: 15 additions & 27 deletions test/camunda-cloud/camunda-cloud-1-0.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,21 @@ function createValid(executionPlatformVersion = '1.0.0') {
`))
},

// bpmn:Process
{
name: 'process (lanes)',
moddleElement: createModdle(createCloudDefinitions(`
<bpmn:collaboration id="Collaboration_1">
<bpmn:participant id="Participant_1" processRef="Process_1" />
</bpmn:collaboration>
<bpmn:process id="Process_1">
<bpmn:laneSet id="LaneSet_1">
<bpmn:lane id="Lane_1" />
</bpmn:laneSet>
</bpmn:process>
`))
},

// bpmn:ReceiveTask
{
name: 'receive task',
Expand Down Expand Up @@ -1030,33 +1045,6 @@ function createInvalid(executionPlatformVersion = '1.0.0') {
}
},

// bpmn:Process
{
name: 'lane',
moddleElement: createModdle(createCloudDefinitions(`
<bpmn:collaboration id="Collaboration_1">
<bpmn:participant id="Participant_1" processRef="Process_1" />
</bpmn:collaboration>
<bpmn:process id="Process_1">
<bpmn:laneSet id="LaneSet_1">
<bpmn:lane id="Lane_1" />
</bpmn:laneSet>
</bpmn:process>
`)),
report: {
id: 'Process_1',
message: 'A <Lane> is not supported by Camunda Platform 8 (Zeebe 1.0)',
path: [
'laneSets'
],
error: {
type: ERROR_TYPES.ELEMENT_TYPE,
elementType: 'bpmn:Process',
propertyType: 'bpmn:LaneSet'
}
}
},

// bpmn:ReceiveTask
{
name: 'receive task (no message ref)',
Expand Down
50 changes: 0 additions & 50 deletions test/utils/element.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const {
hasMessageReference,
hasMultiInstanceLoopCharacteristics,
hasNoEventDefinition,
hasNoLanes,
withTranslations
} = require('../../rules/utils/element');

Expand Down Expand Up @@ -1288,55 +1287,6 @@ describe('util - element', function() {
});


describe('#hasNoLanes', function() {

it('should not return error', function() {

// given
const node = createElement('bpmn:Process');

// when
const result = hasNoLanes(node);

// then
expect(result).to.be.true;
});


it('should return error', function() {

// given
const node = createElement('bpmn:Process', {
laneSets: [
createElement('bpmn:LaneSet', {
lanes: [
createElement('bpmn:Lane'),
createElement('bpmn:Lane')
]
})
]
});

// when
const result = hasNoLanes(node);

// then
expect(result).to.eql({
message: 'Element of type <bpmn:Process> (<bpmn:LaneSet>) not supported by {{ executionPlatform }}',
path: [
'laneSets'
],
error: {
type: 'elementType',
elementType: 'bpmn:Process',
propertyType: 'bpmn:LaneSet'
}
});
});

});


describe('withTranslations', function() {

it('should translate (string)', function() {
Expand Down

0 comments on commit b8a2071

Please sign in to comment.