@things-factory/worklist 5.0.2 → 5.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/{bootstrap.js → bootstrap.ts} +0 -0
- package/client/components/{activity-intro-view.js → activity-intro-view.ts} +29 -41
- package/client/{index.js → index.ts} +0 -0
- package/client/pages/activity/activity-list-page.js +2 -2
- package/client/pages/activity/activity-page.js +1 -1
- package/client/pages/activity/starter-list-page.js +1 -1
- package/client/pages/activity-instance/activity-instance-list-page.js +1 -1
- package/client/pages/activity-instance/activity-instance-page.js +1 -1
- package/client/pages/activity-store/activity-store-page.js +1 -1
- package/client/pages/activity-supervisor/reporter-list-page.js +1 -1
- package/client/pages/activity-template/activity-template-list-page.js +1 -1
- package/client/pages/activity-thread/activity-thread-list-page.js +1 -1
- package/client/pages/activity-thread/activity-thread-page.js +1 -1
- package/client/pages/todo/assigned-list-page.js +1 -1
- package/client/pages/todo/draft-list-page.js +2 -2
- package/client/pages/todo/pickable-list-page.js +2 -2
- package/client/pages/todo/todo-list-page.js +2 -2
- package/client/{route.js → route.ts} +1 -1
- package/client/tsconfig.json +11 -0
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +12 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/components/activity-/bowner-view.d.ts +1 -0
- package/dist-client/components/activity-/bowner-view.js +97 -0
- package/dist-client/components/activity-/bowner-view.js.map +1 -0
- package/dist-client/components/activity-instance-preview.d.ts +1 -0
- package/dist-client/components/activity-instance-preview.js +181 -0
- package/dist-client/components/activity-instance-preview.js.map +1 -0
- package/dist-client/components/activity-intro-view.d.ts +2 -0
- package/dist-client/components/activity-intro-view.js +105 -0
- package/dist-client/components/activity-intro-view.js.map +1 -0
- package/dist-client/components/activity-reporter-view.d.ts +1 -0
- package/dist-client/components/activity-reporter-view.js +97 -0
- package/dist-client/components/activity-reporter-view.js.map +1 -0
- package/dist-client/components/activity-starter-form.d.ts +1 -0
- package/dist-client/components/activity-starter-form.js +294 -0
- package/dist-client/components/activity-starter-form.js.map +1 -0
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/activity/activity-list-page.d.ts +297 -0
- package/dist-client/pages/activity/activity-list-page.js +468 -0
- package/dist-client/pages/activity/activity-list-page.js.map +1 -0
- package/dist-client/pages/activity/activity-model-item-list.d.ts +169 -0
- package/dist-client/pages/activity/activity-model-item-list.js +285 -0
- package/dist-client/pages/activity/activity-model-item-list.js.map +1 -0
- package/dist-client/pages/activity/activity-page.d.ts +49 -0
- package/dist-client/pages/activity/activity-page.js +368 -0
- package/dist-client/pages/activity/activity-page.js.map +1 -0
- package/dist-client/pages/activity/starter-list-page.d.ts +143 -0
- package/dist-client/pages/activity/starter-list-page.js +209 -0
- package/dist-client/pages/activity/starter-list-page.js.map +1 -0
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +137 -0
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +202 -0
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -0
- package/dist-client/pages/activity-instance/activity-instance-page.d.ts +49 -0
- package/dist-client/pages/activity-instance/activity-instance-page.js +365 -0
- package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -0
- package/dist-client/pages/activity-store/activity-store-page.d.ts +174 -0
- package/dist-client/pages/activity-store/activity-store-page.js +211 -0
- package/dist-client/pages/activity-store/activity-store-page.js.map +1 -0
- package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +143 -0
- package/dist-client/pages/activity-supervisor/reporter-list-page.js +209 -0
- package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -0
- package/dist-client/pages/activity-template/activity-template-importer.d.ts +24 -0
- package/dist-client/pages/activity-template/activity-template-importer.js +98 -0
- package/dist-client/pages/activity-template/activity-template-importer.js.map +1 -0
- package/dist-client/pages/activity-template/activity-template-list-page.d.ts +263 -0
- package/dist-client/pages/activity-template/activity-template-list-page.js +402 -0
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -0
- package/dist-client/pages/activity-template/activity-template-model-item-list.d.ts +1 -0
- package/dist-client/pages/activity-template/activity-template-model-item-list.js +36 -0
- package/dist-client/pages/activity-template/activity-template-model-item-list.js.map +1 -0
- package/dist-client/pages/activity-thread/activity-thread-importer.d.ts +24 -0
- package/dist-client/pages/activity-thread/activity-thread-importer.js +98 -0
- package/dist-client/pages/activity-thread/activity-thread-importer.js.map +1 -0
- package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +145 -0
- package/dist-client/pages/activity-thread/activity-thread-list-page.js +284 -0
- package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -0
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +46 -0
- package/dist-client/pages/activity-thread/activity-thread-page.js +331 -0
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -0
- package/dist-client/pages/dashboard/dashboard-home.d.ts +1 -0
- package/dist-client/pages/dashboard/dashboard-home.js +17 -0
- package/dist-client/pages/dashboard/dashboard-home.js.map +1 -0
- package/dist-client/pages/todo/assigned-list-page.d.ts +124 -0
- package/dist-client/pages/todo/assigned-list-page.js +233 -0
- package/dist-client/pages/todo/assigned-list-page.js.map +1 -0
- package/dist-client/pages/todo/draft-list-page.d.ts +198 -0
- package/dist-client/pages/todo/draft-list-page.js +310 -0
- package/dist-client/pages/todo/draft-list-page.js.map +1 -0
- package/dist-client/pages/todo/pickable-list-page.d.ts +150 -0
- package/dist-client/pages/todo/pickable-list-page.js +260 -0
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -0
- package/dist-client/pages/todo/todo-list-page.d.ts +232 -0
- package/dist-client/pages/todo/todo-list-page.js +333 -0
- package/dist-client/pages/todo/todo-list-page.js.map +1 -0
- package/dist-client/pages/worklist-home.d.ts +1 -0
- package/dist-client/pages/worklist-home.js +17 -0
- package/dist-client/pages/worklist-home.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +53 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/types.d.ts +19 -0
- package/dist-client/types.js +37 -0
- package/dist-client/types.js.map +1 -0
- package/dist-server/controllers/activity-extension-controller.js.map +1 -1
- package/dist-server/controllers/activity-instance/abort.js +0 -2
- package/dist-server/controllers/activity-instance/abort.js.map +1 -1
- package/dist-server/controllers/activity-instance/adjust.js.map +1 -1
- package/dist-server/controllers/activity-instance/assign.js +2 -4
- package/dist-server/controllers/activity-instance/assign.js.map +1 -1
- package/dist-server/controllers/activity-instance/delegate.js +0 -2
- package/dist-server/controllers/activity-instance/delegate.js.map +1 -1
- package/dist-server/controllers/activity-instance/draft.js +0 -2
- package/dist-server/controllers/activity-instance/draft.js.map +1 -1
- package/dist-server/controllers/activity-instance/end.js +0 -2
- package/dist-server/controllers/activity-instance/end.js.map +1 -1
- package/dist-server/controllers/activity-instance/index.js +11 -24
- package/dist-server/controllers/activity-instance/index.js.map +1 -1
- package/dist-server/controllers/activity-instance/pick.js +0 -2
- package/dist-server/controllers/activity-instance/pick.js.map +1 -1
- package/dist-server/controllers/activity-instance/post.js +0 -2
- package/dist-server/controllers/activity-instance/post.js.map +1 -1
- package/dist-server/controllers/activity-instance/start.js.map +1 -1
- package/dist-server/controllers/activity-instance/terminate.js +0 -2
- package/dist-server/controllers/activity-instance/terminate.js.map +1 -1
- package/dist-server/controllers/activity-thread/abort.js +0 -2
- package/dist-server/controllers/activity-thread/abort.js.map +1 -1
- package/dist-server/controllers/activity-thread/adjust.js.map +1 -1
- package/dist-server/controllers/activity-thread/delegate.js +0 -2
- package/dist-server/controllers/activity-thread/delegate.js.map +1 -1
- package/dist-server/controllers/activity-thread/end.js +0 -2
- package/dist-server/controllers/activity-thread/end.js.map +1 -1
- package/dist-server/controllers/activity-thread/index.js +8 -21
- package/dist-server/controllers/activity-thread/index.js.map +1 -1
- package/dist-server/controllers/activity-thread/save.js.map +1 -1
- package/dist-server/controllers/activity-thread/start.js +0 -2
- package/dist-server/controllers/activity-thread/start.js.map +1 -1
- package/dist-server/controllers/activity-thread/terminate.js +0 -2
- package/dist-server/controllers/activity-thread/terminate.js.map +1 -1
- package/dist-server/controllers/common.js.map +1 -1
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +4 -17
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/routes.js +0 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/activity/activity-history.js +68 -76
- package/dist-server/service/activity/activity-history.js.map +1 -1
- package/dist-server/service/activity/activity-model-type.js +51 -60
- package/dist-server/service/activity/activity-model-type.js.map +1 -1
- package/dist-server/service/activity/activity-mutation.js +39 -50
- package/dist-server/service/activity/activity-mutation.js.map +1 -1
- package/dist-server/service/activity/activity-query.js +61 -72
- package/dist-server/service/activity/activity-query.js.map +1 -1
- package/dist-server/service/activity/activity-type.js +91 -102
- package/dist-server/service/activity/activity-type.js.map +1 -1
- package/dist-server/service/activity/activity.js +68 -76
- package/dist-server/service/activity/activity.js.map +1 -1
- package/dist-server/service/activity/event-subscriber.js +2 -7
- package/dist-server/service/activity/event-subscriber.js.map +1 -1
- package/dist-server/service/activity/index.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-history.js +81 -89
- package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-mutation.js +62 -74
- package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-query.js +67 -78
- package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-subscription.js +8 -21
- package/dist-server/service/activity-instance/activity-instance-subscription.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-type.js +97 -105
- package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance.js +85 -93
- package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
- package/dist-server/service/activity-instance/event-subscriber.js +3 -8
- package/dist-server/service/activity-instance/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-instance/index.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-history.js +50 -58
- package/dist-server/service/activity-template/activity-template-history.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-mutation.js +39 -50
- package/dist-server/service/activity-template/activity-template-mutation.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-query.js +34 -45
- package/dist-server/service/activity-template/activity-template-query.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-type.js +65 -76
- package/dist-server/service/activity-template/activity-template-type.js.map +1 -1
- package/dist-server/service/activity-template/activity-template.js +48 -56
- package/dist-server/service/activity-template/activity-template.js.map +1 -1
- package/dist-server/service/activity-template/event-subscriber.js +2 -7
- package/dist-server/service/activity-template/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-template/index.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-mutation.js +79 -90
- package/dist-server/service/activity-thread/activity-thread-mutation.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-query.js +45 -56
- package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-subscription.js +7 -20
- package/dist-server/service/activity-thread/activity-thread-subscription.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-type.js +25 -34
- package/dist-server/service/activity-thread/activity-thread-type.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread.js +43 -51
- package/dist-server/service/activity-thread/activity-thread.js.map +1 -1
- package/dist-server/service/activity-thread/event-subscriber.js +2 -7
- package/dist-server/service/activity-thread/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-thread/index.js.map +1 -1
- package/dist-server/service/index.js +5 -18
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +13 -11
- package/server/controllers/activity-instance/abort.ts +0 -4
- package/server/controllers/activity-instance/assign.ts +2 -6
- package/server/controllers/activity-instance/delegate.ts +0 -4
- package/server/controllers/activity-instance/draft.ts +0 -4
- package/server/controllers/activity-instance/end.ts +0 -4
- package/server/controllers/activity-instance/pick.ts +0 -4
- package/server/controllers/activity-instance/post.ts +0 -4
- package/server/controllers/activity-instance/terminate.ts +0 -4
- package/server/controllers/activity-thread/abort.ts +0 -4
- package/server/controllers/activity-thread/delegate.ts +0 -4
- package/server/controllers/activity-thread/end.ts +0 -4
- package/server/controllers/activity-thread/start.ts +0 -4
- package/server/controllers/activity-thread/terminate.ts +0 -4
- package/server/routes.ts +0 -2
- package/server/service/activity/activity-model-type.ts +4 -4
- package/server/service/activity-instance/activity-instance-history.ts +2 -2
- package/server/service/activity-instance/activity-instance-mutation.ts +1 -3
- package/server/service/activity-instance/activity-instance-subscription.ts +1 -5
- package/server/service/activity-instance/activity-instance-type.ts +7 -7
- package/server/service/activity-instance/activity-instance.ts +2 -2
- package/server/service/activity-thread/activity-thread-mutation.ts +2 -2
- package/server/service/activity-thread/activity-thread-subscription.ts +0 -4
- package/server/service/activity-thread/activity-thread-type.ts +1 -1
- package/server/service/activity-thread/activity-thread.ts +1 -1
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +2 -2
- package/dist-server/controllers/activity-instance/common.js +0 -30
- package/dist-server/controllers/activity-instance/common.js.map +0 -1
- package/dist-server/controllers/activity-instance/create.js +0 -103
- package/dist-server/controllers/activity-instance/create.js.map +0 -1
- package/dist-server/controllers/activity-instance/save.js +0 -14
- package/dist-server/controllers/activity-instance/save.js.map +0 -1
- package/dist-server/controllers/activity-instance/take.js +0 -46
- package/dist-server/controllers/activity-instance/take.js.map +0 -1
- package/tsconfig.json +0 -9
|
@@ -5,16 +5,12 @@ import { NewActivityInstance } from '../../service/activity-instance/activity-in
|
|
|
5
5
|
import { Activity } from '../../service/activity/activity'
|
|
6
6
|
import { type ContextStatus } from '../common'
|
|
7
7
|
|
|
8
|
-
const debug = require('debug')('things-factory:worklist:create')
|
|
9
|
-
|
|
10
8
|
export async function draft(
|
|
11
9
|
activityInstance: NewActivityInstance,
|
|
12
10
|
{ domain, user, tx, t }: ContextStatus
|
|
13
11
|
): Promise<ActivityInstance> {
|
|
14
12
|
const { activityId, input, dueAt } = activityInstance
|
|
15
13
|
|
|
16
|
-
debug('draftActivityInstance', activityId, input)
|
|
17
|
-
|
|
18
14
|
var repository = getRepository(Activity)
|
|
19
15
|
var activity = {} as any
|
|
20
16
|
|
|
@@ -3,14 +3,10 @@ import { getRepository } from 'typeorm'
|
|
|
3
3
|
import { ActivityInstance } from '../../service/activity-instance/activity-instance'
|
|
4
4
|
import { type ContextStatus, evalActivityInstanceState } from '../common'
|
|
5
5
|
|
|
6
|
-
const debug = require('debug')('things-factory:worklist:end')
|
|
7
|
-
|
|
8
6
|
export async function end(
|
|
9
7
|
{ id, output, reason }: { id: string; output?: object; reason?: string },
|
|
10
8
|
{ domain, user, tx, t }: ContextStatus
|
|
11
9
|
): Promise<ActivityInstance> {
|
|
12
|
-
debug('end', id, output)
|
|
13
|
-
|
|
14
10
|
var repository = getRepository(ActivityInstance)
|
|
15
11
|
|
|
16
12
|
var activityInstance = await repository.findOne({
|
|
@@ -4,11 +4,7 @@ import { ActivityInstance } from '../../service/activity-instance/activity-insta
|
|
|
4
4
|
import { ActivityThread } from '../../service/activity-thread/activity-thread'
|
|
5
5
|
import { type ContextStatus, createActivityThreadsForUsers } from '../common'
|
|
6
6
|
|
|
7
|
-
const debug = require('debug')('things-factory:worklist:pick')
|
|
8
|
-
|
|
9
7
|
export async function pick(id: string, { domain, user, tx, t }: ContextStatus): Promise<ActivityThread> {
|
|
10
|
-
debug('pickActivityInstance', id)
|
|
11
|
-
|
|
12
8
|
var repository = getRepository(ActivityInstance)
|
|
13
9
|
|
|
14
10
|
var activityInstance = await repository.findOne({
|
|
@@ -2,16 +2,12 @@ import { ActivityInstance, ActivityInstanceStatus } from '../../service/activity
|
|
|
2
2
|
import { ActivityInstancePost } from '../../service/activity-instance/activity-instance-type'
|
|
3
3
|
import { type ContextStatus, createActivityThreadsForAllRoleUsers, createActivityThreadsForUsers } from '../common'
|
|
4
4
|
|
|
5
|
-
const debug = require('debug')('things-factory:worklist:create')
|
|
6
|
-
|
|
7
5
|
export async function post(
|
|
8
6
|
activityInstance: ActivityInstancePost,
|
|
9
7
|
{ domain, user, tx, t }: ContextStatus
|
|
10
8
|
): Promise<ActivityInstance> {
|
|
11
9
|
const { id, assignees } = activityInstance
|
|
12
10
|
|
|
13
|
-
debug('postActivityInstance', activityInstance)
|
|
14
|
-
|
|
15
11
|
var origin = id ? await tx.getRepository(ActivityInstance).findOne(id) : null
|
|
16
12
|
|
|
17
13
|
const posted = await tx.getRepository(ActivityInstance).save({
|
|
@@ -3,14 +3,10 @@ import { getRepository } from 'typeorm'
|
|
|
3
3
|
import { ActivityInstance } from '../../service/activity-instance/activity-instance'
|
|
4
4
|
import { type ContextStatus, evalActivityInstanceState } from '../common'
|
|
5
5
|
|
|
6
|
-
const debug = require('debug')('things-factory:worklist:terminate')
|
|
7
|
-
|
|
8
6
|
export async function terminate(
|
|
9
7
|
{ id, output, reason }: { id: string; output?: object; reason?: string },
|
|
10
8
|
{ domain, user, tx, t }: ContextStatus
|
|
11
9
|
): Promise<ActivityInstance> {
|
|
12
|
-
debug('terminate', id, output)
|
|
13
|
-
|
|
14
10
|
var repository = getRepository(ActivityInstance)
|
|
15
11
|
|
|
16
12
|
var activityInstance = await repository.findOne({
|
|
@@ -3,14 +3,10 @@ import { getRepository } from 'typeorm'
|
|
|
3
3
|
import { ActivityThread, ActivityThreadStatus } from '../../service/activity-thread/activity-thread'
|
|
4
4
|
import { type ContextStatus } from '../common'
|
|
5
5
|
|
|
6
|
-
const debug = require('debug')('things-factory:worklist:abort')
|
|
7
|
-
|
|
8
6
|
export async function abort(
|
|
9
7
|
{ id, reason }: { id: string; reason: string },
|
|
10
8
|
{ domain, user, tx, t }: ContextStatus
|
|
11
9
|
): Promise<ActivityThread> {
|
|
12
|
-
debug('abortActivityThread', id, reason)
|
|
13
|
-
|
|
14
10
|
var repository = getRepository(ActivityThread)
|
|
15
11
|
|
|
16
12
|
var activityThread = await repository.findOne({
|
|
@@ -3,8 +3,6 @@ import { getRepository } from 'typeorm'
|
|
|
3
3
|
import { ActivityThread, ActivityThreadStatus } from '../../service/activity-thread/activity-thread'
|
|
4
4
|
import { type ContextStatus } from '../common'
|
|
5
5
|
|
|
6
|
-
const debug = require('debug')('things-factory:worklist:delegate')
|
|
7
|
-
|
|
8
6
|
export async function delegate(
|
|
9
7
|
{
|
|
10
8
|
id,
|
|
@@ -19,8 +17,6 @@ export async function delegate(
|
|
|
19
17
|
},
|
|
20
18
|
{ domain, user, tx, t }: ContextStatus
|
|
21
19
|
): Promise<ActivityThread> {
|
|
22
|
-
debug('delegateActivity', id, assigneeRole)
|
|
23
|
-
|
|
24
20
|
var repository = getRepository(ActivityThread)
|
|
25
21
|
|
|
26
22
|
var activityThread = await repository.findOne({
|
|
@@ -3,14 +3,10 @@ import { getRepository } from 'typeorm'
|
|
|
3
3
|
import { ActivityThread, ActivityThreadStatus } from '../../service/activity-thread/activity-thread'
|
|
4
4
|
import { type ContextStatus } from '../common'
|
|
5
5
|
|
|
6
|
-
const debug = require('debug')('things-factory:worklist:end')
|
|
7
|
-
|
|
8
6
|
export async function end(
|
|
9
7
|
{ id, output, reason }: { id: string; output?: object; reason?: string },
|
|
10
8
|
{ domain, user, tx, t }: ContextStatus
|
|
11
9
|
): Promise<ActivityThread> {
|
|
12
|
-
debug('end', id, output)
|
|
13
|
-
|
|
14
10
|
var repository = getRepository(ActivityThread)
|
|
15
11
|
|
|
16
12
|
var activityThread = await repository.findOne({
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { ActivityThread, ActivityThreadStatus } from '../../service/activity-thread/activity-thread'
|
|
2
2
|
import { type ContextStatus } from '../common'
|
|
3
3
|
|
|
4
|
-
const debug = require('debug')('things-factory:worklist:start')
|
|
5
|
-
|
|
6
4
|
export async function start(
|
|
7
5
|
id: string,
|
|
8
6
|
output: object,
|
|
9
7
|
reason: string,
|
|
10
8
|
{ domain, user, tx, t }: ContextStatus
|
|
11
9
|
): Promise<ActivityThread> {
|
|
12
|
-
debug('startActivityThread', id)
|
|
13
|
-
|
|
14
10
|
const repository = tx.getRepository(ActivityThread)
|
|
15
11
|
const activityThread = await repository.findOne({
|
|
16
12
|
where: { domain, id }
|
|
@@ -3,14 +3,10 @@ import { getRepository } from 'typeorm'
|
|
|
3
3
|
import { ActivityThread, ActivityThreadStatus } from '../../service/activity-thread/activity-thread'
|
|
4
4
|
import { type ContextStatus } from '../common'
|
|
5
5
|
|
|
6
|
-
const debug = require('debug')('things-factory:worklist:terminate')
|
|
7
|
-
|
|
8
6
|
export async function terminate(
|
|
9
7
|
{ id, output, reason }: { id: string; output?: object; reason?: string },
|
|
10
8
|
{ domain, user, tx, t }: ContextStatus
|
|
11
9
|
): Promise<ActivityThread> {
|
|
12
|
-
debug('terminate', id, output)
|
|
13
|
-
|
|
14
10
|
var repository = getRepository(ActivityThread)
|
|
15
11
|
|
|
16
12
|
var activityThread = await repository.findOne({
|
package/server/routes.ts
CHANGED
|
@@ -54,7 +54,7 @@ export class ActivityModelItem {
|
|
|
54
54
|
type?: ActivityModelItemType
|
|
55
55
|
|
|
56
56
|
@Field(type => ScalarObject, { nullable: true })
|
|
57
|
-
options?:
|
|
57
|
+
options?: { [option: string]: any }
|
|
58
58
|
|
|
59
59
|
@Field({ nullable: true })
|
|
60
60
|
unit?: string
|
|
@@ -63,7 +63,7 @@ export class ActivityModelItem {
|
|
|
63
63
|
quantifier: number[]
|
|
64
64
|
|
|
65
65
|
@Field(type => ScalarObject, { nullable: true })
|
|
66
|
-
spec?:
|
|
66
|
+
spec?: { [key: string]: any }
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
@InputType()
|
|
@@ -84,7 +84,7 @@ export class ActivityModelItemPatch {
|
|
|
84
84
|
type?: ActivityModelItemType
|
|
85
85
|
|
|
86
86
|
@Field(type => ScalarObject, { nullable: true })
|
|
87
|
-
options?:
|
|
87
|
+
options?: { [option: string]: any }
|
|
88
88
|
|
|
89
89
|
@Field({ nullable: true })
|
|
90
90
|
unit?: string
|
|
@@ -102,5 +102,5 @@ export class ActivityModelItemPatch {
|
|
|
102
102
|
hidden?: boolean
|
|
103
103
|
|
|
104
104
|
@Field(type => ScalarObject, { nullable: true })
|
|
105
|
-
spec?:
|
|
105
|
+
spec?: { [key: string]: any }
|
|
106
106
|
}
|
|
@@ -101,11 +101,11 @@ export class ActivityInstanceHistory implements HistoryEntityInterface<ActivityI
|
|
|
101
101
|
|
|
102
102
|
@Column('simple-json', { nullable: true })
|
|
103
103
|
@Field(type => ScalarObject, { nullable: true })
|
|
104
|
-
input?:
|
|
104
|
+
input?: { [key: string]: any }
|
|
105
105
|
|
|
106
106
|
@Column('simple-json', { nullable: true })
|
|
107
107
|
@Field(type => ScalarObject, { nullable: true })
|
|
108
|
-
output?:
|
|
108
|
+
output?: { [key: string]: any }
|
|
109
109
|
|
|
110
110
|
@Column({ nullable: true })
|
|
111
111
|
@Field({ nullable: true })
|
|
@@ -7,8 +7,6 @@ import { ActivityThread } from '../activity-thread/activity-thread'
|
|
|
7
7
|
import { ActivityInstance } from './activity-instance'
|
|
8
8
|
import { ActivityInstancePatch, ActivityInstancePost, NewActivityInstance } from './activity-instance-type'
|
|
9
9
|
|
|
10
|
-
const debug = require('debug')('things-factory:worklist:activity-instance-mutation')
|
|
11
|
-
|
|
12
10
|
@Resolver(ActivityInstance)
|
|
13
11
|
export class ActivityInstanceMutation {
|
|
14
12
|
@Directive('@transaction')
|
|
@@ -87,7 +85,7 @@ export class ActivityInstanceMutation {
|
|
|
87
85
|
@Mutation(returns => ActivityInstance, { description: 'To end a ActivityInstance' })
|
|
88
86
|
async endActivityInstance(
|
|
89
87
|
@Arg('id') id: string,
|
|
90
|
-
@Arg('output', type => ScalarObject, { nullable: true }) output:
|
|
88
|
+
@Arg('output', type => ScalarObject, { nullable: true }) output: { [key: string]: any },
|
|
91
89
|
@Arg('reason', { nullable: true }) reason: string,
|
|
92
90
|
@Ctx() context: any
|
|
93
91
|
): Promise<ActivityInstance> {
|
|
@@ -7,8 +7,6 @@ import { pubsub } from '@things-factory/shell'
|
|
|
7
7
|
|
|
8
8
|
import { ActivityInstance } from './activity-instance'
|
|
9
9
|
|
|
10
|
-
const debug = require('debug')('things-factory:worklist:activity-instance-subscription')
|
|
11
|
-
|
|
12
10
|
@Resolver(ActivityInstance)
|
|
13
11
|
export class ActivityInstanceSubscription {
|
|
14
12
|
@Subscription({
|
|
@@ -16,8 +14,6 @@ export class ActivityInstanceSubscription {
|
|
|
16
14
|
const { domain, user } = context.state
|
|
17
15
|
const subdomain = domain?.subdomain
|
|
18
16
|
|
|
19
|
-
debug('subscribe', subdomain)
|
|
20
|
-
|
|
21
17
|
if (!domain) {
|
|
22
18
|
throw new Error('domain required')
|
|
23
19
|
}
|
|
@@ -46,7 +42,7 @@ export class ActivityInstanceSubscription {
|
|
|
46
42
|
relations: ['roles']
|
|
47
43
|
})
|
|
48
44
|
|
|
49
|
-
return userWithRoles.roles.find(role => role.id === activityInstance.assigneeRoleId)
|
|
45
|
+
return !!userWithRoles.roles.find(role => role.id === activityInstance.assigneeRoleId)
|
|
50
46
|
}
|
|
51
47
|
)(_, args, context, info)
|
|
52
48
|
}
|
|
@@ -30,10 +30,10 @@ export class NewActivityInstance {
|
|
|
30
30
|
threadsMax?: number
|
|
31
31
|
|
|
32
32
|
@Field(type => ScalarDate, { nullable: true })
|
|
33
|
-
dueAt?:
|
|
33
|
+
dueAt?: Date
|
|
34
34
|
|
|
35
35
|
@Field(type => ScalarObject, { nullable: true })
|
|
36
|
-
input?:
|
|
36
|
+
input?: { [key: string]: any }
|
|
37
37
|
|
|
38
38
|
@Field({ nullable: true })
|
|
39
39
|
adhocType?: string
|
|
@@ -84,10 +84,10 @@ export class ActivityInstancePost {
|
|
|
84
84
|
threadsMax?: number
|
|
85
85
|
|
|
86
86
|
@Field(type => ScalarDate, { nullable: true })
|
|
87
|
-
dueAt?:
|
|
87
|
+
dueAt?: Date
|
|
88
88
|
|
|
89
89
|
@Field(type => ScalarObject, { nullable: true })
|
|
90
|
-
input?:
|
|
90
|
+
input?: { [key: string]: any }
|
|
91
91
|
|
|
92
92
|
@Field({ nullable: true })
|
|
93
93
|
adhocType?: string
|
|
@@ -117,7 +117,7 @@ export class ActivityInstancePost {
|
|
|
117
117
|
@InputType()
|
|
118
118
|
export class ActivityInstanceSave {
|
|
119
119
|
@Field(type => ScalarObject, { nullable: true })
|
|
120
|
-
output?:
|
|
120
|
+
output?: { [key: string]: any }
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
@InputType()
|
|
@@ -138,10 +138,10 @@ export class ActivityInstancePatch {
|
|
|
138
138
|
state?: ActivityInstanceStatus
|
|
139
139
|
|
|
140
140
|
@Field(type => ScalarDate, { nullable: true })
|
|
141
|
-
dueAt?:
|
|
141
|
+
dueAt?: Date
|
|
142
142
|
|
|
143
143
|
@Field(type => ScalarObject, { nullable: true })
|
|
144
|
-
input?:
|
|
144
|
+
input?: { [key: string]: any }
|
|
145
145
|
|
|
146
146
|
@Field({ nullable: true })
|
|
147
147
|
cuFlag?: string
|
|
@@ -112,11 +112,11 @@ export class ActivityInstance {
|
|
|
112
112
|
|
|
113
113
|
@Column('simple-json', { nullable: true })
|
|
114
114
|
@Field(type => ScalarObject, { nullable: true })
|
|
115
|
-
input?:
|
|
115
|
+
input?: { [key: string]: any }
|
|
116
116
|
|
|
117
117
|
@Column('simple-json', { nullable: true })
|
|
118
118
|
@Field(type => ScalarObject, { nullable: true })
|
|
119
|
-
output?:
|
|
119
|
+
output?: { [key: string]: any }
|
|
120
120
|
|
|
121
121
|
@Column({ nullable: true })
|
|
122
122
|
@Field({ nullable: true })
|
|
@@ -139,7 +139,7 @@ export class ActivityThreadMutation {
|
|
|
139
139
|
@Mutation(returns => ActivityThread!, { nullable: true, description: 'To start ActivityThread information' })
|
|
140
140
|
async startActivityThread(
|
|
141
141
|
@Arg('id') id: string,
|
|
142
|
-
@Arg('output', type => ScalarObject, { nullable: true }) output:
|
|
142
|
+
@Arg('output', type => ScalarObject, { nullable: true }) output: { [key: string]: any },
|
|
143
143
|
@Arg('reason', { nullable: true }) reason: string,
|
|
144
144
|
@Ctx() context: any
|
|
145
145
|
): Promise<ActivityThread> {
|
|
@@ -172,7 +172,7 @@ export class ActivityThreadMutation {
|
|
|
172
172
|
@Mutation(returns => ActivityThread, { description: 'To end a ActivityThread' })
|
|
173
173
|
async endActivityThread(
|
|
174
174
|
@Arg('id') id: string,
|
|
175
|
-
@Arg('output', type => ScalarObject, { nullable: true }) output:
|
|
175
|
+
@Arg('output', type => ScalarObject, { nullable: true }) output: { [key: string]: any },
|
|
176
176
|
@Arg('reason', { nullable: true }) reason: string,
|
|
177
177
|
@Ctx() context: any
|
|
178
178
|
): Promise<ActivityThread> {
|
|
@@ -5,8 +5,6 @@ import { pubsub } from '@things-factory/shell'
|
|
|
5
5
|
|
|
6
6
|
import { ActivityThread } from './activity-thread'
|
|
7
7
|
|
|
8
|
-
const debug = require('debug')('things-factory:worklist:activity-thread-subscription')
|
|
9
|
-
|
|
10
8
|
@Resolver(ActivityThread)
|
|
11
9
|
export class ActivityThreadSubscription {
|
|
12
10
|
@Subscription({
|
|
@@ -14,8 +12,6 @@ export class ActivityThreadSubscription {
|
|
|
14
12
|
const { domain, user } = context.state
|
|
15
13
|
const subdomain = domain?.subdomain
|
|
16
14
|
|
|
17
|
-
debug('subscribe', subdomain)
|
|
18
|
-
|
|
19
15
|
if (!domain) {
|
|
20
16
|
throw new Error('domain required')
|
|
21
17
|
}
|
package/things-factory.config.js
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.evalActivityInstanceState = void 0;
|
|
4
|
-
const activity_instance_1 = require("../../service/activity-instance/activity-instance");
|
|
5
|
-
async function evalActivityInstanceState(activityInstance, { domain, user, tx, t }) {
|
|
6
|
-
activityInstance = await tx
|
|
7
|
-
.getRepository(activity_instance_1.ActivityInstance)
|
|
8
|
-
.findOne({ id: activityInstance.id }, { relations: ['activityThreads'] });
|
|
9
|
-
const { threadsMin, threadsMax, activityThreads, state, dueAt } = activityInstance;
|
|
10
|
-
const validThreads = activityThreads.filter(thread => thread.isValid());
|
|
11
|
-
const pendingStartedThreads = activityThreads.filter(thread => thread.isPendingStarted());
|
|
12
|
-
const pendingEndedThreads = activityThreads.filter(thread => thread.isPendingEnded());
|
|
13
|
-
switch (true) {
|
|
14
|
-
case state === activity_instance_1.ActivityInstanceStatus.Ended:
|
|
15
|
-
case state === activity_instance_1.ActivityInstanceStatus.Aborted:
|
|
16
|
-
return state;
|
|
17
|
-
case validThreads.length === 0:
|
|
18
|
-
return activity_instance_1.ActivityInstanceStatus.Posted;
|
|
19
|
-
case threadsMin > validThreads.length:
|
|
20
|
-
return activity_instance_1.ActivityInstanceStatus.WaitingAssignment;
|
|
21
|
-
case pendingStartedThreads.length > 0:
|
|
22
|
-
return activity_instance_1.ActivityInstanceStatus.Assigned;
|
|
23
|
-
case pendingEndedThreads.length > 0:
|
|
24
|
-
return dueAt.getTime() > Date.now() ? activity_instance_1.ActivityInstanceStatus.Started : activity_instance_1.ActivityInstanceStatus.Pending;
|
|
25
|
-
default:
|
|
26
|
-
return activity_instance_1.ActivityInstanceStatus.Ended;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.evalActivityInstanceState = evalActivityInstanceState;
|
|
30
|
-
//# sourceMappingURL=common.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/common.ts"],"names":[],"mappings":";;;AAKA,yFAA4G;AAIrG,KAAK,UAAU,yBAAyB,CAC7C,gBAAkC,EAClC,EAAE,MAAM,E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sB,CAAC,OAAO,CAAA;QACvG;YACE,OAAO,0CAAsB,CAAC,KAAK,CAAA;KACtC;AACH,CAAC;AA5BD,8DA4BC"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAdhoc = exports.create = void 0;
|
|
4
|
-
const typeorm_1 = require("typeorm");
|
|
5
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
6
|
-
const activity_instance_1 = require("../../service/activity-instance/activity-instance");
|
|
7
|
-
const activity_thread_1 = require("../../service/activity-thread/activity-thread");
|
|
8
|
-
const activity_1 = require("../../service/activity/activity");
|
|
9
|
-
const debug = require('debug')('things-factory:worklist:create');
|
|
10
|
-
async function createActivityThreadsForUsers(activityInstance, assignees, { domain, user, tx, t }) {
|
|
11
|
-
const threadRepo = tx.getRepository(activity_thread_1.ActivityThread);
|
|
12
|
-
const now = new Date();
|
|
13
|
-
// create activity-thread for all of users taking given role
|
|
14
|
-
// for (let assignee of assignees) {
|
|
15
|
-
// const activityThread = {
|
|
16
|
-
// assignee,
|
|
17
|
-
// state: ActivityThreadStatus.Assigned,
|
|
18
|
-
// activityInstance,
|
|
19
|
-
// domain,
|
|
20
|
-
// creator: user,
|
|
21
|
-
// updater: user,
|
|
22
|
-
// assignedAt: now
|
|
23
|
-
// }
|
|
24
|
-
// await threadRepo.save(activityThread)
|
|
25
|
-
// }
|
|
26
|
-
return await threadRepo.save(assignees.map(assignee => {
|
|
27
|
-
return {
|
|
28
|
-
assignee,
|
|
29
|
-
state: activity_thread_1.ActivityThreadStatus.Assigned,
|
|
30
|
-
activityInstance,
|
|
31
|
-
domain,
|
|
32
|
-
creator: user,
|
|
33
|
-
updater: user,
|
|
34
|
-
dueAt: activityInstance.dueAt,
|
|
35
|
-
assignedAt: now
|
|
36
|
-
};
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
async function createActivityThreadsForAllRoleUsers(activityInstance, { domain, user, tx, t }) {
|
|
40
|
-
// find how many users are having given role
|
|
41
|
-
const assigneeRole = (await tx
|
|
42
|
-
.getRepository(auth_base_1.Role)
|
|
43
|
-
.findOne({ id: activityInstance.assigneeRoleId }, { relations: ['users'] }));
|
|
44
|
-
const assignees = (assigneeRole === null || assigneeRole === void 0 ? void 0 : assigneeRole.users) || [];
|
|
45
|
-
if (assignees.length === 0) {
|
|
46
|
-
throw new Error("there's no users having given role");
|
|
47
|
-
}
|
|
48
|
-
// create activity-thread for all of users having given role
|
|
49
|
-
return await createActivityThreadsForUsers(activityInstance, assignees, { domain, user, tx, t });
|
|
50
|
-
}
|
|
51
|
-
async function create(activityInstance, { domain, user, tx, t }) {
|
|
52
|
-
const { activityId, input, dueAt } = activityInstance;
|
|
53
|
-
debug('createActivityInstance', activityId, input);
|
|
54
|
-
var repository = (0, typeorm_1.getRepository)(activity_1.Activity);
|
|
55
|
-
var activity = await repository.findOne({
|
|
56
|
-
where: { domain, id: activityId },
|
|
57
|
-
relations: ['assigneeRole', 'supervisoryRole']
|
|
58
|
-
});
|
|
59
|
-
if (!activity) {
|
|
60
|
-
throw new Error(t('error.activity-instance not found', {
|
|
61
|
-
activity: activityId
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
if (!dueAt && activity.standardTime) {
|
|
65
|
-
activityInstance.dueAt = new Date(Date.now() + activity.standardTime * 1000);
|
|
66
|
-
}
|
|
67
|
-
const created = await tx.getRepository(activity_instance_1.ActivityInstance).save(Object.assign(Object.assign({}, activityInstance), { activityType: activity.activityType, uiType: activity.uiType, uiSource: activity.uiSource, assigneeRole: activity.assigneeRole, supervisoryRole: activity.supervisoryRole, adhocType: 'standard', refBy: activityId, transaction: 'create', state: activity_instance_1.ActivityInstanceStatus.Posted, domain, creator: user, updater: user }));
|
|
68
|
-
if (created.threadsMin === 0) {
|
|
69
|
-
await createActivityThreadsForAllRoleUsers(created, { domain, user, tx, t });
|
|
70
|
-
}
|
|
71
|
-
return await tx.getRepository(activity_instance_1.ActivityInstance).findOne(created);
|
|
72
|
-
}
|
|
73
|
-
exports.create = create;
|
|
74
|
-
async function createAdhoc(activityInstance, { domain, user, tx, t }) {
|
|
75
|
-
const { adhocType, refBy, input, uiType, uiSource, supervisoryRole, assigneeRole, assignees } = activityInstance;
|
|
76
|
-
debug('createAdhocActivityInstance', adhocType, refBy, input);
|
|
77
|
-
var mergedAssignees = [];
|
|
78
|
-
// find how many users are taking given role
|
|
79
|
-
if (assigneeRole) {
|
|
80
|
-
mergedAssignees.concat((await tx.getRepository(auth_base_1.Role).findOne({
|
|
81
|
-
id: activityInstance.assigneeRole
|
|
82
|
-
}, {
|
|
83
|
-
relations: ['users']
|
|
84
|
-
})).users);
|
|
85
|
-
}
|
|
86
|
-
if (assignees instanceof Array) {
|
|
87
|
-
mergedAssignees.concat(await tx.getRepository(auth_base_1.User).find(assignees));
|
|
88
|
-
}
|
|
89
|
-
const created = await tx.getRepository(activity_instance_1.ActivityInstance).save(Object.assign(Object.assign({}, activityInstance), { transaction: 'create', state: activity_instance_1.ActivityInstanceStatus.Posted, uiType,
|
|
90
|
-
uiSource,
|
|
91
|
-
adhocType,
|
|
92
|
-
domain,
|
|
93
|
-
refBy,
|
|
94
|
-
input,
|
|
95
|
-
assigneeRole,
|
|
96
|
-
supervisoryRole, creator: user, updater: user }));
|
|
97
|
-
if (created.threadsMin === 0) {
|
|
98
|
-
await createActivityThreadsForUsers(activityInstance, assignees, { domain, user, tx, t });
|
|
99
|
-
}
|
|
100
|
-
return await tx.getRepository(activity_instance_1.ActivityInstance).findOne(created);
|
|
101
|
-
}
|
|
102
|
-
exports.createAdhoc = createAdhoc;
|
|
103
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/create.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,yDAAsD;AAEtD,yFAA4G;AAE5G,mFAAoG;A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AAI,SAAS,YAAY,KAAK,EAAE;QAC9B,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,gBAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;KACrE;IAED,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,oCAAgB,CAAC,CAAC,IAAI,iCACxD,gBAAgB,KACnB,WAAW,EAAE,QAAQ,EACrB,KAAK,EAAE,0CAAsB,CAAC,MAAM,EACpC,MAAM;QACN,QAAQ;QACR,SAAS;QACT,MAAM;QACN,KAAK;QACL,KAAK;QACL,YAAY;QACZ,eAAe,EACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IAEF,IAAI,OAAO,CAAC,UAAU,KAAK,CAAC,EAAE;QAC5B,MAAM,6BAA6B,CAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAA;KAC1F;IAED,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,oCAAgB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;AAClE,CAAC;AAnDD,kCAmDC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.save = void 0;
|
|
4
|
-
const activity_instance_1 = require("../../service/activity-instance/activity-instance");
|
|
5
|
-
const common_1 = require("../common");
|
|
6
|
-
async function save(id, save, { domain, user, tx, t }) {
|
|
7
|
-
const repository = tx.getRepository(activity_instance_1.ActivityInstance);
|
|
8
|
-
const activityInstance = await repository.findOne({
|
|
9
|
-
where: { domain, id }
|
|
10
|
-
});
|
|
11
|
-
return await repository.save(Object.assign(Object.assign(Object.assign({}, activityInstance), save), { transaction: 'save', state: await (0, common_1.evalActivityInstanceState)(activityInstance, { domain, user, tx, t }), updater: user }));
|
|
12
|
-
}
|
|
13
|
-
exports.save = save;
|
|
14
|
-
//# sourceMappingURL=save.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"save.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/save.ts"],"names":[],"mappings":";;;AAAA,yFAAoF;AAEpF,sCAAyE;AAElE,KAAK,UAAU,IAAI,CACxB,EAAU,EACV,IAA0B,EAC1B,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAiB;IAEtC,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,oCAAgB,CAAC,CAAA;IACrD,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;QAChD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;KACtB,CAAC,CAAA;IAEF,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,gBAAgB,GAChB,IAAI,KACP,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,IAAA,kCAAyB,EAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EACjF,OAAO,EAAE,IAAI,IACb,CAAA;AACJ,CAAC;AAjBD,oBAiBC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.take = void 0;
|
|
4
|
-
const typeorm_1 = require("typeorm");
|
|
5
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
6
|
-
const activity_instance_1 = require("../../service/activity-instance/activity-instance");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const debug = require('debug')('things-factory:worklist:take');
|
|
9
|
-
async function take({ id, assigneeRole, supervisoryRole, reason, dueAt }, { domain, user, tx, t }) {
|
|
10
|
-
debug('takeActivityInstance', id);
|
|
11
|
-
var repository = (0, typeorm_1.getRepository)(activity_instance_1.ActivityInstance);
|
|
12
|
-
var activityInstance = await repository.findOne({
|
|
13
|
-
where: { domain, id },
|
|
14
|
-
relations: ['assigneeRole', 'supervisoryRole']
|
|
15
|
-
});
|
|
16
|
-
if (!activityInstance) {
|
|
17
|
-
throw new Error(t('error.activity-instance not found', {
|
|
18
|
-
activityInstance: id
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
if (dueAt) {
|
|
22
|
-
activityInstance.dueAt = dueAt;
|
|
23
|
-
}
|
|
24
|
-
if (assigneeRole) {
|
|
25
|
-
activityInstance.assigneeRole = (0, typeorm_1.getRepository)(auth_base_1.Role).findOne({
|
|
26
|
-
domain,
|
|
27
|
-
name: assigneeRole
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
if (supervisoryRole) {
|
|
31
|
-
activityInstance.supervisoryRole = (0, typeorm_1.getRepository)(auth_base_1.Role).findOne({
|
|
32
|
-
domain,
|
|
33
|
-
name: supervisoryRole
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
if (!activityInstance.assigneeRole) {
|
|
37
|
-
throw new Error(t('error.activity-instance assignee role not found', {
|
|
38
|
-
activityInstance: id,
|
|
39
|
-
role: assigneeRole
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
if (activityInstance.assigneeRole)
|
|
43
|
-
return await tx.getRepository(activity_instance_1.ActivityInstance).save(Object.assign(Object.assign({}, activityInstance), { reason, transaction: 'take', state: await (0, common_1.evalActivityInstanceState)(id, { domain, user, tx, t }), updater: user }));
|
|
44
|
-
}
|
|
45
|
-
exports.take = take;
|
|
46
|
-
//# sourceMappingURL=take.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"take.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/take.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,yDAAgD;AAEhD,yFAAoF;AACpF,sCAAyE;AAEzE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,8BAA8B,CAAC,CAAA;AAEvD,K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