RestAPI說明
# RestAPI說明
FastBPM中的工作流程可以通過RestAPI呼叫觸發。以下是API相關的參數說明。
呼叫的地址可在系統設定中設定,顯示如下:

例如,按照以上設定HttpServer完成後,可使用以下地址呼叫:
http://localhost:7708
1
# 1. 獲取任務實體
通過GET
方式,向以下地址發送訊息,實現獲取任務實體的功能。
http://localhost:7708/gettaskinstance?taskinskey=201
1
以下是發送的欄位的說明。
欄位名稱 | 說明 |
---|---|
taskinskey | 任務實體ID(必填項) |
發送后,返回的格式如下:
{
"taskinskey": 201,
"workinskey": 32,
"createdon": "2025-01-18T17:29:18.433Z",
"modifiedon": "2025-01-26T16:34:57.107Z",
"finishedon": "2025-01-18T17:29:32.263Z",
"userid": "0601",
"username": "覈算員",
"taskinstancename": "部門報廢金額(品保課)計算任務",
"subject": "部門報廢金額(品保課)計算",
"description": "",
"completed": "T",
"status": "完畢",
"statuslist": "打開,*完畢",
"workflowname": "KPI_CK_01",
"workflowdescription": "KPI實際值計算",
"workflowdefinitionkey": 16,
"taskinstancecreatedon": "2025-01-18T17:27:05.937Z",
"taskinstanfinishedon": "2025-01-18T17:29:32.263Z",
"taskid": "6F4493C4-DA16-4CED-805B-D6CC77BE8A2E",
"taskdate": "2025-01-18",
"tasktype": "B",
"tasktitle": "KPI實際值計算"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 2. 獲取任務實體列表
通過GET
方式,向以下地址發送訊息,實現獲取任務實體列表的功能。
http://localhost:7708/gettaskinstancelist?userid=0601completed=F
1
以下是發送的欄位的說明。
欄位名稱 | 說明 |
---|---|
userid | 任務實體ID(必填項) |
completed | 是否完成 |
發送后,返回的格式如下:
{
"userid": "0101",
"completed": "F",
"rows": 1,
"data": [
{
"taskinskey": 293,
"workinskey": 41,
"createdon": "2025-01-26T17:07:22.090Z",
"modifiedon": null,
"finishedon": null,
"userid": "0101",
"username": "管理員",
"taskinstancename": "審批",
"subject": "審批",
"description": "請批準或駁回.",
"completed": "F",
"status": "打開",
"statuslist": "打開,*同意,*駁回",
"workflowname": "WFTest",
"workflowdescription": "測試流程",
"workflowdefinitionkey": 17,
"taskinstancecreatedon": "2025-01-26T17:07:21.797Z",
"taskinstanfinishedon": null,
"taskid": null,
"taskdate": null,
"tasktype": null,
"tasktitle": null
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 3. 更新任務實體
通過GET
方式,向以下地址發送訊息,實現獲取任務實體列表的功能。
http://localhost:7708/savetaskinstance?taskinskey=201&status=完畢
1
以下是發送的欄位的說明。
欄位名稱 | 說明 |
---|---|
taskinskey | 任務實體ID(必填項) |
status | 審批狀態 |
發送后,返回的格式如下:
{
"status": "ok",
"message": "success!",
"time": "2025-01-26 17:10:45"
}
1
2
3
4
5
2
3
4
5
# 4. 建立任務
通過POST
方式,向以下地址發送訊息,實現建立工作流程任務的功能。
http://localhost:7708/createtask
1
發送的內容示例如下:
{
"workflow": "KPI_CK_01",
"companyid": "1",
"date": "2025-01-18",
"title": "KPI實際值計算",
"orderid": "",
"ordername": "",
"createby": "覈算員",
"createdate": "2025-01-18 17:14:05",
"submit": 1,
"params": [
{
"name": "spanid",
"value": "2011"
},
{
"name": "mon",
"value": "8"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
以下是發送的欄位說明。
欄位名稱 | 說明 |
---|---|
workflow | 工作流程的編號 |
companyid | 公司編號(配合FastERP2使用) |
date | 任務建立日期 |
title | 建立的任務標題 |
orderid | 單據編號(配合FastERP2使用) |
ordername | 單據名稱(配合FastERP2使用) |
createby | 任務建立人名稱,必須為工作流程已指定的使用者 |
createdate | 任務建立時間 |
submit | 提交后是否開始任務,1表示開始執行 |
params | 提交的變數參數列表 |
發送后,返回的格式如下,表示任務提交成功。
{
"status": "ok",
"message": " taskid 5432FAD0-383C-497E-BD97-117D3F71A498",
"time": "2025-01-25 15:10:19"
}
1
2
3
4
5
2
3
4
5