UpdateDocument
≥4.6
Interface Function
Update document of the specified Form, and activate workflow at the same time.
Request Parameter
Parameter | Type | Remarks |
---|---|---|
input | UpdateDocumentInput | Update document entity |
[warning] Note
- Can be achieved with SearchItem by specifying DocIds, which is more convenient in some scenarios.
- DocIds is mutually exclusive with SearchItem.
- DocIds has higher priority than SearchItem. If DocIds is specified in parameter, interface ignores SearchItem.
- Order and Size parameters only work with SearchItem and trigger the workflow.
- If the problem of long operation time occurs, the Size parameter can be used to control the amount of data for each operation.
Return Data Type
Without activating workflow: int, where result is 1 for success, and other value for failure. With activating workflow:
List<object>,object is shown as follows:
new
{
dataId = DocId,
result = 1,
msg = result == "1" ? "Process successed" : "To deal with failure"
}
[warning] Note
- Without activating workflow, all documents have the identical result, success or failure.
- With activating workflow, each document has unique result.
Input Sample 1
{
"EntityName": "demoformalias",
"StaffId": "d515f318-40a4-481f-8afb-d4fd5ed3f1a2",
"StaffName": "DemoUser",
"ActionMessage": "Test Web API Update Document",
"FieldsValue": {
"textbx_name": "bbj update",
"textbx_address": "China Hebei"
},
"DocIds": [
"24e6fb5a8c044caebce4cedc8c9b6e49"
]
}
Input Smaple 2
//This sample updates document with Search.
{
"SearchItem": [
{
"Method": "And",
"Name": "Name",
"Operator": "Equal",
"SubSearchItems": null,
"Value": "DemoUser"
}
],
"FieldsValue": {
"IsDeleted": "1"
},
"EntityName": "DemoFormAlias",
"StaffId": "DemoUser",
"StaffName": "DemoUser",
"ActionMessage": "test msg"
}
Input Sample 3
/*
This sample specifies both DocIds and SearchItem,but they are mutually exclusive, and DocIds has higher priority, so SearchItem is ignored.
The final function implemented in this sample is to update two documents specified in DocIds and to activate workflow.
*/
{
"DocIds": [
"a75d1183975a4c7f8983c86f37795e27",
"92b62c1aeaed436abc4b35ac2d45ffe6"
],
"SearchItem": [
{
"Method": "And",
"Name": "Name",
"Operator": "Equal",
"SubSearchItems": null,
"Value": "DemoUser"
}
],
"FieldsValue": {
"IsDeleted": "1"
},
"EntityName": "DemoFormAlias",
"StaffId": "DemoUser",
"StaffName": "DemoUser",
//the parameter of trigger workflow
"ActionCode": "150bc584736a496b9f58412dbd0ce7a7",
"Order": {
"C4-CreateDate": -1
},
"Size": 2,
"ActionMessage": "test msg"
}
Return Sample 1
//Without activating workflow, update document only.
{
"StatusCode": 200,
"Info": "Request (or process) succeeded",
"Data": 1
}
Return Smaple 2
//With activating workflow
{
"StatusCode": 200,
"Info": "Request (or process) succeeded",
"Data": [
{
"dataId": "7d5b134b-3b89-413f-ad4e-86d21f98a62e",
"result": "1",
"msg": "Process successed"
}
]
}