2014-10-31 14:05:16 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-06-07 06:46:45 +00:00
|
|
|
require('../../../TestHelper');
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
/* global bootstrapViewer, inject */
|
|
|
|
|
|
|
|
|
|
|
|
describe('import - associations', function() {
|
|
|
|
|
|
|
|
describe('should import association', function() {
|
|
|
|
|
|
|
|
it('connecting task -> text annotation', function(done) {
|
|
|
|
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../../../fixtures/bpmn/import/association/text-annotation.bpmn');
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
// given
|
|
|
|
bootstrapViewer(xml)(function(err) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
return done(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
// when
|
|
|
|
inject(function(elementRegistry) {
|
|
|
|
|
2014-11-17 16:36:22 +00:00
|
|
|
var association = elementRegistry.get('Association_1');
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
// then
|
2015-12-01 07:27:45 +00:00
|
|
|
expect(association).to.exist;
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
done();
|
|
|
|
})();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it('connecting boundary -> compensate task', function(done) {
|
|
|
|
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../../../fixtures/bpmn/import/association/compensation.bpmn');
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
// given
|
|
|
|
bootstrapViewer(xml)(function(err) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
return done(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
// when
|
|
|
|
inject(function(elementRegistry) {
|
|
|
|
|
2014-11-17 16:36:22 +00:00
|
|
|
var association = elementRegistry.get('Association_1');
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
// then
|
2015-12-01 07:27:45 +00:00
|
|
|
expect(association).to.exist;
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
done();
|
|
|
|
})();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
describe('should import data association', function() {
|
|
|
|
|
|
|
|
it('task -> data object -> task', function(done) {
|
|
|
|
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../../../fixtures/bpmn/import/association/data-association.bpmn');
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
// given
|
|
|
|
bootstrapViewer(xml)(function(err) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
return done(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
// when
|
|
|
|
inject(function(elementRegistry) {
|
|
|
|
|
2014-11-17 16:36:22 +00:00
|
|
|
var dataInputAssociation = elementRegistry.get('DataInputAssociation_1');
|
|
|
|
var dataOutputAssociation = elementRegistry.get('DataOutputAssociation_1');
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
// then
|
2015-12-01 07:27:45 +00:00
|
|
|
expect(dataInputAssociation).to.exist;
|
|
|
|
expect(dataOutputAssociation).to.exist;
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
done();
|
|
|
|
})();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it('data input -> task -> data output', function(done) {
|
|
|
|
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../../../fixtures/bpmn/import/association/data-input-output.bpmn');
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
// given
|
|
|
|
bootstrapViewer(xml)(function(err) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
return done(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
// when
|
|
|
|
inject(function(elementRegistry) {
|
|
|
|
|
2014-11-17 16:36:22 +00:00
|
|
|
var dataInputAssociation = elementRegistry.get('DataInputAssociation_1');
|
|
|
|
var dataOutputAssociation = elementRegistry.get('DataOutputAssociation_1');
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
// then
|
2015-12-01 07:27:45 +00:00
|
|
|
expect(dataInputAssociation).to.exist;
|
|
|
|
expect(dataOutputAssociation).to.exist;
|
2014-10-31 14:05:16 +00:00
|
|
|
|
|
|
|
done();
|
|
|
|
})();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-01-21 14:18:09 +00:00
|
|
|
|
|
|
|
it('catch event -> data object -> throw event', function(done) {
|
|
|
|
|
|
|
|
var xml = require('../../../fixtures/bpmn/import/association/data-association-events.bpmn');
|
|
|
|
|
|
|
|
// given
|
|
|
|
bootstrapViewer(xml)(function(err) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
return done(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
// when
|
|
|
|
inject(function(elementRegistry) {
|
|
|
|
|
|
|
|
var dataInputAssociation = elementRegistry.get('DataInputAssociation');
|
|
|
|
var dataOutputAssociation = elementRegistry.get('DataOutputAssociation');
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(dataInputAssociation).to.exist;
|
|
|
|
expect(dataOutputAssociation).to.exist;
|
|
|
|
|
|
|
|
done();
|
|
|
|
})();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-10-31 14:05:16 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|