mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 21:15:06 +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
|
||||
|
||||
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user