@simitgroup/simpleapp-generator 1.1.11 → 1.1.12
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/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +3 -2
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +5 -2
- package/dist/generate.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/framework.ts +3 -2
- package/src/generate.ts +7 -3
- package/src/index.ts +1 -1
- package/templates/basic/nest/controller.ts.eta +19 -17
- package/templates/basic/nest/service.ts.eta +39 -2
- package/templates/basic/nuxt/pages.form.vue.eta +117 -84
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +7 -4
- package/templates/nest/.env._eta +7 -1
- package/templates/nest/remoteapi/cloudapi.yaml.eta +768 -0
- package/templates/nest/src/app.module.ts.eta +2 -2
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +0 -19
- package/templates/nest/src/simpleapp/services/autoinc.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/branch.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/docno.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/org.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/perm.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/tenant.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +6 -3
- package/templates/nest/src/simpleapp/workflow/appDelegate.ts.eta +194 -0
- package/templates/nest/src/simpleapp/workflow/bpmn/suspendcustomer.bpmn.eta +53 -0
- package/templates/nest/src/simpleapp/workflow/configuration.ts.eta +46 -0
- package/templates/nest/src/simpleapp/workflow/delegates/customer.ts._eta +8 -0
- package/templates/nest/src/simpleapp/workflow/delegates/hello.ts._eta +5 -0
- package/templates/nest/src/simpleapp/workflow/delegates/index.ts._eta +5 -0
- package/templates/nest/src/simpleapp/workflow/delegates/invoice.delegates.ts._eta +9 -0
- package/templates/nest/src/simpleapp/workflow/delegates/usertask.ts._eta +3 -0
- package/templates/nest/src/simpleapp/workflow/formschema/SimpleApproveReject.ts.eta +8 -0
- package/templates/nest/src/simpleapp/workflow/formschema/index.ts.eta +1 -0
- package/templates/nest/src/simpleapp/workflow/workflow.apischema.ts.eta +135 -0
- package/templates/nest/src/simpleapp/workflow/workflow.controller.ts.eta +407 -0
- package/templates/nest/src/simpleapp/workflow/workflow.service.ts.eta +430 -0
- package/templates/nest/src/simpleapp/workflow/workflow.type.ts.eta +56 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +2 -1
- package/templates/nuxt/components/event/EventDecision.vue.eta +1 -1
- package/templates/nuxt/components/event/EventNotification.vue.eta +1 -1
- package/templates/nuxt/components/header/HeaderBar.vue.eta +3 -1
- package/templates/nuxt/components/header/button/task/HeaderButtonTaskItem.vue.eta +21 -0
- package/templates/nuxt/components/header/button/task/HeaderButtonTaskList.vue.eta +126 -0
- package/templates/nuxt/components/simpleApp/SimpleAppJsonSchemaForm.vue.eta +133 -0
- package/templates/nuxt/composables/getOpenApi.generate.ts.eta +27 -8
- package/templates/nuxt/composables/workflow.generate.ts.eta +16 -0
- package/templates/nuxt/lang/df.ts.eta +2 -0
- package/templates/nuxt/pages/[xorg]/index.vue._eta +5 -3
- package/templates/nuxt/types/index.ts.eta +2 -1
- package/templates/nuxt/types/schema.ts.eta +1 -0
- package/templates/nuxt/types/workflow.ts.eta +20 -0
- package/templates/project/jsonschemas/customer.json._eta +13 -9
- package/templates/project/jsonschemas/invoice.json._eta +10 -6
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -29,10 +29,10 @@ import { UserMongoSchema } from './simpleapp/generate/models/user.model';
|
|
|
29
29
|
import { PermissionMongoSchema } from './simpleapp/generate/models/perm.model';
|
|
30
30
|
import { ApiEventMongoSchema } from './simpleapp/generate/models/apievent.model';
|
|
31
31
|
@Module({
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
imports: [
|
|
34
34
|
ConfigModule.forRoot(),
|
|
35
|
-
MongooseModule.forRoot(process.env.
|
|
35
|
+
MongooseModule.forRoot(process.env.MONGO_DB_URL,{}),
|
|
36
36
|
ServeStaticModule.forRoot({
|
|
37
37
|
rootPath: join(__dirname, '..', 'public_html'),
|
|
38
38
|
exclude: ['/api/(.*)'],
|
|
@@ -553,25 +553,6 @@ export class SimpleAppService<T extends { _id?: string }> {
|
|
|
553
553
|
return this.findIdThenUpdate(appuser,id, partialdata);
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
/**
|
|
557
|
-
* change property documentStatus for specific document, no workflow execution
|
|
558
|
-
* @param id
|
|
559
|
-
* @param docstatus
|
|
560
|
-
* @returns Promise
|
|
561
|
-
*/
|
|
562
|
-
async executeWorkFlow(appuser:UserContext,id: string, bpmnname: string, docstatus: string) {
|
|
563
|
-
const data = await this.findById(appuser,id);
|
|
564
|
-
return "ok"
|
|
565
|
-
// Workflow.getInstance().executeWorkFlow(
|
|
566
|
-
// id,
|
|
567
|
-
// bpmnname,
|
|
568
|
-
// docstatus,
|
|
569
|
-
// data,
|
|
570
|
-
// );
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
556
|
async genNewDocNo(appuser:UserContext,data:T){
|
|
576
557
|
this.logger.debug("genNewDocNo")
|
|
577
558
|
const result = await this.docnogenerator.generateNextNumberFromDocument(appuser,this.documentType,data)
|
|
@@ -39,7 +39,7 @@ export class BranchService extends BranchProcessor {
|
|
|
39
39
|
// case 'afterValidation':
|
|
40
40
|
// break;
|
|
41
41
|
case 'beforeCreate':
|
|
42
|
-
const searchresult = await this.increament.
|
|
42
|
+
const searchresult = await this.increament.runGenerateNextNo(
|
|
43
43
|
appuser,
|
|
44
44
|
'branch',
|
|
45
45
|
'branchId',
|
|
@@ -63,7 +63,7 @@ export class DocnoformatService extends DocnoformatProcessor {
|
|
|
63
63
|
* @param doctype
|
|
64
64
|
* @returns
|
|
65
65
|
*/
|
|
66
|
-
async
|
|
66
|
+
async runListDocFormats(appuser: UserContext, doctype: string) {
|
|
67
67
|
doctype = doctype.toUpperCase();
|
|
68
68
|
const searchresult = await this.search(
|
|
69
69
|
appuser,
|
|
@@ -36,7 +36,7 @@ export class OrganizationService extends OrganizationProcessor {
|
|
|
36
36
|
// case 'afterValidation':
|
|
37
37
|
// break;
|
|
38
38
|
case 'beforeCreate':
|
|
39
|
-
const searchresult = await this.increament.
|
|
39
|
+
const searchresult = await this.increament.runGenerateNextNo(
|
|
40
40
|
appuser,
|
|
41
41
|
'organization',
|
|
42
42
|
'orgId',
|
|
@@ -66,7 +66,7 @@ export class PermissionService extends PermissionProcessor {
|
|
|
66
66
|
return true;
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
async
|
|
69
|
+
async runListUser(appuser: UserContext) {
|
|
70
70
|
const getallrecords: PipelineStage = { $match: {} };
|
|
71
71
|
const lookupuser: PipelineStage = {
|
|
72
72
|
$lookup: {
|
|
@@ -37,7 +37,7 @@ export class TenantService extends TenantProcessor {
|
|
|
37
37
|
// case 'afterValidation':
|
|
38
38
|
// break;
|
|
39
39
|
case 'beforeCreate':
|
|
40
|
-
const searchresult = await this.increament.
|
|
40
|
+
const searchresult = await this.increament.runGenerateNextNo(
|
|
41
41
|
appuser,
|
|
42
42
|
'tenant',
|
|
43
43
|
'tenantId',
|
|
@@ -19,6 +19,9 @@ import { <%= obj.docname %>MongoSchema } from './generate/models/<%= obj.doctype
|
|
|
19
19
|
//import {WorkflowProviderFactory,WorkflowProvider} from "./generate/commons/providers/WorkflowProvider"
|
|
20
20
|
import { ProfileController } from './profile/profile.controller';
|
|
21
21
|
import { ProfileService } from './profile/profile.service';
|
|
22
|
+
import {WorkflowService} from './workflow/workflow.service'
|
|
23
|
+
import {WorkflowController} from './workflow/workflow.controller'
|
|
24
|
+
|
|
22
25
|
// import {ServiceModule} from "../services/service.module"
|
|
23
26
|
//import { <%= it.typename %>Service } from '../../generate/<%= it.doctype %>/<%= it.doctype %>.service';
|
|
24
27
|
|
|
@@ -35,8 +38,8 @@ import { ProfileService } from './profile/profile.service';
|
|
|
35
38
|
<%}%>
|
|
36
39
|
]),
|
|
37
40
|
],
|
|
38
|
-
controllers: [<% for(let i=0;i<it.modules.length; i++){ %><%= it.modules[i].docname %>Controller,<%}%> ProfileController],
|
|
39
|
-
providers: [AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){ %><%= it.modules[i].docname %>Service,<%}%> ProfileService,],
|
|
40
|
-
exports:[AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){ %><%= it.modules[i].docname %>Service,<%}%> ProfileService,]
|
|
41
|
+
controllers: [<% for(let i=0;i<it.modules.length; i++){ %><%= it.modules[i].docname %>Controller,<%}%> ProfileController,WorkflowController],
|
|
42
|
+
providers: [AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){ %><%= it.modules[i].docname %>Service,<%}%> ProfileService,WorkflowService],
|
|
43
|
+
exports:[AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){ %><%= it.modules[i].docname %>Service,<%}%> ProfileService,WorkflowService]
|
|
41
44
|
})
|
|
42
45
|
export class GenerateModule {}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { DefaultAppDelegate, Item, FLOW_ACTION , NODE_ACTION, IExecution } from 'bpmn-server';
|
|
2
|
+
import * as delegateService from './delegates'
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
|
|
5
|
+
var seq = 1;
|
|
6
|
+
|
|
7
|
+
class MyAppDelegate extends DefaultAppDelegate{
|
|
8
|
+
winSocket;
|
|
9
|
+
constructor(server) {
|
|
10
|
+
super(server);
|
|
11
|
+
this.servicesProvider = delegateService //new MyServices();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* is fired on application startup
|
|
15
|
+
**/
|
|
16
|
+
async startUp(options) {
|
|
17
|
+
|
|
18
|
+
await super.startUp(options);
|
|
19
|
+
if (options['cron'] == false) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var query = { "items.status": "start" };
|
|
24
|
+
|
|
25
|
+
var list = await this.server.dataStore.findItems(query);
|
|
26
|
+
if (list.length > 0) {
|
|
27
|
+
|
|
28
|
+
this.server.logger.log("...items query returend " + list.length);
|
|
29
|
+
for (var i = 0; i < list.length; i++) {
|
|
30
|
+
let item = list[i];
|
|
31
|
+
//console.log('-->',item.processName,item.elementId,item.type,item.startedAt,item.status);
|
|
32
|
+
if (item.type=='bpmn:ScriptTask' || item.type=='bpmn:ServiceTask' )
|
|
33
|
+
{
|
|
34
|
+
console.log('item needs recovering:',item.elementId,item.name,item.processName,item.startedAt);
|
|
35
|
+
//let response =await this.server.engine.invoke({"items.id":item.id}, {},null, {recover:true});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
sendEmail(to, msg, body) {
|
|
43
|
+
|
|
44
|
+
console.log(`Sending email to ${to}`);
|
|
45
|
+
|
|
46
|
+
const key = process.env.SENDGRID_API_KEY;
|
|
47
|
+
|
|
48
|
+
if (key && (key != '')) {
|
|
49
|
+
const sgMail = require('@sendgrid/mail')
|
|
50
|
+
sgMail.setApiKey(process.env.SENDGRID_API_KEY)
|
|
51
|
+
|
|
52
|
+
const email = {
|
|
53
|
+
to: to,
|
|
54
|
+
from: 'ralphhanna@hotmail.com', // Change to your verified sender
|
|
55
|
+
subject: msg,
|
|
56
|
+
text: body,
|
|
57
|
+
html: body
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
sgMail
|
|
61
|
+
.send(email)
|
|
62
|
+
.then((response) => {
|
|
63
|
+
this.server.logger.log('responseCode', response[0].statusCode)
|
|
64
|
+
this.server.logger.log('responseHeaders', response[0].headers)
|
|
65
|
+
})
|
|
66
|
+
.catch((error) => {
|
|
67
|
+
console.error('Email Error:' + error)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
console.log(`email is disabled`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async executionStarted(execution: IExecution) {
|
|
78
|
+
await super.executionStarted(execution);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async executionEvent(context, event) {
|
|
82
|
+
|
|
83
|
+
if (context.item) {
|
|
84
|
+
if (event == 'wait' && context.item.element.type == 'bpmn:UserTask')
|
|
85
|
+
{
|
|
86
|
+
const msg=`********reaching user task******`;
|
|
87
|
+
|
|
88
|
+
console.log(msg, event);
|
|
89
|
+
}
|
|
90
|
+
// console.log(`----->Event: '${event}' for ${context.item.element.type} '${context.item.element.id}' id: ${context.item.id}`);
|
|
91
|
+
// if (event == 'wait' && context.item.element.type == 'bpmn:UserTask')
|
|
92
|
+
// console.log(`----->Waiting for User Input for '${context.item.element.id}' id: ${context.item.id}`);
|
|
93
|
+
}
|
|
94
|
+
// else
|
|
95
|
+
// console.log('----->All:' + event, context.definition.name);
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
async messageThrown(messageId, data, matchingQuery, item: Item) {
|
|
100
|
+
await super.messageThrown(messageId, data, matchingQuery,item);
|
|
101
|
+
}
|
|
102
|
+
async signalThrown(signalId, data, matchingQuery, item: Item) {
|
|
103
|
+
await super.signalThrown(signalId, data, matchingQuery, item);
|
|
104
|
+
}
|
|
105
|
+
async serviceCalled(input, context) {
|
|
106
|
+
this.server.logger.log("customize service called==========: ",Object.keys(context));
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// async function delay(time, result) {
|
|
112
|
+
// console.log("delaying ... " + time)
|
|
113
|
+
// return new Promise(function (resolve) {
|
|
114
|
+
// setTimeout(function () {
|
|
115
|
+
// console.log("delayed is done.");
|
|
116
|
+
// resolve(result);
|
|
117
|
+
// }, time);
|
|
118
|
+
// });
|
|
119
|
+
// }
|
|
120
|
+
// import * as readline from 'readline';
|
|
121
|
+
// const cl = readline.createInterface(process.stdin, process.stdout);
|
|
122
|
+
// const question = function (q) {
|
|
123
|
+
// return new Promise((res, rej) => {
|
|
124
|
+
// cl.question(q, answer => {
|
|
125
|
+
// res(answer);
|
|
126
|
+
// })
|
|
127
|
+
// });
|
|
128
|
+
// };
|
|
129
|
+
// class MyServices {
|
|
130
|
+
// async promptUser(input, context) {
|
|
131
|
+
// console.log('executing prompt user');
|
|
132
|
+
|
|
133
|
+
// var result = await question("continue?");
|
|
134
|
+
// console.log('result:', result);
|
|
135
|
+
// return null;
|
|
136
|
+
|
|
137
|
+
// }
|
|
138
|
+
// async serviceTask(input, context) {
|
|
139
|
+
// let item = context.item;
|
|
140
|
+
// console.log(" Hi this is the serviceTask from appDelegate");
|
|
141
|
+
// console.log(item.elementId);
|
|
142
|
+
// await delay(5000, 'test');
|
|
143
|
+
// console.log(" Hi this is the serviceTask from appDelegate says bye");
|
|
144
|
+
// }
|
|
145
|
+
// async simulateCrash(input, context) {
|
|
146
|
+
// let item = context.item;
|
|
147
|
+
// let data = item.token.data;
|
|
148
|
+
// if (data['crash']=='Yes')
|
|
149
|
+
// {
|
|
150
|
+
// data['crash']='No';
|
|
151
|
+
// await item.token.execution.save();
|
|
152
|
+
// console.log('Will Crash now',item.token.data);
|
|
153
|
+
// process.exit(100);
|
|
154
|
+
// }
|
|
155
|
+
// else
|
|
156
|
+
// console.log('no crash');
|
|
157
|
+
// }
|
|
158
|
+
// async add({ v1, v2 }) {
|
|
159
|
+
// console.log("Add Service", v1, v2);
|
|
160
|
+
|
|
161
|
+
// return Number(v1) + Number(v2);
|
|
162
|
+
// }
|
|
163
|
+
// async hello(){
|
|
164
|
+
// console.log("Send Hello-------------------")
|
|
165
|
+
// }
|
|
166
|
+
// async service99() {
|
|
167
|
+
// console.log('>>>>>>>>>>appDelegate service99');
|
|
168
|
+
// }
|
|
169
|
+
// async notifyhead() {
|
|
170
|
+
// console.log('>>>>>>>>>>appDelegate notifyhead');
|
|
171
|
+
// }
|
|
172
|
+
// async service1(input, context) {
|
|
173
|
+
// let item = context.item;
|
|
174
|
+
// let wait=5000;
|
|
175
|
+
// if (input.wait)
|
|
176
|
+
// wait=input.wait;
|
|
177
|
+
// item.vars = input;
|
|
178
|
+
// seq++;
|
|
179
|
+
// await delay(wait, 'test');
|
|
180
|
+
// item.token.log("SERVICE 1: input: " + JSON.stringify(input)+ item.token.currentNode.id + " current seq: " + seq);
|
|
181
|
+
|
|
182
|
+
// console.log('appDelegate service1 is now complete input:',input, 'output:',seq,'item.data',item.data);
|
|
183
|
+
// return { seq , text: 'test' };
|
|
184
|
+
// }
|
|
185
|
+
// async DummyService1(input, context) {
|
|
186
|
+
// context.item.data.service1Result = 'Service1Exec';
|
|
187
|
+
// }
|
|
188
|
+
|
|
189
|
+
// async DummyService2(input, context) {
|
|
190
|
+
// await delay(126000, '2.1mins'); // Wait for 2.1 mins
|
|
191
|
+
// context.item.data.service2Result = 'Service2Exec';
|
|
192
|
+
// }
|
|
193
|
+
// }
|
|
194
|
+
export {MyAppDelegate}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
|
|
3
|
+
<bpmn:process id="Process_1" name="approve1" isExecutable="false">
|
|
4
|
+
<bpmn:extensionElements />
|
|
5
|
+
<bpmn:startEvent id="StartEvent_1">
|
|
6
|
+
<bpmn:outgoing>Flow_1a63g0z</bpmn:outgoing>
|
|
7
|
+
</bpmn:startEvent>
|
|
8
|
+
<bpmn:endEvent id="Event_0qpgd23">
|
|
9
|
+
<bpmn:incoming>Flow_0ds03ms</bpmn:incoming>
|
|
10
|
+
</bpmn:endEvent>
|
|
11
|
+
<bpmn:sequenceFlow id="Flow_1x9zeai" sourceRef="approve1" targetRef="set-customer-inactive" />
|
|
12
|
+
<bpmn:sequenceFlow id="Flow_1a63g0z" sourceRef="StartEvent_1" targetRef="approve1" />
|
|
13
|
+
<bpmn:userTask id="approve1" name="approve by supervisor" camunda:formKey="jsonschema://SimpleApproveReject" camunda:assignee="kstan">
|
|
14
|
+
<bpmn:extensionElements />
|
|
15
|
+
<bpmn:incoming>Flow_1a63g0z</bpmn:incoming>
|
|
16
|
+
<bpmn:outgoing>Flow_1x9zeai</bpmn:outgoing>
|
|
17
|
+
</bpmn:userTask>
|
|
18
|
+
<bpmn:sequenceFlow id="Flow_0ds03ms" sourceRef="set-customer-inactive" targetRef="Event_0qpgd23" />
|
|
19
|
+
<bpmn:serviceTask id="set-customer-inactive" name="set customer inactive" camunda:delegateExpression="suspendCustomer">
|
|
20
|
+
<bpmn:incoming>Flow_1x9zeai</bpmn:incoming>
|
|
21
|
+
<bpmn:outgoing>Flow_0ds03ms</bpmn:outgoing>
|
|
22
|
+
</bpmn:serviceTask>
|
|
23
|
+
</bpmn:process>
|
|
24
|
+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
|
25
|
+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
|
|
26
|
+
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
|
|
27
|
+
<dc:Bounds x="-148" y="72" width="36" height="36" />
|
|
28
|
+
</bpmndi:BPMNShape>
|
|
29
|
+
<bpmndi:BPMNShape id="Event_0qpgd23_di" bpmnElement="Event_0qpgd23">
|
|
30
|
+
<dc:Bounds x="352" y="72" width="36" height="36" />
|
|
31
|
+
</bpmndi:BPMNShape>
|
|
32
|
+
<bpmndi:BPMNShape id="Activity_1odv9ki_di" bpmnElement="approve1">
|
|
33
|
+
<dc:Bounds x="-20" y="50" width="100" height="80" />
|
|
34
|
+
<bpmndi:BPMNLabel />
|
|
35
|
+
</bpmndi:BPMNShape>
|
|
36
|
+
<bpmndi:BPMNShape id="Activity_03pdbkx_di" bpmnElement="set-customer-inactive">
|
|
37
|
+
<dc:Bounds x="170" y="50" width="100" height="80" />
|
|
38
|
+
</bpmndi:BPMNShape>
|
|
39
|
+
<bpmndi:BPMNEdge id="Flow_1x9zeai_di" bpmnElement="Flow_1x9zeai">
|
|
40
|
+
<di:waypoint x="80" y="90" />
|
|
41
|
+
<di:waypoint x="170" y="90" />
|
|
42
|
+
</bpmndi:BPMNEdge>
|
|
43
|
+
<bpmndi:BPMNEdge id="Flow_1a63g0z_di" bpmnElement="Flow_1a63g0z">
|
|
44
|
+
<di:waypoint x="-112" y="90" />
|
|
45
|
+
<di:waypoint x="-20" y="90" />
|
|
46
|
+
</bpmndi:BPMNEdge>
|
|
47
|
+
<bpmndi:BPMNEdge id="Flow_0ds03ms_di" bpmnElement="Flow_0ds03ms">
|
|
48
|
+
<di:waypoint x="270" y="90" />
|
|
49
|
+
<di:waypoint x="352" y="90" />
|
|
50
|
+
</bpmndi:BPMNEdge>
|
|
51
|
+
</bpmndi:BPMNPlane>
|
|
52
|
+
</bpmndi:BPMNDiagram>
|
|
53
|
+
</bpmn:definitions>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Injectable, Logger } from '@nestjs/common';
|
|
2
|
+
import { Configuration, ModelsDatastore, ModelsDatastoreDB, DataStore
|
|
3
|
+
, NoCacheManager,CacheManager} from 'bpmn-server'
|
|
4
|
+
import { MyAppDelegate } from './appDelegate';
|
|
5
|
+
|
|
6
|
+
const dotenv = require('dotenv');
|
|
7
|
+
const res = dotenv.config();
|
|
8
|
+
|
|
9
|
+
const templatesPath = __dirname + '/emailTemplates/';
|
|
10
|
+
var configuration = new Configuration(
|
|
11
|
+
{
|
|
12
|
+
definitionsPath: process.env.BPMN_PATH,
|
|
13
|
+
templatesPath: templatesPath,
|
|
14
|
+
timers: {
|
|
15
|
+
//forceTimersDelay: 1000,
|
|
16
|
+
precision: 3000,
|
|
17
|
+
},
|
|
18
|
+
database: {
|
|
19
|
+
MongoDB:
|
|
20
|
+
{
|
|
21
|
+
db_url: process.env.MONGO_DB_URL, //"mongodb://localhost:27017?retryWrites=true&w=majority",
|
|
22
|
+
db: process.env.MONGO_DB_NAME,//'bpmn'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
apiKey: process.env.API_KEY,
|
|
26
|
+
/* Define Server Services */
|
|
27
|
+
logger: function (server) {
|
|
28
|
+
return new Logger();
|
|
29
|
+
},
|
|
30
|
+
definitions: function (server) {
|
|
31
|
+
return new ModelsDatastore(server);
|
|
32
|
+
},
|
|
33
|
+
appDelegate: function (server) {
|
|
34
|
+
return new MyAppDelegate(server);
|
|
35
|
+
},
|
|
36
|
+
dataStore: function (server) {
|
|
37
|
+
return new DataStore(server);
|
|
38
|
+
},
|
|
39
|
+
cacheManager: function (server) {
|
|
40
|
+
return new NoCacheManager(server);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
export { configuration}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SimpleApproveReject'
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
|
|
3
|
+
export class WorkflowSettingApiSchema {
|
|
4
|
+
@ApiProperty({
|
|
5
|
+
type: 'string',
|
|
6
|
+
required: true,
|
|
7
|
+
description:
|
|
8
|
+
'provide endpoint to refer user/group info inside bpmn user task',
|
|
9
|
+
})
|
|
10
|
+
userServiceUrl: string;
|
|
11
|
+
@ApiProperty({
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: false,
|
|
14
|
+
description:
|
|
15
|
+
'workflow may not realtime complete, supply call back url after complete workflow',
|
|
16
|
+
})
|
|
17
|
+
callBackUrl: string;
|
|
18
|
+
@ApiProperty({ type: 'string', required: false, description: 'optional' })
|
|
19
|
+
assignee: string;
|
|
20
|
+
@ApiProperty({ type: ['string'], required: false, description: 'optional' })
|
|
21
|
+
candidateUsers: string;
|
|
22
|
+
@ApiProperty({ type: ['string'], required: false, description: 'optional' })
|
|
23
|
+
candidateGroups: string;
|
|
24
|
+
}
|
|
25
|
+
export class WorkflowDataApiSchema {
|
|
26
|
+
@ApiProperty({ type: WorkflowSettingApiSchema, required: true })
|
|
27
|
+
workflowSetting: WorkflowSettingApiSchema;
|
|
28
|
+
|
|
29
|
+
@ApiProperty({ type: Object, required: true })
|
|
30
|
+
data: any;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class WorkflowTaskApiSchema {
|
|
34
|
+
@ApiProperty()
|
|
35
|
+
id: string;
|
|
36
|
+
@ApiProperty()
|
|
37
|
+
name: string;
|
|
38
|
+
@ApiProperty()
|
|
39
|
+
status: string;
|
|
40
|
+
@ApiProperty()
|
|
41
|
+
assignee: string;
|
|
42
|
+
@ApiProperty()
|
|
43
|
+
candidateUsers: string[];
|
|
44
|
+
@ApiProperty()
|
|
45
|
+
candidateGroups: string[];
|
|
46
|
+
@ApiProperty()
|
|
47
|
+
type: string;
|
|
48
|
+
}
|
|
49
|
+
export class WorkflowProcessApiSchema {
|
|
50
|
+
@ApiProperty()
|
|
51
|
+
id: string;
|
|
52
|
+
@ApiProperty()
|
|
53
|
+
name: string;
|
|
54
|
+
@ApiProperty()
|
|
55
|
+
startedAt: string;
|
|
56
|
+
@ApiProperty()
|
|
57
|
+
status: string;
|
|
58
|
+
@ApiProperty({ type: () => [WorkflowTaskApiSchema] })
|
|
59
|
+
items: WorkflowTaskApiSchema[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export class SearchWorkflowProcessApiSchema {
|
|
63
|
+
@ApiProperty()
|
|
64
|
+
id: string;
|
|
65
|
+
@ApiProperty()
|
|
66
|
+
name: string;
|
|
67
|
+
@ApiProperty()
|
|
68
|
+
startedAt: string;
|
|
69
|
+
@ApiProperty()
|
|
70
|
+
status: string;
|
|
71
|
+
|
|
72
|
+
@ApiProperty()
|
|
73
|
+
'items.id': string;
|
|
74
|
+
@ApiProperty()
|
|
75
|
+
'items.name': string;
|
|
76
|
+
@ApiProperty()
|
|
77
|
+
'items.status': string;
|
|
78
|
+
@ApiProperty()
|
|
79
|
+
'items.assignee': string;
|
|
80
|
+
@ApiProperty()
|
|
81
|
+
'items.candidateUsers': string[];
|
|
82
|
+
@ApiProperty()
|
|
83
|
+
'items.candidateGroups': string[];
|
|
84
|
+
@ApiProperty()
|
|
85
|
+
'items.type': string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export class UserTaskActorsApiSchema {
|
|
89
|
+
@ApiProperty()
|
|
90
|
+
assignee: string;
|
|
91
|
+
@ApiProperty()
|
|
92
|
+
candidateUsers: string[];
|
|
93
|
+
@ApiProperty()
|
|
94
|
+
candidateGroups: string[];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
export class UserTaskApiSchema {
|
|
102
|
+
@ApiProperty()
|
|
103
|
+
id: string
|
|
104
|
+
@ApiProperty()
|
|
105
|
+
taskId: string
|
|
106
|
+
@ApiProperty()
|
|
107
|
+
elementId: string
|
|
108
|
+
@ApiProperty()
|
|
109
|
+
name: string
|
|
110
|
+
@ApiProperty()
|
|
111
|
+
processName: string
|
|
112
|
+
@ApiProperty()
|
|
113
|
+
assignee: string
|
|
114
|
+
@ApiProperty({ type: () => [String] })
|
|
115
|
+
candidateUsers: string[]
|
|
116
|
+
@ApiProperty({ type: () => [String] })
|
|
117
|
+
candidateGroups: string[]
|
|
118
|
+
@ApiProperty({ type: Object, required: true })
|
|
119
|
+
data: any
|
|
120
|
+
@ApiProperty()
|
|
121
|
+
vars: any
|
|
122
|
+
@ApiProperty()
|
|
123
|
+
startedAt: string
|
|
124
|
+
@ApiProperty()
|
|
125
|
+
followUpDate: string
|
|
126
|
+
@ApiProperty()
|
|
127
|
+
dueDate: string
|
|
128
|
+
@ApiProperty()
|
|
129
|
+
priority: string
|
|
130
|
+
@ApiProperty()
|
|
131
|
+
type: string
|
|
132
|
+
@ApiProperty()
|
|
133
|
+
userId: string
|
|
134
|
+
|
|
135
|
+
}
|