Background technology
Workflow refers to the robotization of a part or whole part under the computer utility environment of business procedure, the process of transmitting document, information or task according to certain predefined rule between a plurality of participants is carried out automatically, thereby realize the business objective of certain expection, perhaps impel the realization of this target.Workflow middleware is the middleware that is used for the supporting business process automation, can realize that by workflow middleware the operation flow between a plurality of enterprise application systems is integrated.
Flow engine is the core of workflow middleware, comprises the most basic object and service, and the scheduling mechanism and the execution mechanism that are used to solve the process flow operation problem, is mainly used in to satisfy flow process and move substantially.Particularly, flow engine will be guaranteed flow process according to existing definition, runs to another node from a node, and the correct execution present node.Usually, flow engine comes control flow from following four aspects: (1) flow definition: promptly annotate defined flow process with a cover definition object; (2) flow scheduling: scheduling mechanism promptly is provided, can guarantees that flow process can handle complicated " process flow diagram structure ",, and guarantee that in labyrinth flow process runs to another node from a node such as serial, parallel, branch, merging etc.; (3) flow performing: promptly when process flow operation arrives certain node, need a cover mechanism solve the problem of whether carrying out this node, how carrying out this node, and keep the node state life cycle; (4) flow instance object: the state and the result that describe the flow instance operation with a cover flow instance object.
At present, the flow process of flow engine definition is a structured process, require flow engine when definition branch-merging, each merge node is necessarily corresponding to a branch node, and at this branch node all nodes to the merge node process corresponding with it, all there is not the transfer that inputs or outputs in this branch-merging, as shown in Figure 1.In Fig. 1, node A is a start node, node D is an end node, Node B is a branch node, node C is a merge node, and node E, F and G are the action node, and branch node B and merge node C constitute branch-merging, to merge node C process node E, node F and node G, node E, node F and node G input or output transfer between branch node C and merge node B at branch node B.Branch node B produces two branches: connect arc 2, node E and be connected the branch that arc 3 is formed, and connect arc 4, node F, connect arc 5, node G and be connected the branch that arc 6 is formed, these two branches shift as the input of merge node C.When two branches did not all arrive merge node C, merge node C waited for that when two branches all arrived merge node C, the input transfer that is combined node C was carried out activating merge node C afterwards, the scheduling of realization flow synchronously.
But structured process can weaken the processing power of flow process for business, make all natural flow processs all very important person's structuring of carrying out of being handle, for can not flexible operation flow, can't use workflow engine to carry out the control of flow process.Therefore propose a kind of non-structure flow process, as shown in Figure 2,, in the node of merge node process, can comprise the transfer that inputs or outputs that is positioned at outside this branch-merging at branch node for the non-structure flow process.In Fig. 2, node G shifts except comprising the output of pointing to merge node C, also comprises the output transfer of pointing to end node D.Because it may be to point to end node D that the output that node G produces is shifted, so can't determining to carry out synchronous input, shifts merge node C, this causes flow engine can't the branch in the flow process dynamically be merged.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of method and device of realizing that branch dynamically merges in the non-structure flow process, can the branch in the flow process dynamically be merged.
For achieving the above object, the invention provides following technical scheme:
A kind of method that realizes that branch in the non-structure flow process dynamically merges comprises: determine the branch between branch node in the flow process and the merge node corresponding with it; Create to wait for branch's tabulation, the characteristic attribute of described branch is stored in described waits branch tabulates; Judge whether described branch can arrive described merge node, if not, then at the described characteristic attribute of waiting for the described branch of deletion in branch's tabulation; Judge whether the described branch that waits for that the characteristic attribute in branch's tabulation characterizes all arrives described merge node, if, then activate described merge node, otherwise, wait for.
Preferably, in said method, the described process of judging whether described branch can arrive described merge node is specially: determine the connection arc in the described branch respectively; Create to connect the arc tabulation, the characteristic attribute of described connection arc is stored in described connection arc tabulation; Judge that output that the node in the described branch produces shifts the characteristic attribute of the connection arc that is satisfied and whether be contained in described connection arc and tabulate, if then described branch can arrive described merge node, otherwise described branch can't arrive described merge node.
Preferably, in said method, the described process of judging whether described branch can arrive described merge node is specially: determine the node in the described branch respectively; Create node listing, the characteristic attribute of described node is stored in described node listing; The characteristic attribute of judging node in described branch subsequent node pointed after finishing whether is contained in described node listing or whether described subsequent node is merge node, if, then described branch can arrive described merge node, otherwise described branch can't arrive described merge node.
A kind of device of realizing that branch in the non-structure flow process dynamically merges comprises: branch's determining unit is used for determining the branch between flow process branch node and the merge node corresponding with it; Wait for branch list creating unit, be used for creating and wait for that branch tabulates; Branch's storage unit is used for characteristic attribute with described branch and is stored in the tabulation of described wait branch; First judging unit is used to judge whether described branch can arrive described merge node; The unit is revised in tabulation, is used for waiting for that described branch's tabulation deletion can not arrive the branch of merge node; Second judging unit is used for judging whether the described branch of the characteristic attribute sign of branch's tabulation that waits for all arrives described merge node.
Preferably, in said apparatus, described first judging unit comprises: connect the arc determination module, be used for determining respectively the connection arc of described branch; Connect arc list creating module, be used for creating the tabulation of connection arc; Connect the arc memory module, be used for the characteristic attribute of described connection arc is stored in described connection arc tabulation; Judge module is used for judging that output that the node of described branch produces shifts the characteristic attribute of the connection arc that is satisfied and whether be contained in described connection arc and tabulate.
Preferably, in said apparatus, described first judging unit comprises: the node determination module is used for the node of definite described branch respectively; The node listing creation module is used to create node listing; The node memory module is used for the characteristic attribute of described node is stored in described node listing; Judge module, whether the characteristic attribute of subsequent node pointed was contained in described node listing or whether described subsequent node is merge node after the node that is used for judging described branch was finished.
By above technical scheme provided by the invention as seen, the method that branch dynamically merges in the realization non-structure flow process provided by the invention, efficiently solve the problem that branch correctly dynamically merges in the non-structure flow process, by branch between branch node and the merge node is analyzed, judge whether branch can arrive merge node, can not arrive in branch under the situation of merge node, this branch of deletion in the input that merge node is being waited for is shifted, and after the branch that can arrive merge node all arrives merge node, activate merge node, realize the dynamic merging of branch.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making under the creative work prerequisite, and the every other embodiment that is obtained belongs to protection domain of the present invention.
The invention provides a kind of method that realizes that branch dynamically merges in the non-structure flow process, can the branch in the destructuring flow process correctly dynamically be merged.
Embodiment one
Referring to Fig. 3, Fig. 3 is a kind of process flow diagram of realizing the method that branch dynamically merges in the non-structure flow process disclosed by the invention.Comprise:
Step S11: determine the branch between branch node in the flow process and the merge node corresponding with it.
Business procedure can regard as one by node be connected the digraph that arc is formed, wherein the node deputy activity connects the ordinal relation between the arc deputy activity.Carry out in the process of flow definition at flow engine, activity according to the node representative defines its attribute, and by connecting adjacent in the arc description flow process two nodes and context, it couples together activity by certain logical order, defined the operation rule between the activity, made flow process to run to end from initialization by definition rule.Branch node and the merge node corresponding with it are determined in the definition of flow engine process of analysis, and the branch between definite branch node and the merge node, think that all branches all are that the input that might arrive merge node is shifted this moment.
Step S12: create and wait for branch's tabulation.
Step S13: the characteristic attribute of branch is stored in the tabulation of wait branch.
Create and wait for branch's tabulation, will be stored at the characteristic attribute of each branch between branch node and the merge node and wait for that this characteristic attribute can characterize branch, and different branches is distinguished in branch's tabulation.In force, can be with the combination of forming a series of connection arc of this branch and node as characteristic attribute, also can will exist only in the connection arc of this branch or branch as characteristic attribute.
Step S14: judge whether branch can arrive merge node, if, then turn to step S16, otherwise, then turn to step S15.
Step S15: the characteristic attribute of this branch of deletion in waiting for branch's tabulation.
Before process flow operation, think that all branches can arrive merge node between branch node and the merge node, but operation along with flow process, the branch that before may arrive merge node finally can not arrive, therefore in the process flow operation process, to the routing condition of branch be detected, judge whether it finally can arrive merge node.If find a certain branch and can't arrive after the merge node along with the operation of flow process, wait for the characteristic attribute deletion that characterizes this branch in branch's tabulation, just this branch is not re-used as the input that merge node will wait for and shifts.
Step S16: judge whether the branch that characteristic attribute characterized that waits in branch's tabulation all arrives merge node, if, then turn to step S17, otherwise, turn to step S16.
Step S17: activate merge node.
After step S15, be stored in and wait for that the branch that the characteristic attribute in branch's tabulation characterizes can arrive merge node, judge whether all branches that can arrive merge node all arrive merge node this moment, if all arrive, then activate this merge node, otherwise continue to wait for.
The method that branch dynamically merges in the realization non-structure flow process provided by the invention, efficiently solve the problem that branch correctly dynamically merges in the non-structure flow process, by branch between branch node and the merge node is analyzed, judge whether branch can arrive merge node, can not arrive in branch under the situation of merge node, this branch of deletion during the input that merge node is being waited for is shifted, and after the branch that can arrive merge node all arrives merge node, activate merge node, realize the dynamic merging of branch.By adopting the method that branch dynamically merges in the realization non-structure flow process disclosed by the invention, flow engine is correctly resolved the branch-combination situation in the non-structure flow process fast, make flow process when definition, in being confined to structured process, do not limited " each merge node is certain for corresponding a branch node; and each branch node is to all nodes of its merge node process; all do not have not this branch-merging internal input or output transfer ", enlarged the business support scope of flow engine.
Embodiment two
Referring to Fig. 4, Fig. 4 is an another kind of process flow diagram of realizing the method that branch dynamically merges in the non-structure flow process disclosed by the invention.Comprise:
Step S21: determine the branch between branch node in the flow process and the merge node corresponding with it.
Step S22: create and wait for branch's tabulation.
Step S23: the characteristic attribute of branch is stored in the tabulation of wait branch.
Step S24: determine the connection arc in each branch.
Step S25: create the tabulation of connection arc, the characteristic attribute that connects arc is stored in the tabulation of connection arc.
Step S26: judge that output that the node in the branch produces shifts the characteristic attribute of the connection arc that is satisfied and whether be contained in and connect during arc tabulates, if, then turn to step S28, otherwise, turn to step S27.
Step S27: deletion can not arrive the characteristic attribute of the branch of merge node in waiting for branch's tabulation.
Step S28: judge whether the branch corresponding with waiting for the characteristic attribute of branch in tabulating all arrives merge node, if, then turn to step S29, otherwise, turn to step S28.
Step S29: activate merge node.
In embodiment two disclosed methods, whether judge whether the branch between branch node and the merge node can arrive merge node, be to be contained in by the characteristic attribute that the connection arc that is satisfied is shifted in the output that the node of judging in the branch produces to connect arc tabulation realization.
For the branch between branch node and merge node, determine the connection arc in each branch respectively, and will characterize the characteristic attribute that connects arc and be stored in and connect during arc tabulates.The characteristic attribute that connects arc can be this forerunner's node and descendant node information that connects arc, also can be the jump condition that connects arc.Operation along with flow process, node in the branch is activated, after this node is finished, producing output shifts, determine the connection arc that this output transfer is satisfied, whether the characteristic attribute of judging this connection arc is contained in connects in the arc tabulation, all is present in and connects during arc tabulates if the characteristic attribute of the connection arc that is satisfied is shifted in the output that all nodes produce in the branch, and then this branch can arrive merge node; Otherwise this branch cannot arrive merge node.
Describe with the flowage structure among Fig. 2 below.
Be stored in and be connected during arc tabulates connecting the characteristic attribute of arc 2,3,4,5 with 6.The jump condition of supposing connection arc 6 is that data are greater than 100, the jump condition that connects arc 8 is that data volume is less than 100, when process flow operation arrives node G, if the data volume that the output that produces after node G finishes is shifted is greater than 100, then its output is shifted to satisfy and is connected arc 6, connect in the arc tabulation by judging that the characteristic attribute that determine to connect arc 6 is contained in, can arrive merge node C by connecting arc 4, node F, connect arc 5, node G and being connected the branch that arc 6 forms this moment; If the data volume that the output that produces after node G finishes is shifted is less than 100, then its output is shifted to satisfy and is connected arc 8, connect in the arc tabulation by judging that the characteristic attribute that determine to connect arc 8 is not contained in, cannot arrive merge node C by connecting arc 4, node F, connect arc 5, node G and being connected the branch that arc 6 forms this moment.
Embodiment three
Referring to Fig. 5, Fig. 5 is the process flow diagram of the method that branch dynamically merges in another realization non-structure flow process disclosed by the invention.Comprise:
Step S31: determine the branch between branch node in the flow process and the merge node corresponding with it.
Step S32: create and wait for branch's tabulation.
Step S33: the characteristic attribute of branch is stored in the tabulation of wait branch.
Step S34: determine the node in each branch.
Step S35: create node listing, the characteristic attribute of node is stored in node listing.
Step S36: whether the characteristic attribute of judging the subsequent node of pointing to after node in the branch is finished is contained in the node listing or whether described subsequent node is merge node, if, then turn to step S38, otherwise, turn to step S37.
Step S37: deletion can not arrive the characteristic attribute of the branch of merge node in waiting for branch's tabulation.
Step S38: judge whether the branch corresponding with waiting for the characteristic attribute of branch in tabulating all arrives merge node, if, then turn to step S39, otherwise, turn to step S38.
Step S39: activate merge node.
In embodiment three disclosed methods, whether judge whether the branch between branch node and the merge node can arrive merge node, be to be contained in the node listing or whether this subsequent node is that merge node is realized by the characteristic attribute of judging node in branch subsequent node pointed after finishing.
For the branch between branch node and merge node, determine the node in each branch respectively, and the characteristic attribute that will characterize node is stored in the node listing.The characteristic attribute of node can be template ID, also can be two connection arc information that connect this node.Operation along with flow process, node in the branch is activated, after node is finished, producing output shifts, and the connection arc that satisfies according to the output transfer is transferred to subsequent node, whether the characteristic attribute of judging this subsequent node is contained in the node listing or whether this subsequent node is merge node, if the nodal community of the subsequent node pointed of the node in the branch all is contained in the node listing or subsequent node is a merge node, then this branch can arrive merge node; Otherwise this branch can not arrive merge node.
Describe with the flowage structure among Fig. 2 below.
The characteristic attribute of Node B, C, E, F and G is stored in the node listing.When process flow operation when the node G, be merge node C if subsequent node pointed is shifted in the output that node G produces after finishing, can arrive merge node C by connecting arc 4, node F, connect arc 5, node G and being connected the branch that arc 6 forms this moment; If it is D that subsequent node pointed is shifted in the output that produces after node G finishes, by judging that the characteristic attribute of determining node D is not contained in the node listing, cannot arrive merge node C by connecting arc 4, node F, connect arc 5, node G and being connected the branch that arc 6 forms this moment.
The invention also discloses a kind of device of realizing that non-structure flow process branch dynamically merges, corresponding with method disclosed by the invention, can the branch in the flow process dynamically be merged.
Referring to Fig. 6, Fig. 6 is a kind of structural representation of realizing the device that non-structure flow process branch dynamically merges disclosed by the invention.
This device comprises: the unit 65 and second judging unit 66 are revised in branch's determining unit 61, wait branch list creating unit 62, branch's storage unit 63, first judging unit 64, tabulation.
Wherein, branch's determining unit 61 is used for determining the branch between flow process branch node and the merge node corresponding with it; Wait for branch list creating unit 62, be used for creating and wait for that branch tabulates; Branch's storage unit 63 is used for described branch is stored in the tabulation of described wait branch; First judging unit 64 is used to judge whether described branch can arrive described merge node; Unit 65 is revised in tabulation, is used for waiting for that described branch's tabulation deletion can not arrive the branch of merge node; Second judging unit 66 is used for judging whether the described branch of branch's tabulation that waits for all arrives described merge node.
In force, the structure of first judging unit 64 can comprise as shown in Figure 7: connect arc determination module 6401, connect arc list creating module 6402, connect arc memory module 6403 and judge module 6404.
Connect arc determination module 6401, be used for determining respectively the connection arc of described branch; Connect arc list creating module 6402, be used for creating the tabulation of connection arc; Connect arc memory module 6403, be used for the characteristic attribute of described connection arc is stored in described connection arc tabulation; Judge module 6404 is used for judging that output that the node of described branch produces shifts the characteristic attribute of the connection arc that is satisfied and whether be contained in described connection arc and tabulate.
In addition, the structure of first judging unit 64 can comprise as shown in Figure 8: node determination module 6411, node listing creation module 6412, node memory module 6413 and judge module 6414.
Node determination module 6411 is used for the node of definite described branch respectively; Node listing creation module 6412 is used to create node listing; Node memory module 6413 is used for the characteristic attribute of described node is stored in described node listing; Judge module 6414, whether the characteristic attribute of subsequent node pointed was contained in described node listing or whether this subsequent node is merge node after the node that is used for judging described branch was finished.
Each embodiment adopts the mode of going forward one by one to describe in this instructions, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For the disclosed device of embodiment, because it is corresponding with the embodiment disclosed method, so description is fairly simple, relevant part partly illustrates referring to method and gets final product.
It will be understood by those skilled in the art that and to use many different technologies and in the technology any one to come expression information, message and signal.For example, the message of mentioning in the above-mentioned explanation, information can be expressed as voltage, electric current, electromagnetic wave, magnetic field or magnetic particle, light field or above combination in any.