รายการ Method ทั้งหมดของ REST API และคำอธิบายการทำงานของฟังก์ชันการทำงานของ API

Start Flow (new)

API นี้จะถูกใช้ในการเริ่ม Process ซึ่งเมื่อผู้ใช้งานได้ส่ง Application ผ่านเซิฟเวอร์ ซึ่งตัวเซิฟเวอร์จะทำการเรียก BPMN เพื่อทำการ Start ตัว Process

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/process/start
HTTP Method: POST
HTTP Request Header: Content-Type: application/json
HTTP Request Body: 	{
	"processName": [String: Process name],
	"appName": [String: App name],
	"uniqueId": [String: Process ID],
	"snapVersion": [String: Snap version],
	"object":{
		Process Business Object        
	}
}
HTTP Response Body: 	{
  				"data" : [String: Reference Instance ID],
  				"code" : [Long: Code value],
  				"timestamp" : [Long: Timestamp value],
  				"totalRecordCount" : [Long: Total record count]
 	}

Start Flow (old but still available)

API สำหรับทำการ start process ที่เมื่อผู้ใช้งานทำการสร้าง application ฝั่งเซิฟเวอร์จะทำการเรียก BPMN เพื่อทำการเริ่ม the process.

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/process/[Process Name]/start
HTTP Method: POST
HTTP Request Header: Content-Type: application/json
HTTP Request Body: 	{
[Object: Business Object with data]
}
HTTP Response Body: 	{
  				"data" : [String: Reference Instance ID],
  				"code" : [Long: Code value],
  				"timestamp" : [Long: Timestamp value],
  				"totalRecordCount" : [Long: Total record count]
 	}

Claim Task

API ที่ใช้สำหรับการรับ task ผู้ใช้งานสามารถหา tasks ที่ต้องการใช้งานและมอบหมายสิทธ์งานให้แก่ผู้ใช้ที่ยังไม่ได้มอบหมาย task ให้อย่างเจาะจงได้ด้วย

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks/[Task ID]/claim?user=[User Name] 

HTTP Method: POST 

HTTP Request Header: n/a 

HTTP Request Body: n/a 

HTTP Response Body: 	{ 

  				"data" : "", 

  				"code" : [Long: Code value], 

  				"timestamp" : [Long: Timestamp value], 

  				"totalRecordCount" : [Long: Total record count] 

 	} 

Complete Task

เมื่อผู้ใช้งานทำการรับสิทธ์ task และทำงานบน task นั้นเสร็จ process runtime จะส่ง method complete แก่ task นั้นเพื่อให้แอปพลิเคชันรู้ แล้วrocess runtime จะได้ทำการย้ายไปยัง node ต่อไป

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks/[Task ID]/complete?user=[User Name] 

HTTP Method: POST 

HTTP Request Header: Content-Type : application/json 

HTTP Request Body: 	{ 

[Object: Business Object with data] 

} 

HTTP Response Body: 	{ 

  				"data" : "", 

  				"code" : [Long: Code value], 

  				"timestamp" : [Long: Timestamp value], 

  				"totalRecordCount" : [Long: Total record count] 

  	} 

Get Task By Instance ID

API สำหรับคืนค่า Array list ข้อมูลของ Task ที่กำลังดำเนินการอยู่ทั้งหมด แต่จะไม่รวมตัวอย่าง business object ของ Process โดยอ้างอิงจาก instance id ของ method "start flow"

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/instance/[Instance ID]/tasks 

HTTP Method: GET 

HTTP Request Header: Content-Type : application/json 

HTTP Request Body: N/A 

HTTP Response Body: { 

  				"data" : [ { 

    					"createBy" : [String: Created by username], 

    					"createTime" : [Long: Created timestamp], 

    					"instanceId" : [String: Reference process instanct ID], 

    					"parentTaskId" : [String: Reference parent task ID], 

    					"dueDate" : [Long: Due date], 

    					"loadlinkEntityId" : [String: Link to reference entity], 

    					"definitionId" : [String: Reference Process definition ID], 

    					"assignee" : [String: User Name], 

    					"loadlinkParam" : [String: Load link parameter by default : "="], 

    					"owner" : [String: Owner User Name], 

    					"description" : [String: Node description], 

    					"processName" : [String: Reference process name], 

    					"name" : [String: Reference Node name], 

    					"priority" : [Long: Task priority start from 1 to 99], 

    					"id" : [String: Reference task ID] 

  				} ], 

  				"code" : [Long: Code value], 

  				"timestamp" : [Long: Timestamp value], 

  				"totalRecordCount" : [Long: Total record count] 

 	} 

Get Task By User/Role

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks?[group/role/user]=[User Name/Role Name/Group Name] 

HTTP Method: GET 

HTTP Request Header: Content-Type : application/json 

HTTP Request Body: N/A 

HTTP Response Body: { 

  				"data" : [ { 

    					"createBy" : [String: Created by username], 

    					"createTime" : [Long: Created timestamp], 

    					"instanceId" : [String: Reference process instanct ID], 

    					"parentTaskId" : [String: Reference parent task ID], 

    					"dueDate" : [Long: Due date], 

    					"loadlinkEntityId" : [String: Link to reference entity], 

    					"definitionId" : [String: Reference Process definition ID], 

    					"assignee" : [String: User Name], 

    					"loadlinkParam" : [String: Load link parameter by default : "="], 

    					"owner" : [String: Owner User Name], 

    					"description" : [String: Node description], 

    					"processName" : [String: Reference process name], 

    					"name" : [String: Reference Node name], 

    					"priority" : [Long: Task priority start from 1 to 99], 

    					"id" : [String: Reference task ID] 

  				} ], 

  				"code" : [Long: Code value], 

  				"timestamp" : [Long: Timestamp value], 

  				"totalRecordCount" : [Long: Total record count] 

 	} 

Get Task Variables

API สำหรับคืนค่าตัวแปร business object จาก process runtime

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks/[Task ID]/variables 

HTTP Method: GET 

HTTP Request Header: N/A 

HTTP Request Body: N/A 

HTTP Response Body: 	{ 

  				"data" : {[Object: Business Object with data]}, 

  				"code" : [Long: Code value], 

  				"timestamp" : [Long: Timestamp value], 

  				"totalRecordCount" : [Long: Total record count] 

 	} 

Assign Task(by users)

API นี้ใช้เพื่อกำหนด candidate ของ Task ซึ่ง API นี้จะให้ list parameter ในกรณีที่มี candidate มากกว่า 1 รายการใน Task

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/tasks/[Task ID]/assign?user=[User Name]&user=[User Name1]..&user=[User Name n] 

HTTP Method: POST 

HTTP Request Header: N/A 

HTTP Request Body: N/A 

HTTP Response Body:  { 

  				"data" : "", 

  				"code" : [Long: Code value], 

  				"timestamp" : [Long: Timestamp value], 

  				"totalRecordCount" : [Long: Total record count] 

            }

Refresh Cache

API ที่ใช้สำหรับรีเฟรชแคชสำหรับทุก Process บน Server

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/refreshCache 
HTTP Method: POST 
HTTP Request Header: N/A 
HTTP Request Body: { 
"process":[], 
"event":"generate" 
} 
HTTP Response Body: { 
  "data" :"", 
  "code" : [Long: Code value], 
  "timestamp" : [Long: Timestamp value], 
  "totalRecordCount" : [Long: Total record count] 
} 

Class Action

API สำหรับการรีเฟรชแคชสำหรับ Process ที่เจาะจง หรือ สร้าง BO จะมีเพียง parameter ที่เกี่ยวข้องกับ process เท่านั้นถึงจะได้รับการอัปเดต

URL: http://[SERVER]:[PORT]/BPMREST/service/runtime/classAction 
HTTP Method: POST 
HTTP Request Header: N/A 
HTTP Request Body: { 
"process":[{uniqueID.appName.processName.snapVersion}], 
"event":"generate" 
} 
HTTP Response Body: { 
  "data" :"", 
  "code" : [Long: Code value], 
  "timestamp" : [Long: Timestamp value], 
  "totalRecordCount" : [Long: Total record count] 
} 

Last updated