# API Interface Description {docsify-ignore-all}
>This document provides a brief explanation of the API interface of by the workflow engine

## Abbreviations and definitions of terms
### Abbreviation
Please refer to the table below for an explanation of the abbreviations involved in this document

| Abbreviation | English Name                  |        |
|--------------|-------------------------------|--------|
| WFMC         | Workflow Management Coalition |        |
| BPM          | Business Process Management   |        |

### Term
Please refer to the table below for an explanation of the terms involved in this document

| Term     | Explanation                                                                                                                                                                                                                                                                                                                                                             |
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Workflow | Workflow is the computational model of a working process，<br>The logic of how the work in the process is organized <br>Represent and calculate rules in a suitable model in a computer,<br>A workflow is a series of interconnected and automated business activities or tasks,<br>We can view the entire business process as a river, where workflows flow through it, |

### Core Entry Class
Source code location：Within the jar package starting with 'horizon workflow pub'<br>
Instance operation and management operation factory class: com.horizon.wf.WorkflowFactory<br>
Instance operation interface class：com.horizon.wf.IWorkflowOperator<br>
Instance Management Interface Class: com.horizon.wf.IWorkflowManager<br>
Instance operation passed in parameter class：com.horizon.wf.bean.WorkParaBean<br>
Instance operation return interface class：com.horizon.wf.IWorkResult<br>
Instance operation implementation class：com.horizon.wf.api.WorkflowOperator<br>
Instance Management Implementation Class: com.horizon.wf.api.WorkflowManager<br>
Instance operation return implementation class：com.horizon.wf.bean.WorkResultBean

![Process operation class diagram](../assets/img/api/operator.png)

### Instance operation invoking description
Create an instance, open an instance, close an instance, and obtain flowing history of the instance；
Flow operation: Submit,Secondary submit,Internal submit,Parallel submit,Free Submit,Save
Return,Return Submission,Return to any node,Internally Return,Add operator,Branch add operator,Tack back,Withdraw ,Transfer,Urge,Add Reviewer,Pre-add Reviewer,Remove Reviewer,Claim ,Initiate Multi-Operator,Send to Read,Read,Jump ,Start sub-process ,Replace Operator,
Terminate 。
All the above operations are implemented through the WorkflowOperator class. The invoking code structure is as follows：
```
    IWorkflowOperator opr = WorkflowFactory.getWorkflowOperator();
    //Operation passed in parameter object
    WorkParaBean inparam = new WorkParaBean();
    //Assign values based on different execution operations
    //Create Instance Method
    IWorkResult result = opr.create(inparam);
    //Open Instance Method
	IWorkResult result = opr.open(inparam);
    //Close Instance Method
	IWorkResult result=opr.close(“workid”,”trackid”,”userid”);
    //Interface methods for process instance operations
    IWorkResult result = opr.operator(inparam);	
```
The specific input parameters need to be encapsulated in the WorkParaBean class, and the parameters mentioned below are the parameters that the WorkParaBean class needs to set.
注：Batch operations can call the operatorsTransactionalConsistency method and the operators method, the former can ensure batch data consistency, while the latter does not guarantee data consistency。

### Instance Management Operation Invoking Description
Instance management operation include:Process transfer,Todo transfer,Activate process,Restore instance data,Pause/Resume Instance,End instance,Replace operator ,Delete instances,Update instance,Query user to-do list/processed/to be read/Previewed
All the above operations are implemented through the WorkflowManager class. The invoking code structure is as follows:
```
    //Obtain Operation Implementation Class
    IWorkflowManager mgr = WorkflowFactory.getWorkflowManager();
```

