CN108205440A - A kind of task flow framework implementation method for supporting rollback - Google Patents
A kind of task flow framework implementation method for supporting rollback Download PDFInfo
- Publication number
- CN108205440A CN108205440A CN201711425165.3A CN201711425165A CN108205440A CN 108205440 A CN108205440 A CN 108205440A CN 201711425165 A CN201711425165 A CN 201711425165A CN 108205440 A CN108205440 A CN 108205440A
- Authority
- CN
- China
- Prior art keywords
- rollback
- task
- flow
- command
- task flow
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1474—Saving, restoring, recovering or retrying in transactions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
The present invention relates to cloud platform technical field, particularly a kind of task flow framework implementation method for supporting rollback.The present invention first has to formulate template:(1) task flow template, all steps, the front and rear step relationship of step, step that task flow is included in template perform the information such as command, rollback command, step type;(2) task step request and the parameterized template returned;(3) task step required parameter value source template.Then, task flow engine is formulated.The present invention solves and needs that the interface code of multiple component interactions processing is complicated, is difficult to be multiplexed, position and the problems such as abnormal rollback processing in cloud platform;Present invention can apply to it is a variety of need multicompartment interact long task operatings in, such as establishment virtual machine, empty recycle bin.
Description
Technical field
The present invention relates to cloud platform technical field, particularly a kind of task flow framework implementation method for supporting rollback.
Background technology
Cloud platform mainly by calculating, storing, network, monitoring, multiple components such as certification form, there are many operation (as created
Virtual machine empties recycle bin etc.) multiple component interaction cooperations is needed to complete, and many component operations are asynchronous, are needed
The execution state of timing acquisition asynchronous operation could perform other operations down, and can bring problems with:
First, being mingled with too many non-functional function in function code causes the complicated not easy care of code logic;
Second is that code coupling is too high, it is difficult to the division of labor and multiplexing;
It is not easy to position third, exception occurs in operation;
Rollback processing needs to write a lot of codes to realize after four exceptions, easily error and omission.
Invention content
Present invention solves the technical problem that being to provide a kind of task flow framework implementation method for supporting rollback, solve cloud and put down
Need that the interface code of multiple component interactions processing is complicated, is difficult to be multiplexed, position and the problems such as abnormal rollback processing in platform.
The present invention solve above-mentioned technical problem technical solution be:
The method includes the following steps:
Step 1:Formulation task flow template, all steps, front and rear step relationship, step that task flow is included in template perform
Command classes, rollback command classes, step type information;
Step 2:Formulate task step request and the parameterized template returned;
Step 3:Formulate task step required parameter value source template;
Step 4:Formulate task flow engine;
The execution step of the task flow engine is:
(1) the task stream type that will perform, time started, required parameter, operation user information are saved into task flow reality
In example table, all Step Informations of being performed for task in task flow template are saved into task flow case step table, and more
Change flow state to be changed in execution;
(2) the step of next step will perform is obtained according to flow state;
(3) it judges whether there is in next step, has and then enter (4), do not terminate flow then;
(4) according to task step required parameter value source template, obtain flow instance correspond to it is right in the returned data of step
The value of field is answered as the request data of the task step, and performs step;
(5) step implementing result success is then back to (2), otherwise performs (6);
(6) determine whether steps necessary, steps necessary enters (7), inessential to enter (2);
(7) flow state is changed in rollback, and enters (2).
The step type includes COMMAND, JUDGE, and it is that a function performs step that COMMAND, which represents the step,
JUDGE, which represents the step and is one, judges routine branches step;
The front and rear step relationship includes fromId, yToIds, nToIds;
FromId is the step id of the back of current procedures;
YToIds is represented to be empty that in next step, flow will not terminate;
The trend of general step is all to walk yToIds, unless the step of step type stepType is JUDGE, it will according to
The return value Y or N of the command carry out dynamic and judge to move towards;
The step of stepType is JUDGE, and when command dynamics judge to move towards the branch of N by the use of nToIds as
Next step.
The step performs command classes will perform command classes for current procedures;
The execution rollback command classes do operation by current procedures needs the rollback command to be performed during rollback
Class.
The step 2 refers to perform the required parameter and return parameters of command classes or rollback command classes;
The step 3 refers to that the value of the required parameter that step corresponds to command classes in configuration task stream will be from task flow
Value in the returned data of which step, and configuration is the corresponding value of which field of returned data;Can be each command classes
Multiple parameters are configured.
The flow state include perform in, successfully, unsuccessfully, in rollback;
When task flow example state is in non-rollback, by the implementing result of current task step, implementing result success is then
It is obtained in next step by yToIds;It is obtained down when implementing result failure and the step optional step also according to yToIds
One step;Implementing result fails and is steps necessary, and flow enters rollback state;If task flow example state is in rollback, root
According to the task flow example successful execution, rollback and step rollback state is needed to be obtained in reverse order for empty step list
Step.
Present invention introduces task flow frames, and the task flow engine framework of rollback is supported by writing, the non-of those complexity
Functional logic is all put into task flow frame, the Complicated Flow for needing multiple component interaction cooperations, becomes only to need logical
Easy configuration is crossed to can be realized;The execution status system of each step all tracks and records automatically, and abnormal positioning is very convenient;Task flow mould
Each step in plate can be multiplexed;It supports that rolling back action is configured for each step, simplifies at abnormal rollback
The complexity of reason;Very big convenience is provided for developer and be portable multiplexing.The invention enables interface exploitation people
Member, which only needs to be absorbed in, provides the better simply functional interface of logic of unimodule one by one and by being configured these unimodule interfaces
Flexibly collocation is got up for operation, and process is clear, easy orientation problem, and code structure high cohesion lower coupling is accomplished utmostly
Multiplexing, and each unimodule logic function can be dispatched to different developers to realize.
Description of the drawings
The present invention is further described below in conjunction with the accompanying drawings:
Fig. 1 is the method for the present invention template configuration figure;
Fig. 2 is the method for the present invention flow chart;
Fig. 3 is the present invention to create the signal interaction figure of virtual machine instance.
Specific embodiment
As shown in Figs. 1-3, the present invention formulates task flow template first, and all steps, the step of task flow are included in template
Front and rear step relationship, step perform the information such as command classes, rollback command classes:
neccessary:Whether it is necessary condition, when being necessary condition and the failure of step implementing result, it will perform response
Rollback flow;During for inessential condition, no matter operating successfully or failing, it can all perform down;As emptied recycle bin
Command,, will not the failure because of procedure failure as long as performing these delete operations to be non-essential.
fromIds:(the id fields in corresponding task_flow_template tables) is sky, represents the first step of flow;No
For sky, the last consignment of step (can be multiple) of the step is represented;
yToIds:(the id fields in corresponding task_flow_template tables) is sky, is represented that in next step, flow will not
Terminate;The trend of general step is all to walk yToIds, unless the step of stepType is JUDGE, it will moved according to the command
State judges trend;
nToIds:The step of (the id fields in corresponding task_flow_template tables) stepType is JUDGE, and
With this field when command dynamics judge to move towards the branch of N;
The step of stepType is JUDGE determines the trend of flow according to step implementing result dynamic, that is, walks yToIds also
It is nToIds;
async:Whether it is asynchronous operation.
Then task step request and the parameterized template returned are formulated, req represents the required parameter of the command classes, res
Represent the return parameters of the command classes:
id | stepld | commandType | field | fieldType | paramType |
1 | 1 | CreatelnstanceTaskFlowCommand | Instanceld | String | res |
2 | 2 | CreateVolumeTaskFlowCommand | volumes | String | res |
3 | 3 | AttachVolumeTaskFlowCommand | instanceld | String | req |
4 | 4 | AttachVolumeTaskFlowCommand | volumes | String | req |
Then task step required parameter value source template is formulated:
id | flowTypeCode | stepld | field | vFromStepld | resField |
1 | Createlnstance | 3 | instanceld | ||
2 | Createlnstance | 3 | volumes | ||
3 | Createlnstance | 5 | netcardld | ||
4 | Createlnstance | 5 | instanceld |
For example first configuration refers to that the third step required parameter instanceId of this task flow of establishment virtual machine comes
From the InstanceId fields in first step returned data;By these configurations, task flow frame can assemble these automatically
Required parameter, developer only need getReqParams () method to be called to obtain inside command.It is deleted Ru following
Except the command examples of storage volume:
Then task flow engine is formulated:
(1) information such as the task stream type that will perform, time started, required parameter, operation user are saved into task flow
In example table, all Step Informations of being performed for task in task flow template are saved into task flow case step table, and
Change flow state is changed in execution:
(2) the step of next step will perform is obtained according to flow state:
If task flow example state is non-rollback state, by the implementing result of current task step, implementing result into
Work(is then obtained in next step by yToIds;It is obtained when implementing result failure and the step optional step also according to yToIds
It takes in next step;Implementing result fails and is steps necessary, and flow enters rollback state;If task flow example state is rollback
In, according to the task flow example successful execution, need rollback and step rollback state for empty step list in reverse order
Carry out obtaining step.
(3) whether have in next step, have and then enter (4), do not terminate flow then in next step;
(4) according to task step required parameter value source template, obtain flow instance correspond to it is right in the returned data of step
The value of field is answered as the request data of the task step, and performs step;
(5) whether step implementing result succeeds, it is successful then into (2), it is unsuccessful to enter (6);
(6) whether it is steps necessary, steps necessary enters (7), inessential to enter (2);
(7) flow state is changed in rollback, and enters (2).
Claims (7)
1. a kind of task flow framework implementation method for supporting rollback, it is characterised in that:The method includes the following steps:
Step 1:Formulation task flow template, all steps, front and rear step relationship, step that task flow is included in template perform
Command classes, rollback command classes, step type information;
Step 2:Formulate task step request and the parameterized template returned;
Step 3:Formulate task step required parameter value source template;
Step 4:Formulate task flow engine;
The execution step of the task flow engine is:
(1) the task stream type that will perform, time started, required parameter, operation user information are saved into task flow example table
In, all Step Informations of being performed for task in task flow template are saved into task flow case step table, and change stream
Journey state is changed in execution;
(2) the step of next step will perform is obtained according to flow state;
(3) it judges whether there is in next step, has and then enter (4), do not terminate flow then;
(4) according to task step required parameter value source template, acquisition flow instance, which is corresponded in the returned data of step, corresponds to word
Request data of the value of section as the task step, and perform step;
(5) step implementing result success is then back to (2), otherwise performs (6);
(6) determine whether steps necessary, steps necessary enters (7), inessential to enter (2);
(7) flow state is changed in rollback, and enters (2).
2. according to the method described in claim 1, it is characterized in that:
The step type includes COMMAND, JUDGE, and it is that a function performs step, JUDGE generations that COMMAND, which represents the step,
The table step is one and judges routine branches step;
The front and rear step relationship includes fromId, yToIds, nToIds;
FromId is the step id of the back of current procedures;
YToIds is represented to be empty that in next step, flow will not terminate;
The trend of general step is all to walk yToIds, unless the step of step type stepType is JUDGE, it will according to this
The return value Y or N of command carry out dynamic and judge to move towards;
The step of stepType is JUDGE, and by the use of nToIds as next when command dynamics judge to move towards the branch of N
Step.
3. according to the method described in claim 1, it is characterized in that:
The step performs command classes will perform command classes for current procedures;
The execution rollback command classes do operation by current procedures needs the rollback command classes to be performed during rollback.
4. according to the method described in claim 2, it is characterized in that:
The step performs command classes will perform command classes for current procedures;
The execution rollback command classes do operation by current procedures needs the rollback command classes to be performed during rollback.
5. method according to any one of claims 1 to 4, it is characterised in that:
The step 2 refers to perform the required parameter and return parameters of command classes or rollback command classes;
The step 3 refer to step in configuration task stream correspond to the required parameter of command classes value will from task flow which
Value in the returned data of step, and configuration is the corresponding value of which field of returned data;Can be that each command classes are configured
Multiple parameters.
6. method according to any one of claims 1 to 4, it is characterised in that:The flow state include perform in, into
In work(, failure, rollback;
When task flow example state is in non-rollback, by the implementing result of current task step, implementing result success then passes through
YToIds come obtain in next step;It is next to obtain also according to yToIds when implementing result failure and the step optional step
Step;Implementing result fails and is steps necessary, and flow enters rollback state;If task flow example state is in rollback, according to
The task flow example successful execution, rollback and step rollback state is needed to obtain step in reverse order for empty step list
Suddenly.
7. according to the method described in claim 5, it is characterized in that:The flow state include perform in, successfully, unsuccessfully, time
In rolling;
When task flow example state is in non-rollback, by the implementing result of current task step, implementing result success then passes through
YToIds come obtain in next step;It is next to obtain also according to yToIds when implementing result failure and the step optional step
Step;Implementing result fails and is steps necessary, and flow enters rollback state;If task flow example state is in rollback, according to
The task flow example successful execution, rollback and step rollback state is needed to obtain step in reverse order for empty step list
Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711425165.3A CN108205440A (en) | 2017-12-25 | 2017-12-25 | A kind of task flow framework implementation method for supporting rollback |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711425165.3A CN108205440A (en) | 2017-12-25 | 2017-12-25 | A kind of task flow framework implementation method for supporting rollback |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108205440A true CN108205440A (en) | 2018-06-26 |
Family
ID=62605965
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711425165.3A Withdrawn CN108205440A (en) | 2017-12-25 | 2017-12-25 | A kind of task flow framework implementation method for supporting rollback |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108205440A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109495452A (en) * | 2018-10-24 | 2019-03-19 | 苏宁易购集团股份有限公司 | Response timeout processing method, server and client end response timeout treatment system |
CN109656740A (en) * | 2018-12-11 | 2019-04-19 | 国云科技股份有限公司 | A method of supporting timeout treatment task flow |
CN110187941A (en) * | 2019-05-31 | 2019-08-30 | 浪潮云信息技术有限公司 | A kind of system and method that automatic driving function executes |
CN110750269A (en) * | 2019-10-25 | 2020-02-04 | 浪潮云信息技术有限公司 | Software implementation method based on step driving |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120331150A1 (en) * | 2011-06-26 | 2012-12-27 | International Business Machines Corporation | Systems management operationalworkflow templates |
CN104881759A (en) * | 2015-06-23 | 2015-09-02 | 四川久远银海软件股份有限公司 | Business fallback integrated system based on workflow and realization method thereof |
CN105046408A (en) * | 2015-06-25 | 2015-11-11 | 国网山东省电力公司 | Configurable workflow realization method and system |
CN106790455A (en) * | 2016-12-08 | 2017-05-31 | 中国科学院软件研究所 | A kind of distributed cloud management system and method based on mixed mode |
CN106845741A (en) * | 2015-12-03 | 2017-06-13 | 北大方正集团有限公司 | The customization device and customization method of workflow |
CN106897810A (en) * | 2015-12-17 | 2017-06-27 | 北京奇虎科技有限公司 | Method for processing business and system, workflow engine and system, operation system |
-
2017
- 2017-12-25 CN CN201711425165.3A patent/CN108205440A/en not_active Withdrawn
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120331150A1 (en) * | 2011-06-26 | 2012-12-27 | International Business Machines Corporation | Systems management operationalworkflow templates |
CN104881759A (en) * | 2015-06-23 | 2015-09-02 | 四川久远银海软件股份有限公司 | Business fallback integrated system based on workflow and realization method thereof |
CN105046408A (en) * | 2015-06-25 | 2015-11-11 | 国网山东省电力公司 | Configurable workflow realization method and system |
CN106845741A (en) * | 2015-12-03 | 2017-06-13 | 北大方正集团有限公司 | The customization device and customization method of workflow |
CN106897810A (en) * | 2015-12-17 | 2017-06-27 | 北京奇虎科技有限公司 | Method for processing business and system, workflow engine and system, operation system |
CN106790455A (en) * | 2016-12-08 | 2017-05-31 | 中国科学院软件研究所 | A kind of distributed cloud management system and method based on mixed mode |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109495452A (en) * | 2018-10-24 | 2019-03-19 | 苏宁易购集团股份有限公司 | Response timeout processing method, server and client end response timeout treatment system |
CN109495452B (en) * | 2018-10-24 | 2020-08-11 | 苏宁易购集团股份有限公司 | Response timeout processing method, server and client response timeout processing system |
CN109656740A (en) * | 2018-12-11 | 2019-04-19 | 国云科技股份有限公司 | A method of supporting timeout treatment task flow |
CN110187941A (en) * | 2019-05-31 | 2019-08-30 | 浪潮云信息技术有限公司 | A kind of system and method that automatic driving function executes |
CN110750269A (en) * | 2019-10-25 | 2020-02-04 | 浪潮云信息技术有限公司 | Software implementation method based on step driving |
CN110750269B (en) * | 2019-10-25 | 2023-04-21 | 浪潮云信息技术股份公司 | Software implementation method based on step driving |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108205440A (en) | A kind of task flow framework implementation method for supporting rollback | |
CN102520881B (en) | A kind of virtual machine snapshot management method of cloud computing platform and system | |
CN101971143B (en) | Automatic connections between application components | |
CN106354492B (en) | Automatic code generation method and system for quickly adjusting transaction flow docking | |
CN110147225A (en) | A kind of code generating method, device and computer equipment, storage medium | |
KR102016095B1 (en) | System and method for persisting transaction records in a transactional middleware machine environment | |
US20120331012A1 (en) | Decorated model architecture for efficient model-driven application development | |
US11176086B2 (en) | Parallel copying database transaction processing | |
WO2002091179A2 (en) | Method and apparatus for migration of managed application state for a java based application | |
CN106951254B (en) | Method and device for multiplexing similar service function modules in payment system | |
CN110795091B (en) | Modularized route decoupling method, storage medium, electronic equipment and system | |
CN111125067A (en) | Data maintenance method and device | |
US20050204339A1 (en) | Standard application development template | |
CN108038141A (en) | Ensure the method for data consistency under micro services framework HTTP interactive modes | |
US20060129985A1 (en) | Development and execution platform | |
CN114968192A (en) | Project creation method and device, computer equipment and storage medium | |
CN110597821A (en) | Method and device for changing database table structure | |
CN109164996A (en) | A kind of realization android is from principal point screen method and Related product | |
US7305653B2 (en) | Standard application development framework | |
CN112036142A (en) | Real-time report generation method and system based on data configuration | |
CN116360787A (en) | Automatic generation method and device for form codes, electronic equipment and storage medium | |
CN110908644A (en) | Configuration method and device of state node, computer equipment and storage medium | |
US5878428A (en) | System, method, and article of manufacture for adding transactional recovery to a binary class in an object oriented system | |
CN109656740A (en) | A method of supporting timeout treatment task flow | |
CN104462106A (en) | Data updating method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180626 |
|
WW01 | Invention patent application withdrawn after publication |