Alfresco API

POST / tasks / {taskId} / items

基本信息

为给定任务taskId创建一个项目。

如果该项目已经是该任务的一部分,则该请求将无效。

Note:您可以通过在JSON主体中指定一个流程条目列表来启动多个流程,如下所示:

[
  {
     "processDefinitionKey": "activitiAdhoc",
     "variables": {
        "bpm_assignee": "fred"
    }
  },
  {
     "processDefinitionKey": "activitiAdhoc",
     "variables": {
        "bpm_assignee": "joe"
    }
]

如果将列表指定为输入,则在响应正文中返回分页列表而不是条目。 例如:

{
  "list": {
    "pagination": {
      "count": 2,
      "hasMoreItems": false,
      "totalItems": 2,
      "skipCount": 0,
      "maxItems": 100
    },
    "entries": [
      {
        "entry": {
          ...
        }
      },
      {
        "entry": {
          ...
        }
      }
    ]
  }
}

请求方式 POST

请求API / processes

响应等级(状态201)

成功回应

{
  "list": {
    "pagination": {
      "count": 0,
      "hasMoreItems": true,
      "totalItems": 0,
      "skipCount": 0,
      "maxItems": 0
    },
    "entries": [
      {
        "entry": {
          "id": "string",
          "name": "string",
          "value": 0,
          "title": "string",
          "description": "string",
          "mimeType": "string",
          "createdBy": {
            "id": "string",
            "firstName": "string",
            "lastName": "string",
            "description": "string",
            "avatarId": "string",
            "email": "string",
            "skypeId": "string",
            "googleId": "string",
            "instantMessageId": "string",
            "jobTitle": "string",
            "location": "string",
            "company": {
              "organization": "string",
              "address1": "string",
              "address2": "string",
              "address3": "string",
              "postcode": "string",
              "telephone": "string",
              "fax": "string",
              "email": "string"
            },
            "mobile": "string",
            "telephone": "string",
            "statusUpdatedAt": "2021-01-15T07:50:19.290Z",
            "userStatus": "string",
            "enabled": true,
            "emailNotificationsEnabled": true
          },
          "createdAt": "2021-01-15T07:50:19.290Z",
          "edited": true,
          "modifiedBy": {
            "id": "string",
            "firstName": "string",
            "lastName": "string",
            "description": "string",
            "avatarId": "string",
            "email": "string",
            "skypeId": "string",
            "googleId": "string",
            "instantMessageId": "string",
            "jobTitle": "string",
            "location": "string",
            "company": {
              "organization": "string",
              "address1": "string",
              "address2": "string",
              "address3": "string",
              "postcode": "string",
              "telephone": "string",
              "fax": "string",
              "email": "string"
            },
            "mobile": "string",
            "telephone": "string",
            "statusUpdatedAt": "2021-01-15T07:50:19.290Z",
            "userStatus": "string",
            "enabled": true,
            "emailNotificationsEnabled": true
          },
          "modifiedAt": "2021-01-15T07:50:19.290Z",
          "size": 0
        }
      }
    ]
  }
}

响应内容类型 applicaiton/json

Path参数

名称 类型 是否必填 示例值 描述
taskId string   任务的标识符。

Body参数(itemBody

request body示例

{
  "processDefinitionKey": "string",
  "variables": {
    "bpm_assignee": "string",
    "bpm_sendEMailNotifications": true,
    "bpm_workflowPriority": 0
  }
}

错误信息描述

状态码 原因
400 无效的参数:itemBody无效
401 验证失败
404 taskId不存在
default 意外错误

返回结果示例

{
  "error": {
    "errorKey": "string",
    "statusCode": 0,
    "briefSummary": "string",
    "stackTrace": "string",
    "descriptionURL": "string",
    "logId": "string"
  }
}