提交 7d006045 编写于 作者: zcdtk's avatar zcdtk

工作流方法异常处理

上级 27088a5d
...@@ -713,11 +713,17 @@ export class EntityServiceBase { ...@@ -713,11 +713,17 @@ export class EntityServiceBase {
* @memberof EntityServiceBase * @memberof EntityServiceBase
*/ */
public async WFSubmit(context: any = {}, data: any = {}, wfdata?: any): Promise<HttpResponse> { public async WFSubmit(context: any = {}, data: any = {}, wfdata?: any): Promise<HttpResponse> {
if (wfdata && Object.keys(wfdata).length !== 0) { try {
const _data: any = { ...{ activedata: data }, wfdata }; let res: any;
return Http.getInstance().post(`/wfcore/${this.systemName}-app-${this.appName}/${this.dePath}/${data[this.key]}/tasks/${wfdata['taskId']}`, _data); if (wfdata && Object.keys(wfdata).length !== 0) {
const _data: any = { ...{ activedata: data }, wfdata };
res = await this.http.post(`/wfcore/${this.systemName}-app-${this.appName}/${this.dePath}/${data[this.key]}/tasks/${wfdata['taskId']}`, _data);
}
res = await this.http.post(`/${this.dePath}/${context[this.key]}/wfsubmit`, data);
return res;
} catch (res) {
return new HttpResponse(res.status, null);
} }
return this.http.post(`/${this.dePath}/${context[this.key]}/wfsubmit`, data);
} }
/** /**
...@@ -725,11 +731,16 @@ export class EntityServiceBase { ...@@ -725,11 +731,16 @@ export class EntityServiceBase {
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
* @returns {Promise<any>} * @returns {Promise<HttpResponse>}
* @memberof EntityServiceBase * @memberof EntityServiceBase
*/ */
public async WFGetWFStep(context: any = {}, data: any = {}): Promise<any> { public async WFGetWFStep(context: any = {}, data: any = {}): Promise<HttpResponse> {
return Http.getInstance().get(`/wfcore/${this.systemName}-app-${this.appName}/${this.dePath}/process-definitions-nodes`); try {
const res = await this.http.get(`/wfcore/${this.systemName}-app-${this.appName}/${this.dePath}/process-definitions-nodes`);
return res;
} catch (res) {
return new HttpResponse(res.status, null);
}
} }
/** /**
...@@ -737,11 +748,16 @@ export class EntityServiceBase { ...@@ -737,11 +748,16 @@ export class EntityServiceBase {
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
* @returns {Promise<any>} * @returns {Promise<HttpResponse>}
* @memberof EntityServiceBase * @memberof EntityServiceBase
*/ */
public async GetWFLink(context: any = {}, data: any = {}): Promise<any> { public async GetWFLink(context: any = {}, data: any = {}): Promise<HttpResponse> {
return Http.getInstance().get(`/wfcore/${this.systemName}-app-${this.appName}/${this.dePath}/${context[this.deName]}/usertasks/${data['taskDefinitionKey']}/ways`); try {
const res = await this.http.get(`/wfcore/${this.systemName}-app-${this.appName}/${this.dePath}/${context[this.deName]}/usertasks/${data['taskDefinitionKey']}/ways`);
return res;
} catch (res) {
return new HttpResponse(res.status, null);
}
} }
/** /**
...@@ -749,11 +765,16 @@ export class EntityServiceBase { ...@@ -749,11 +765,16 @@ export class EntityServiceBase {
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
* @returns {Promise<any>} * @returns {Promise<HttpResponse>}
* @memberof EntityServiceBase * @memberof EntityServiceBase
*/ */
public async GetWFHistory(context: any = {}, data: any = {}): Promise<any> { public async GetWFHistory(context: any = {}, data: any = {}): Promise<HttpResponse> {
return Http.getInstance().get(`/wfcore/${this.systemName}-app-${this.appName}/${this.dePath}/${context[this.deName]}/process-instances/alls/history`); try {
const res = await this.http.get(`/wfcore/${this.systemName}-app-${this.appName}/${this.dePath}/${context[this.deName]}/process-instances/alls/history`);
return res;
} catch (res) {
return new HttpResponse(res.status, null);
}
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册