# Secondary
> Add secondary operator、Secondary submit

![Process operation](../../assets/img/rest/flowaction/addAuthor.png)
## Add secondary operator
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address: http://127.0.0.1:8080/demo/horizon/workflow/rest/flow/support/action{suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "workId": "HZ28858f816b341e01816b4300f30066",
  "trackId": "HZ28858f816b341e01816b4300f30067",
  "actionData": {
    "nextNodes": [
      {
        "authors": {
          "Author": {
            "selectAuthor": "U_HZ28821856ef63420156ef6342a20002/D_HZ28821856ef63420156ef6342a20001",
            "selectAuthorName": "User01(Test Department0)"
          }
        },
        "isSelect": "true",
        "nodeId": "Node1",
        "nodeKey": "Node1",
        "selectId": "Node1"
      }
    ],
    "operate": "addSecondauthor",
    "operateFlag": "0",
    "operateText": "Add secondary operator",
    "operateClazz": "com.horizon.wf.action.ActionAddSecondAuthor"
  }
}
```
Request Parameter Description:

| Parameter   | Required | Description                                    |
|-------------|----------|------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID |
| workId      | Yes      | Instance ID                                    |
| trackId     | Yes      | Track ID of flow                               |
| actionData  | Yes      | Process operation JSON array                   |
actionData parameter:

| Parameter    | Required | Description                                                                                                             |
|--------------|----------|-------------------------------------------------------------------------------------------------------------------------|
| operate      | Yes      | Add secondary operation identification：addSecondauthor                                                                  |
| operateFlag  | Yes      | Operation flag, fixed value 0                                                                                           |
| operateText  | Yes      | Operation name, fixed value: 'Add secondary operator'                                                                   |
| operateClazz | Yes      | Add the path for the secondary operation class, with a fixed value of 'com. horizon. wf. action. ActionAddSecondAuthor' |
| nextNodes    | Yes      | List of nodes to be selected                                                                                            |
nextNodes Parameter Description：

| Parameter | Required | Description                                                                                                       |
|-----------|----------|-------------------------------------------------------------------------------------------------------------------|
| authors   | Yes      | In the next node, the key in the operator object is ‘Operator’, and the value is the ‘Operator’ object parameter. |
| isSelect  | Yes      | Has it been selected                                                                                              |
| nodeId    | Yes      | Node ID to be selected                                                                                            |
| nodeKey   | Yes      | Node primary key                                                                                                  |
| selectId  | Yes      | Selected node id                                                                                                  |
AuthorObject Parameter Description

：

| Parameter        | Required | Description                 |
|------------------|----------|-----------------------------|
| selectAuthor     | Yes      | Selected operator id        |
| selectAuthorName | Yes      | Selected operator user name |
**Example of returned results：**
```
{
  "nextNodeId": "Node1",
  "nextNodes": [
    {
      "authors": {
        "Author": {
          "authorFlowVar": "",
          "authorId": "Author",
          "authorName": "Operator",
          "freeArea": "",
          "isDefUser": "false",
          "isFree": "true",
          "isSelect": "true",
          "isUser": "false",
          "selectType": "checkbox"
        }
      },
      "isDone": "false",
      "isSelect": "true",
      "isShowTabs": "false",
      "memo": "",
      "nodeGroup": "",
      "nodeId": "Node1",
      "nodeKey": "Node1",
      "nodeName": "Task1",
      "nodeStatus": "0",
      "selectId": "Node1",
      "selectName": "Secondary(Task1)"
    }
  ],
  "operate": "addSecondauthor",
  "operateClazz": "com.horizon.wf.action.ActionAddSecondAuthor",
  "operateFlag": "0",
  "operateMsg": "Add secondary operator successful",
  "status": 0,
  "workId": "HZ28858f8103505e0181035ea9c70040"
}
```
**Result parameter description:**

| Parameter    | Type   | Description                                                                        |
|--------------|--------|------------------------------------------------------------------------------------|
| nextNodeId   | String | Next node ID (used when the next node ID is known and there is only one next node) |
| nextNodes    | List   | NList of next nodes to be selected                                                 |
| operate      | String | Secondary operation identification                                                 |
| operateClazz | String | Secondary operation path                                                           |
| operateText  | String | Operation display name                                                             |
| operateFlag  | String | Operation flag -1: Display closed, 0: Normal submission, 1: Pre submissionn        |
| operateMsg   | String | Return operation information                                                       |
| workId       | String | Instance ID                                                                        |
| status       | String | Process operation result status code                                               |
*nextNodes Parameter Description：*

| Parameter  | Type   | Description                                                                                                               |
|------------|--------|---------------------------------------------------------------------------------------------------------------------------|
| authors    | Map    | The key in the operator map of the next node is 'Operator', and value is the Operator object parameter                    |
| isDone     | String | Has it already passed by                                                                                                  |
| isSelect   | String | Has it been selected                                                                                                      |
| isShowTabs | String | Show operator tab?                                                                                                        |
| memo       | String | Memo                                                                                                                      |
| nodeGroup  | String | Node grouping, with no value for a single node. When the current node has branch nodes, the value is the previous node ID |
| nodeId     | String | Node ID                                                                                                                   |
| nodeKey    | String | Node primary key                                                                                                          |
| nodeName   | String | Node Name                                                                                                                 |
| nodeStatus | String | Node status: 0. Success; 1. Select operator; 2. Select node;3. Operator not found; 4. Next node not found                 |
| selectId   | String | Node ID to be selected                                                                                                    |
| selectName | String | Node name to be selected                                                                                                  |
*Author Parameter Description：*

| Parameter     | Type   | Description                                                                |
|---------------|--------|----------------------------------------------------------------------------|
| authorFlowVar | String | Process variables                                                          |
| authorId      | String | Operator ID                                                                |
| authorName    | String | Name of operator: primary operator, secondary operator, reader             |
| freeArea      | String | Scope of free choice                                                       |
| selectType    | String | User selection type, radio: single selection; checkbox: multiple selection |
| isFree        | String | Whether to choose freely?                                                  |
| isUser        | String | Only select personnel?                                                     |
| isDefUser     | String | Select from the process definition list                                    |
| isSelect      | String | Is it allowed to select the operator                                       |

## Secondary submit
>Only when the process has secondary，Secondary submit operation can be carried out.

Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address: http://127.0.0.1:8080/demo/horizon/workflow/rest/flow/support/action{suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "workId": "HZ28858f8103505e0181049de50f008f",
  "trackId": "HZ28858f8103505e0181049de50f0090",
  "actionData": {
    "operate": "secondSubmit",
    "operateClazz": "com.horizon.wf.action.ActionSubmitNotLeave"
  }
}
```
Request Parameter Description:

| Parameter   | Required | Description                                    |
|-------------|----------|------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID |
| workId      | Yes      | Instance ID                                    |
| trackId     | Yes      | Track ID of flow                               |
| actionData  | Yes      | Other submitted data                           |
actionData parameter:

| Parameter    | Required | Description                                                                                  |
|--------------|----------|----------------------------------------------------------------------------------------------|
| operate      | Yes      | Assist submit operation identifier, fixed value                                              |
| operateClazz | Yes      | Assist submit operation class path, fixed value 'com.horizon.wf.action.ActionSubmitNotLeave' |
**Example of returned results：**
```
{
  "alert": "true",
  "operate": "AssistSubmit",
  "operateClazz": "com.horizon.wf.action.ActionSubmitNotLeave",
  "operateFlag": "1",
  "operateMsg": "Successfully assist submitted (without leaving the node)",
  "operateStatus": "success",
  "reOpen": "false",
  "status": 0,
  "workId": "HZ28858f8103505e0181049de50f008f"
}
```

**Result parameter description:**

| Parameter     | Type   | Description                                                       |
|---------------|--------|-------------------------------------------------------------------|
| alert         | String | Whether to pop up a successful operation message, can be ignored  |
| operate       | String | Secondary submit operation identification                         |
| operateClazz  | String | Secondary submit operation class path, fixed value                |
| operateFlag   | String | Operation flag -1: Closed, 0: Normal submission, 1:Pre submission |
| operateMsg    | String | Process operation return information                              |
| operateStatus | String | Process operation results                                         |
| reOpen        | String | Whether to reopen, can be ignored                                 |
| status        | int    | Process operation status code                                     |
| workId        | String | Instance ID                                                       |
