Empty array process function (#9977)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2025-09-30 21:05:59 +07:00
committed by GitHub
parent 80886e8201
commit 5fa0bb3c64
17 changed files with 147 additions and 13 deletions
@@ -375,4 +375,29 @@ export async function CurrentDate (): Promise<Timestamp> {
return Date.now()
}
export function EmptyArray (): any[] {
return []
}
export async function ExecutionInitiator (
value: null,
props: Record<string, any>,
control: ProcessControl,
execution: Execution
): Promise<Ref<Person> | undefined> {
const socialId = await control.client.findOne(contact.class.SocialIdentity, {
_id: (execution.createdBy ?? execution.modifiedBy) as any
})
return socialId?.attachedTo
}
export async function ExecutionStarted (
value: null,
props: Record<string, any>,
control: ProcessControl,
execution: Execution
): Promise<Timestamp> {
return execution.createdOn ?? execution.modifiedOn
}
// #endregion
+4 -1
View File
@@ -94,7 +94,10 @@ export default plugin(serverProcessId, {
RemoveFirst: '' as Resource<TransformFunc>,
RemoveLast: '' as Resource<TransformFunc>,
CurrentUser: '' as Resource<TransformFunc>,
CurrentDate: '' as Resource<TransformFunc>
CurrentDate: '' as Resource<TransformFunc>,
EmptyArray: '' as Resource<TransformFunc>,
ExecutionInitiator: '' as Resource<TransformFunc>,
ExecutionStarted: '' as Resource<TransformFunc>
},
trigger: {
OnTransition: '' as Resource<TriggerFunc>,