mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-12 04:37:44 +02:00
Create card process (#9522)
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
import { Card, MasterTag, Tag } from '@hcengineering/card'
|
||||
import { Class, Doc, DocumentUpdate, ObjQueryType, Ref, Tx, Type } from '@hcengineering/core'
|
||||
import { Association, Class, Doc, DocumentUpdate, ObjQueryType, Ref, Tx, Type } from '@hcengineering/core'
|
||||
import { Asset, IntlString, Plugin, plugin, Resource } from '@hcengineering/platform'
|
||||
import { ToDo } from '@hcengineering/time'
|
||||
import { AnyComponent } from '@hcengineering/ui'
|
||||
@@ -116,7 +116,8 @@ export interface ProcessToDo extends ToDo {
|
||||
|
||||
export type MethodParams<T extends Doc> = {
|
||||
[P in keyof T]?: ObjQueryType<T[P]> | string
|
||||
} & DocumentUpdate<T>
|
||||
} & DocumentUpdate<T> &
|
||||
Record<string, any>
|
||||
|
||||
export interface State extends Doc {
|
||||
process: Ref<Process>
|
||||
@@ -127,12 +128,17 @@ export type StepId = string & { __stepId: true }
|
||||
|
||||
export interface Step<T extends Doc> {
|
||||
_id: StepId
|
||||
contextId: ContextId | null
|
||||
context: StepContext | null
|
||||
methodId: Ref<Method<T>>
|
||||
params: MethodParams<T>
|
||||
result?: StepResult
|
||||
}
|
||||
|
||||
export interface StepContext {
|
||||
_id: ContextId // context id
|
||||
_class?: Ref<Class<Doc>> // class of the context
|
||||
}
|
||||
|
||||
export interface StepResult {
|
||||
_id: ContextId // context id
|
||||
name: string
|
||||
@@ -177,7 +183,9 @@ export default plugin(processId, {
|
||||
method: {
|
||||
RunSubProcess: '' as Ref<Method<Process>>,
|
||||
CreateToDo: '' as Ref<Method<ProcessToDo>>,
|
||||
UpdateCard: '' as Ref<Method<Card>>
|
||||
UpdateCard: '' as Ref<Method<Card>>,
|
||||
CreateCard: '' as Ref<Method<Card>>,
|
||||
AddRelation: '' as Ref<Method<Association>>
|
||||
},
|
||||
trigger: {
|
||||
OnSubProcessesDone: '' as Ref<Trigger>,
|
||||
@@ -211,7 +219,8 @@ export default plugin(processId, {
|
||||
UserRequestedValueNotProvided: '' as IntlString,
|
||||
ResultNotProvided: '' as IntlString,
|
||||
EmptyFunctionResult: '' as IntlString,
|
||||
ContextValueNotProvided: '' as IntlString
|
||||
ContextValueNotProvided: '' as IntlString,
|
||||
RequiredParamsNotProvided: '' as IntlString
|
||||
},
|
||||
icon: {
|
||||
Process: '' as Asset,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Class, Doc, type AnyAttribute, type Association, type Ref } from '@hcengineering/core'
|
||||
import { ContextId, ProcessFunction } from '.'
|
||||
import { ContextId, ProcessContext, ProcessFunction } from '.'
|
||||
|
||||
export interface Context {
|
||||
functions: Ref<ProcessFunction>[]
|
||||
attributes: AnyAttribute[]
|
||||
nested: Record<string, NestedContext>
|
||||
relations: Record<string, RelatedContext>
|
||||
executionContext: Record<ContextId, ProcessContext>
|
||||
}
|
||||
|
||||
export interface NestedContext {
|
||||
|
||||
Reference in New Issue
Block a user