diff --git a/models/process/src/index.ts b/models/process/src/index.ts index c64ea6b144..faabdfad98 100644 --- a/models/process/src/index.ts +++ b/models/process/src/index.ts @@ -671,7 +671,8 @@ export function createModel (builder: Builder): void { of: core.class.ArrOf, category: 'array', label: process.string.Insert, - editor: process.transformEditor.ArrayElementEditor, + allowMany: true, + editor: process.transformEditor.MultiArrayElementEditor, type: 'transform' }, process.function.Insert @@ -684,6 +685,7 @@ export function createModel (builder: Builder): void { of: core.class.ArrOf, category: 'array', label: process.string.Remove, + allowMany: true, editor: process.transformEditor.ArrayElementEditor, type: 'transform' }, @@ -697,6 +699,7 @@ export function createModel (builder: Builder): void { of: core.class.ArrOf, category: 'array', label: process.string.RemoveFirst, + allowMany: true, type: 'transform' }, process.function.RemoveFirst @@ -709,18 +712,7 @@ export function createModel (builder: Builder): void { of: core.class.ArrOf, category: 'array', label: process.string.RemoveLast, - type: 'transform' - }, - process.function.RemoveLast - ) - - builder.createDoc( - process.class.ProcessFunction, - core.space.Model, - { - of: core.class.ArrOf, - category: 'array', - label: process.string.RemoveLast, + allowMany: true, type: 'transform' }, process.function.RemoveLast @@ -739,6 +731,42 @@ export function createModel (builder: Builder): void { process.function.RoleContext ) + builder.createDoc( + process.class.ProcessFunction, + core.space.Model, + { + of: contact.class.Person, + category: 'attribute', + label: process.string.CurrentUser, + type: 'context' + }, + process.function.CurrentUser + ) + + builder.createDoc( + process.class.ProcessFunction, + core.space.Model, + { + of: contact.mixin.Employee, + category: 'attribute', + label: process.string.CurrentUser, + type: 'context' + }, + process.function.CurrentEmployee + ) + + builder.createDoc( + process.class.ProcessFunction, + core.space.Model, + { + of: core.class.TypeDate, + category: 'attribute', + label: process.string.CurrentDate, + type: 'context' + }, + process.function.CurrentDate + ) + builder.mixin(process.class.Process, core.class.Class, view.mixin.AttributePresenter, { presenter: process.component.ProcessPresenter }) diff --git a/models/server-process/src/index.ts b/models/server-process/src/index.ts index aadf2c068e..f3b6255dcf 100644 --- a/models/server-process/src/index.ts +++ b/models/server-process/src/index.ts @@ -195,6 +195,18 @@ export function createModel (builder: Builder): void { func: serverProcess.transform.RoleContext }) + builder.mixin(process.function.CurrentDate, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, { + func: serverProcess.transform.CurrentDate + }) + + builder.mixin(process.function.CurrentEmployee, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, { + func: serverProcess.transform.CurrentUser + }) + + builder.mixin(process.function.CurrentUser, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, { + func: serverProcess.transform.CurrentUser + }) + builder.mixin(process.function.Insert, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, { func: serverProcess.transform.Insert }) diff --git a/plugins/process-assets/lang/cs.json b/plugins/process-assets/lang/cs.json index 55d330f4d6..f0a39d5a11 100644 --- a/plugins/process-assets/lang/cs.json +++ b/plugins/process-assets/lang/cs.json @@ -97,7 +97,9 @@ "RemoveFirst": "Odstranit první", "RemoveLast": "Odstranit poslední", "Cancelled": "Zrušeno", - "WaitUntil": "Čekat do" + "WaitUntil": "Čekat do", + "CurrentUser": "Aktuální uživatel", + "CurrentDate": "Aktuální datum" }, "error": { "MethodNotFound": "Metoda nenalezena: {methodId}", diff --git a/plugins/process-assets/lang/de.json b/plugins/process-assets/lang/de.json index d78aa8787e..74eb3f41b3 100644 --- a/plugins/process-assets/lang/de.json +++ b/plugins/process-assets/lang/de.json @@ -97,7 +97,9 @@ "RemoveFirst": "Erstes entfernen", "RemoveLast": "Letztes entfernen", "Cancelled": "Abgebrochen", - "WaitUntil": "Warten bis" + "WaitUntil": "Warten bis", + "CurrentUser": "Aktueller Benutzer", + "CurrentDate": "Aktuelles Datum" }, "error": { "MethodNotFound": "Methode nicht gefunden: {methodId}", diff --git a/plugins/process-assets/lang/en.json b/plugins/process-assets/lang/en.json index 2a13cf81b4..5e55d3b07c 100644 --- a/plugins/process-assets/lang/en.json +++ b/plugins/process-assets/lang/en.json @@ -102,7 +102,9 @@ "RemoveFirst": "Remove first", "RemoveLast": "Remove last", "Cancelled": "Cancelled", - "WaitUntil": "Wait until" + "WaitUntil": "Wait until", + "CurrentUser": "Current user", + "CurrentDate": "Current date" }, "error": { "MethodNotFound": "Method not found: {methodId}", diff --git a/plugins/process-assets/lang/es.json b/plugins/process-assets/lang/es.json index d81f089e5f..7a9e9c5185 100644 --- a/plugins/process-assets/lang/es.json +++ b/plugins/process-assets/lang/es.json @@ -102,7 +102,9 @@ "ArraySizeLt": "Tamaño menor que", "ArraySizeLte": "Tamaño menor o igual que", "Cancelled": "Cancelado", - "WaitUntil": "Esperar hasta" + "WaitUntil": "Esperar hasta", + "CurrentUser": "Usuario Actual", + "CurrentDate": "Fecha Actual" }, "error": { "MethodNotFound": "Método no encontrado: {methodId}", diff --git a/plugins/process-assets/lang/fr.json b/plugins/process-assets/lang/fr.json index bd09e4b029..92289e4f3a 100644 --- a/plugins/process-assets/lang/fr.json +++ b/plugins/process-assets/lang/fr.json @@ -102,7 +102,9 @@ "ArraySizeLt": "Taille inférieure à", "ArraySizeLte": "Taille inférieure ou égale à", "Cancelled": "Annulé", - "WaitUntil": "Attendre jusqu'à" + "WaitUntil": "Attendre jusqu'à", + "CurrentUser": "Utilisateur actuel", + "CurrentDate": "Date actuelle" }, "error": { "MethodNotFound": "Méthode introuvable : {methodId}", diff --git a/plugins/process-assets/lang/it.json b/plugins/process-assets/lang/it.json index 3f1d857a52..7556c1a5d7 100644 --- a/plugins/process-assets/lang/it.json +++ b/plugins/process-assets/lang/it.json @@ -102,7 +102,9 @@ "ArraySizeLt": "Dimensione minore di", "ArraySizeLte": "Dimensione minore o uguale a", "Cancelled": "Annullato", - "WaitUntil": "Aspetta fino a" + "WaitUntil": "Aspetta fino a", + "CurrentUser": "Utente corrente", + "CurrentDate": "Data corrente" }, "error": { "MethodNotFound": "Metodo non trovato: {methodId}", diff --git a/plugins/process-assets/lang/ja.json b/plugins/process-assets/lang/ja.json index 7922176b11..149d7c162c 100644 --- a/plugins/process-assets/lang/ja.json +++ b/plugins/process-assets/lang/ja.json @@ -101,7 +101,9 @@ "ArraySizeLt": "サイズがより小さい", "ArraySizeLte": "サイズが以下", "Cancelled": "キャンセル済み", - "WaitUntil": "待機する" + "WaitUntil": "待機する", + "CurrentUser": "現在のユーザー", + "CurrentDate": "現在の日付" }, "error": { "MethodNotFound": "メソッドが見つかりません: {methodId}", diff --git a/plugins/process-assets/lang/pt.json b/plugins/process-assets/lang/pt.json index 722686ef19..7e2c9a3b85 100644 --- a/plugins/process-assets/lang/pt.json +++ b/plugins/process-assets/lang/pt.json @@ -102,7 +102,9 @@ "ArraySizeLt": "Tamanho menor que", "ArraySizeLte": "Tamanho menor ou igual a", "Cancelled": "Cancelado", - "WaitUntil": "Aguardar até" + "WaitUntil": "Aguardar até", + "CurrentUser": "Usuário Atual", + "CurrentDate": "Data Atual" }, "error": { "MethodNotFound": "Método não encontrado: {methodId}", diff --git a/plugins/process-assets/lang/ru.json b/plugins/process-assets/lang/ru.json index 66d2ecf063..5129a0d363 100644 --- a/plugins/process-assets/lang/ru.json +++ b/plugins/process-assets/lang/ru.json @@ -102,7 +102,9 @@ "ArraySizeLt": "Количество меньше", "ArraySizeLte": "Количество меньше или равно", "Cancelled": "Отменено", - "WaitUntil": "Ждать до" + "WaitUntil": "Ждать до", + "CurrentUser": "Текущий пользователь", + "CurrentDate": "Текущая дата" }, "error": { "MethodNotFound": "Метод не найден: {methodId}", diff --git a/plugins/process-assets/lang/zh.json b/plugins/process-assets/lang/zh.json index fe9bca2053..296ad28b3d 100644 --- a/plugins/process-assets/lang/zh.json +++ b/plugins/process-assets/lang/zh.json @@ -102,7 +102,9 @@ "ArraySizeLt": "大小小于", "ArraySizeLte": "大小小于等于", "Cancelled": "已取消", - "WaitUntil": "等待直到" + "WaitUntil": "等待直到", + "CurrentUser": "当前用户", + "CurrentDate": "当前日期" }, "error": { "MethodNotFound": "找不到方法:{methodId}", diff --git a/plugins/process-resources/src/components/attributeEditors/ConfigurePopup.svelte b/plugins/process-resources/src/components/attributeEditors/ConfigurePopup.svelte index 7c7d2c5e52..ba32b1367a 100644 --- a/plugins/process-resources/src/components/attributeEditors/ConfigurePopup.svelte +++ b/plugins/process-resources/src/components/attributeEditors/ConfigurePopup.svelte @@ -187,13 +187,14 @@ onChange(contextValue) } - function onConfigure (e: MouseEvent, func: ProcessFunction, pos: number): void { - if (contextValue.functions === undefined || func.editor === undefined) return + function onConfigure (e: MouseEvent, func: Func, pos: number): void { + const f = getFunction(func.func) + if (contextValue.functions === undefined || f.editor === undefined) return const val = contextValue.functions[pos] showPopup( - func.editor, + f.editor, { - func, + func: f, masterTag: process.masterTag, process, context, @@ -224,6 +225,10 @@ } onChange(contextValue) } + + function getFunction (_id: Ref): ProcessFunction { + return client.getModel().findAllSync(plugin.class.ProcessFunction, { _id })[0] + }
dispatch('changeContent')}> @@ -246,11 +251,13 @@ options={{ component: plugin.component.FunctionSelector }} withHover /> -