Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(inject(function(elementRegistry, selection) {
// given
const shape = elementRegistry.get('TimerEvent_1');
selection.select(shape);
const bo = getBusinessObject(shape);
const timerDefinition = eventDefinitionHelper.getTimerEventDefinition(bo);
timeDuration = timerDefinition.timeDuration;
input = getInputField(container, 'camunda-timer-event-duration', 'timerDefinition');
// when
triggerValue(input, 'foo', 'change');
}));
beforeEach(inject(function(elementRegistry, selection) {
// given
const shape = elementRegistry.get('TIME_DURATION');
selection.select(shape);
const bo = getBusinessObject(shape);
const timerDefinition = eventDefinitionHelper.getTimerEventDefinition(bo);
timeDuration = timerDefinition.timeDuration;
input = getTimerDefinitionField(container);
// when
triggerValue(input, 'foo', 'change');
}));
beforeEach(inject(function(elementRegistry, selection) {
// when
const shape = elementRegistry.get('WITHOUT_TYPE');
selection.select(shape);
const bo = getBusinessObject(shape);
timerDefinition = eventDefinitionHelper.getTimerEventDefinition(bo);
}));
beforeEach(inject(function(elementRegistry, selection) {
// when
const shape = elementRegistry.get('TIME_DATE');
selection.select(shape);
const bo = getBusinessObject(shape);
timerDefinition = eventDefinitionHelper.getTimerEventDefinition(bo);
}));
beforeEach(inject(function(elementRegistry, selection) {
// given
const shape = elementRegistry.get('TIME_DATE');
selection.select(shape);
const bo = getBusinessObject(shape);
const timerDefinition = eventDefinitionHelper.getTimerEventDefinition(bo);
timeDate = timerDefinition.timeDate;
input = getTimerDefinitionField(container);
// when
triggerValue(input, 'foo', 'change');
}));
beforeEach(inject(function(elementRegistry, selection) {
// given
const shape = elementRegistry.get('TIME_CYCLE');
selection.select(shape);
const bo = getBusinessObject(shape);
const timerDefinition = eventDefinitionHelper.getTimerEventDefinition(bo);
timeCycle = timerDefinition.timeCycle;
input = getTimerDefinitionField(container);
// when
triggerValue(input, 'foo', 'change');
}));
beforeEach(inject(function(elementRegistry, selection) {
// given
const shape = elementRegistry.get('TIME_CYCLE');
selection.select(shape);
const bo = getBusinessObject(shape);
const timerDefinition = eventDefinitionHelper.getTimerEventDefinition(bo);
timeCycle = timerDefinition.timeCycle;
input = getTimerDefinitionField(container);
// when
triggerValue(input, 'foo', 'change');
}));
beforeEach(inject(function(elementRegistry, selection) {
// given
const shape = elementRegistry.get('MessageEvent_2');
selection.select(shape);
const bo = getBusinessObject(shape);
const messageEventDefinition =
eventDefinitionHelper.getMessageEventDefinition(bo);
const messageRef = messageEventDefinition.messageRef;
subscriptionDefinition = getSubscriptionDefinitions(messageRef)[0];
input = getInputField(
container, 'camunda-message-element-subscription', 'correlationKey');
// when
triggerValue(input, 'foo', 'change');
}));
setProperty: function(element, values, node) {
const bo = getBusinessObject(element);
const commands = [];
// create extensionElements
let extensionElements = bo.get('extensionElements');
if (!extensionElements) {
extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, bo, bpmnFactory);
commands.push(cmdHelper.updateProperties(element, { extensionElements: extensionElements }));
}
// create taskDefinition
let taskDefinition = getTaskDefinition(element);
if (!taskDefinition) {
taskDefinition = elementHelper.createElement('zeebe:TaskDefinition', { }, extensionElements, bpmnFactory);
commands.push(cmdHelper.addAndRemoveElementsFromList(
element,
extensionElements,
'values',
'extensionElements',
[ taskDefinition ],
[]
));
function setProperties(element, values) {
const businessObject = getBusinessObject(element),
commands = [];
// ensure extensionElements
let extensionElements = businessObject.get('extensionElements');
if (!extensionElements) {
extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, businessObject, bpmnFactory);
commands.push(cmdHelper.updateBusinessObject(element, businessObject, { extensionElements: extensionElements }));
}
// ensure zeebe:calledElement
let calledElement = getCalledElement(businessObject);
if (!calledElement) {
calledElement = elementHelper.createElement('zeebe:CalledElement', { }, extensionElements, bpmnFactory);
commands.push(cmdHelper.addAndRemoveElementsFromList(
element,
extensionElements,
'values',
'extensionElements',
[ calledElement ],
[]
));
}