Skip to content

Commit

Permalink
use device_repository.wait in smart-service designer
Browse files Browse the repository at this point in the history
  • Loading branch information
IngoRoessner committed Apr 29, 2024
1 parent 54530e2 commit 30a10b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,7 @@ export class EditSmartServiceTaskDialogComponent implements OnInit, AfterViewIni
deviceRepositoryCreateDeviceGroupFieldKey = 'device_repository.create_device_group';
deviceRepositoryNameFieldKey = 'device_repository.name';
deviceRepositoryKeyFieldKey = 'device_repository.key';
deviceRepositoryWaitFieldKey = 'device_repository.wait';

private initDeviceRepositoryWorkerInfo(inputs: SmartServiceTaskInputDescription[]) {
inputs.forEach(input => {
Expand All @@ -1360,6 +1361,7 @@ export class EditSmartServiceTaskDialogComponent implements OnInit, AfterViewIni
case 'create_device_group': {
result.push({name: this.deviceRepositoryCreateDeviceGroupFieldKey, type: 'text', value: this.deviceRepositoryWorkerInfo.create_device_group.ids});
result.push({name: this.deviceRepositoryNameFieldKey, type: 'text', value: this.deviceRepositoryWorkerInfo.name});
result.push({name: this.deviceRepositoryWaitFieldKey, type: 'text', value: "true"});
if (this.deviceRepositoryWorkerInfo.key) {
result.push({name: this.deviceRepositoryKeyFieldKey, type: 'text', value: this.deviceRepositoryWorkerInfo.key});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,17 @@ function createTaskEntries(group, element, bpmnjs, eventBus, bpmnFactory, elemen
let doneEventName = taskId+"_done_event";
let doneEventNameRef = "${"+doneEventName+"}";
let doneEvent = findMessageEventElement(element, doneEventNameRef);

let usesWaitParam = function (prefix) {
return !!taskInfo.inputs.find(value => {
return value.name === prefix+".wait" && value.value === "true"
})
}

if (taskInfo.topic === "process_deployment" && !doneEvent){
createIntermediateCatchMessageEvent(bpmnFactory, elementFactory, autoPlace, replace, element, doneEventNameRef)
}
if (taskInfo.topic === "device_repository" && !doneEvent){
if (taskInfo.topic === "device_repository" && !doneEvent && !usesWaitParam("device_repository")){
createIntermediateCatchMessageEvent(bpmnFactory, elementFactory, autoPlace, replace, element, doneEventNameRef)
}

Expand Down

0 comments on commit 30a10b1

Please sign in to comment.