Computer device, method, and apparatus for scheduling business flow
First Claim
1. A flow scheduling apparatus configured to execute a flow, wherein the flow comprises at least two tasks, and wherein the flow scheduling apparatus comprises:
- a memory comprising instructions; and
a processor coupled to the memory and configured to execute the instructions, which causes the processor to;
determine that a transaction savepoint is in the flow;
create an asynchronous task according to the transaction savepoint, wherein the asynchronous task comprises a to-be-scheduled task, and wherein the to-be-scheduled task is scheduled after the transaction savepoint;
execute, by a first thread, a first transaction comprising a first task in the flow, wherein the first task is scheduled before the transaction savepoint in the flow;
register a transaction submission event callback listener for the first transaction;
submit the first transaction executed by the first thread;
place, by the first thread, the asynchronous task into a to-be-scheduled task queue by listening according to the registered transaction submission event callback listener indicating that the first transaction is submitted successfully;
obtain, by a second thread, the asynchronous task from the to-be-scheduled task queue;
execute, by the second thread, a second transaction comprising the asynchronous task;
persist the asynchronous task;
store the persisted asynchronous task in a database after the first 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.
6 Assignments
0 Petitions
Accused Products
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.
-
Citations
11 Claims
-
1. A flow scheduling apparatus configured to execute a flow, wherein the flow comprises at least two tasks, and wherein the flow scheduling apparatus comprises:
-
a memory comprising instructions; and a processor coupled to the memory and configured to execute the instructions, which causes the processor to; determine that a transaction savepoint is in the flow; create an asynchronous task according to the transaction savepoint, wherein the asynchronous task comprises a to-be-scheduled task, and wherein the to-be-scheduled task is scheduled after the transaction savepoint; execute, by a first thread, a first transaction comprising a first task in the flow, wherein the first task is scheduled before the transaction savepoint in the flow; register a transaction submission event callback listener for the first transaction; submit the first transaction executed by the first thread; place, by the first thread, the asynchronous task into a to-be-scheduled task queue by listening according to the registered transaction submission event callback listener indicating that the first transaction is submitted successfully; obtain, by a second thread, the asynchronous task from the to-be-scheduled task queue; execute, by the second thread, a second transaction comprising the asynchronous task; persist the asynchronous task; store the persisted asynchronous task in a database after the first 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. - View Dependent Claims (2, 3, 4)
-
-
5. A method for scheduling a business flow, wherein the flow comprises at least two tasks, and wherein the method comprises:
-
determining that a transaction savepoint is in the flow; creating an asynchronous task according to the transaction savepoint, wherein the asynchronous task comprises a to-be-scheduled task, and wherein the to-be-scheduled task is scheduled after the transaction savepoint; executing, by a first thread, a first transaction comprising a first task in the flow, wherein the first task is scheduled before the transaction savepoint in the flow; registering a transaction submission event callback listener for the first transaction; submitting the first transaction executed by the first thread; placing, by the first thread, the asynchronous task into a to-be-scheduled task queue by listening according to the registered transaction submission event callback listener indicating that the first transaction is submitted successfully; obtaining, by a second thread, the asynchronous task from the to-be-scheduled task queue; executing, by the second thread, a second transaction comprising the asynchronous task; persisting the asynchronous task; storing the persisted asynchronous task in a database after the first transaction executed by the first thread is submitted; 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. - View Dependent Claims (6, 7)
-
-
8. A computer program product comprising computer executable instructions stored on a non-transitory computer readable medium such that when executed by a processor, cause the processor to execute a method for scheduling a flow comprising at least two tasks, wherein the method comprises:
-
determining that a transaction savepoint is in the flow; creating an asynchronous task according to the transaction savepoint, wherein the asynchronous task comprises a to-be-scheduled task, and wherein the asynchronous task is scheduled after the transaction savepoint; executing, by a first thread, a first transaction that comprises a first task in the flow, wherein the first task is scheduled before the transaction savepoint in the flow; registering a transaction submission event callback listener for the first transaction; submitting the first transaction executed by the first thread; placing, by the first thread, the asynchronous task into a to-be-scheduled task queue by listening according to the registered transaction submission event callback listener indicating that the first transaction is submitted successfully; obtain, by a second thread, the asynchronous task from the to-be-scheduled task queue; executing, by the second thread, a second transaction comprising the asynchronous task; persisting the asynchronous task; storing the persisted asynchronous task in a database after the first transaction executed by the first thread is submitted; 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. - View Dependent Claims (9, 10, 11)
-
Specification