mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-07 18:27:44 +02:00
Empty array process function (#9977)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user