更新时间:2024-07-24 GMT+08:00
分享

保存申请单草稿

功能介绍

保存申请单草稿。

URI

POST /console/servicetask/api/localMethod/save_process_draft/saveAsDraftNew

示例接口地址:{域名(有文根需带文根)}/pdmcore/ipdcworkflowservice/console/servicetask/api/localMethod/save_process_draft/saveAsDraftNew

请求头

使用机机认证调用接口时需传入header:Authorization,其值为机机鉴权token。

请求参数

表1 请求Body参数

参数

是否必选

参数类型

描述

DefinitionArrayParam

Array of DefinitionArrayParam objects

请求参数

表2 DefinitionArrayParam

参数

是否必选

参数类型

描述

blockId

String

区块ID或页面组件的ref

nodeId

String

节点ID

blockType

String

区块类型:xdm/业务组件serverKey,为xdm时需要将数据保存到xdm对应模块中

data

JSONArray object

携带模型数据

表3 blockType详细示例

blockType类型

含义

示例

start_process

发起流程

{

"blockType": "start_process",

"nodeId": "",

"blockId": "",

"data": [

{

"processTemplateName": "Test_file_0426",

"processTemplateVersion": "1",

"businessKey": "P10159322"

}

]

}

save_process_draft

保存草稿

{

"blockType": "save_process_draft",

"nodeId": "",

"blockId": "",

"data": [

{

"processTemplateName": "Test_file_0426",

"processTemplateVersion": "1",

"businessKey": "P10159322"

}

]

}

attachment

附件

{

"nodeId": "StartEvent_1",

"blockType": "attachment",

"blockId": "67c0f8e6",

"data": [

{

"id": "626744214796914688",

"nodeId": "StartEvent_1",

"size": "44894",

"fileName": "测试上传.xlsx",

"nodeName": "启动流程",

"uploadTime": 1714448265168,

"taskId": "",

"creator": "XDM_Developer"

}

]

}

participant

设置参与者

{

"nodeId": "StartEvent_1",

"blockType": "participant",

"blockId": "256cf56f",

"data": [

{

"MiserableCoder": "93172bbfd0f64437956d4c9de9345386"

}

]

}

xdm模型名称

xdm模型

{

"nodeId": "StartEvent_1",

"blockType": "CadInfo",

"blockId": "6f305382",

"data": [

{

"checkInOrCheckOutText": "123456"

}

]

}

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

code

Integer

接口返回码

data

Data object

接口响应数据

orderID

String

请求跟踪流水号

表5 Data

参数

参数类型

描述

currentUserCN

String

当前用户

lastUpdateDate

Integer

最新修改时间

modifier

String

修改人UUID

processTemplateName

String

流程模板名称

templateId

String

流程模板编号

currentUserUuid

String

当前用户UUID

currentUserId

Integer

当前用户ID

bizSeqExtAttrs

Array of strings

业务对象拓展属性集合

lastUpdateUserCN

String

最新修改用户

processTitle

String

流程实例名称

bizSeqExtType

String

业务对象拓展类型名称

state

String

状态

creationUserCN

String

创建用户

lastUpdatedBy

Integer

最新更新人

creator

String

创建人UUID

processTemplateVersion

String

流程模板版本

finished

Boolean

流程是否完成

creationDate

Integer

创建日期

creationUserUuid

String

创建人UUID

createdBy

Integer

创建人

请求示例

[{
	"blockType": "start_process",
	"nodeId": "",
	"blockId": "",
	"data": [{
		"processTemplateName": "Test0425",
		"processTemplateVersion": "4"
	}]
}, {
	"nodeId": "StartEvent_1",
	"blockType": "participant",
	"blockId": "256cf56f",
	"data": [{
		"mainReview": "05209014da3a49faa68056102da7ba35"
	}]
}, {
	"nodeId": "StartEvent_1",
	"blockType": "attachment",
	"blockId": "67c0f8e6",
	"data": []
}, {
	"nodeId": "StartEvent_1",
	"blockType": "EcChangeTypeTemplate",
	"blockId": "fee5a374",
	"data": [{
		"EcChangeType": "11",
		"Version": "22"
	}]
}]

响应示例

状态码: 200

接口返参

{
    "code": 0,
    "data": {
        "currentUserCN": "isc_ipdc_hwx",
        "lastUpdateDate": 1714016191581,
        "modifier": "05209014da3a49faa68056102da7ba35",
        "processTemplateName": "Test0425",
        "templateId": "Test0425",
        "currentUserUuid": "05209014da3a49faa68056102da7ba35",
        "currentUserId": 0,
        "bizSeqExtAttrs": [],
        "lastUpdateUserCN": " ",
        "scope": "otc",
        "rowIdx": -1,
        "processTitle": "Test0425_2024-04-25T11:36:31.527+0800",
        "bizSeqExtType": "WfBusinessSeq",
        "id": "624931966843621376",
        "state": "DRAFT",
        "creationUserCN": " ",
        "creator": "05209014da3a49faa68056102da7ba35",
        "appName": "IpdcWorkflowService",
        "entityType": "business",
        "processTemplateVersion": "1",
        "holdableList": [
            "com.huawei.it.plm.workflow.framework.model.WfFormData",
            "com.huawei.it.plm.workflow.framework.model.WfAttachment",
            "com.huawei.it.plm.workflow.framework.model.WfBusinessObject"
        ],
        "finished": false,
        "creationDate": 1714016191581,
        "creationUserUuid": "05209014da3a49faa68056102da7ba35",
        "holderId": 624931966843621376,
        "businessKey": "P10000372",
        "holderType": "business"
    },
    "orderID": "947bef1124974ea8bf5f380a0ca291a5"
}

状态码

状态码

描述

200

接口返参

错误码

请参见错误码

使用说明

如果需要获得正常的反参,则需在页面上运行一个真实存在的流程,单击保存草稿按钮,从接口中取得相应的入参。否则接口返回是200,返回信息中不会有真实模板的信息。

相关文档