# US 2016/0260040 A1 · Computer Device, Method, and Apparatus for Scheduling Business Flow

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0260040 A1
- Document ID: US20160260040A1
- Status: Published application
- Kind: A1
- Application number: 15/153,204
- Filed: 2016-05-12
- Published: 2016-09-08
- Earliest claimed: 2013-11-14
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Junjie Zhou; Vemana Narasimha Murthy; Upasana Haveri
- Web page: https://patentgrep.com/patent/US20160260040A1

## CPC

- G06Q 10/06311: {Scheduling, planning or task assignment for a person or group}
- G06F 9/4843: {by program, e.g. task dispatcher, supervisor, operating system}
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer device, a method, and an apparatus for business flow scheduling. The method for business flow scheduling includes determining that a transaction savepoint is configured on a to-be-scheduled node, creating an asynchronous task according to the transaction savepoint, where the asynchronous task includes a to-be-scheduled task that is on the to-be-scheduled node and that is after the transaction savepoint, using a first thread to execute a transaction that includes a task in the flow other than the asynchronous task, and submitting the transaction executed by the first thread in order to ensure data consistency, and using a second thread to execute the asynchronous task in order to implement transaction splitting between task nodes.

## Claims

### Claim 1

A flow scheduling apparatus configured to execute a flow, wherein the flow comprises at least one node, and wherein the flow scheduling apparatus comprises:
a processor configured to:
determine that a transaction savepoint is configured on a to-be-scheduled node;
create an asynchronous task according to the transaction savepoint, wherein the asynchronous task comprises a to-be-scheduled task configured on the to-be-scheduled node, and wherein the to-be-scheduled task is scheduled after the transaction savepoint;
execute, by a first thread, a transaction comprising a first task in the flow, wherein the first task and the asynchronous task are different;
submit the transaction executed by the first thread; and
execute, by a second thread, the asynchronous task.

### Claim 2 (depends on 1)

The flow scheduling apparatus according to claim 1, wherein the processor is further configured to place the asynchronous task into a to-be-scheduled task queue of a first flow engine process, and wherein the first thread belongs to the first flow engine process.

### Claim 3 (depends on 2)

The flow scheduling apparatus according to claim 2, wherein the processor is further configured to place the asynchronous task into the to-be-scheduled task queue of the first flow engine process when the asynchronous task is created by listening according to a registered transaction submission event callback listener indicating that the transaction executed by the first thread is submitted successfully.

### Claim 4 (depends on 2)

The flow scheduling apparatus according to claim 2, wherein the processor is further configured to:
remove the asynchronous task from the to-be-scheduled task queue when the second thread terminates exceptionally before execution of the asynchronous task is completed; and
execute, by a third thread, the asynchronous task.

### Claim 5 (depends on 1)

The flow scheduling apparatus according to claim 1, wherein the processor is further configured to:
persist the asynchronous task;
store the persisted asynchronous task in a database after the transaction executed by the first thread is submitted;
acquire, by a second flow engine process, the asynchronous task from the database when a first flow engine process terminates exceptionally before execution of the asynchronous task is completed, wherein the second thread belongs to the first flow engine process;
schedule, by the second flow engine process, the asynchronous task; and
execute, by the second flow engine process, the asynchronous task.

### Claim 6 (depends on 1)

The flow scheduling apparatus according to claim 1, wherein the processor is further configured to store the transaction savepoint in a flow definition in a database.

### Claim 7 (depends on 1)

The flow scheduling apparatus according to claim 1, wherein the transaction is a declarative transaction.

### Claim 8

A method for scheduling a business flow, wherein the flow comprises at least one node, and wherein the method comprises:
determining that a transaction savepoint is configured on a to-be-scheduled node;
creating an asynchronous task according to the transaction savepoint, wherein the asynchronous task comprises a to-be-scheduled task configured on the to-be-scheduled node, and wherein the to-be-scheduled task is scheduled after the transaction savepoint;
executing, by a first thread, a transaction comprising a first task in the flow, wherein the first task and the asynchronous task are different;
submitting the transaction executed by the first thread; and
executing, by a second thread, the asynchronous task.

### Claim 9 (depends on 8)

The method according to claim 8, further comprising placing the asynchronous task into a to-be-scheduled task queue of a first flow engine process after submitting the transaction executed by the first thread, wherein the first thread belongs to the first flow engine process.

### Claim 10 (depends on 9)

The method according to claim 9, further comprising registering a transaction submission event callback listener, wherein placing the asynchronous task into the to-be-scheduled task queue of the first flow engine process further comprises placing the asynchronous task into the to-be-scheduled task queue of the first flow engine process when the asynchronous task is created by listening according to the transaction submission event callback listener indicating that the transaction executed by the first thread is successfully submitted.

### Claim 11 (depends on 9)

The method according to claim 9, further comprising:
removing the asynchronous task from the to-be-scheduled task queue when the second thread terminates exceptionally before execution of the asynchronous task is completed; and
executing, by a third thread, the asynchronous task.

### Claim 12 (depends on 8)

The method according to claim 8, further comprising:
persisting the asynchronous task after the creating the asynchronous task; and
storing the persisted asynchronous task in a database after submitting the transaction.

### Claim 13 (depends on 12)

The method according to claim 12, further comprising:
acquiring, by a second flow engine process, the asynchronous task from the database when a first flow engine process terminates exceptionally before execution of the asynchronous task is completed, wherein the second thread belongs to the first flow engine process;
scheduling, by the second flow engine process, the asynchronous task; and
executing, by the second flow engine process, the asynchronous task.

### Claim 14 (depends on 8)

The method according to claim 8, further comprising storing the transaction savepoint in a flow definition in a database.

### Claim 15

A computer device for executing flow scheduling, wherein the computer device is configured to execute a flow comprising at least one node, and wherein the computer device comprises:
a memory configured to store computer executable instructions; and
a processor coupled to the memory and configured to execute the instructions to:
determine that a transaction savepoint is configured on a to-be-scheduled node;
create an asynchronous task according to the transaction savepoint, wherein the asynchronous task comprises a to-be-scheduled task configured on the to-be-scheduled node, and wherein the asynchronous task is scheduled after the transaction savepoint;
execute, by a first thread, a transaction that comprises a first task in the flow, wherein the first task and the asynchronous task are different;
submit the transaction executed by the first thread; and
execute, by a second thread, the asynchronous task.

### Claim 16 (depends on 15)

The computer device according to claim 15, wherein the processor is further configured to execute the instructions to place the asynchronous task into a to-be-scheduled task queue of a first flow engine process when place the asynchronous task is created by listening according to a registered transaction submission event callback listener indicating that the transaction executed by the first thread is submitted successfully.

### Claim 17 (depends on 16)

The computer device according to claim 16, wherein the processor is further configured to execute the instructions to:
remove the asynchronous task from the to-be-scheduled task queue when the second thread terminates exceptionally before execution of the asynchronous task is completed; and
execute, by a third thread, the asynchronous task.

### Claim 18 (depends on 15)

The computer device according to claim 15, wherein the processor is further configured to execute the instructions to:
persist the asynchronous task;
store the persisted asynchronous task in a database after the transaction executed by the first thread is submitted;
acquire, by a second flow engine process, the asynchronous task from the database when a first flow engine process terminates exceptionally before execution of the asynchronous task is completed, wherein the second thread belongs to the first flow engine process;
schedule, by the second flow engine process, the asynchronous task; and
execute, by the second flow engine process, the asynchronous task.
