Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment one
Referring to Fig. 1, present embodiment provides a kind of flow process driving method, and this method flow is specific as follows:
101: determine the flow process element of flow process to be driven, and the flow process behavior of this flow process element correspondence;
102: this flow process element map in the execution object of correspondence, and is assembled to the flow process behavior of this flow process element in the corresponding execution object;
103: the implementation that starts this execution object when externally calling this execution object.
The method that present embodiment provides, by with the flow process element map in the execution object of correspondence, and start the implementation of carrying out object when externally calling this execution object, promptly summarize the behavioural characteristic of various flow process language to carry out object, realization is to the driving of flow process, not only can support block flow process language, also can support figure shape flow process language well, thereby improve the extendability that flow process drives; In addition, because the technical scheme that the embodiment of the invention provides is not bound with any specific data storage layer technology and IOC container, therefore, has very high portability.
Embodiment two
Present embodiment provides a kind of flow process driving method, and this method is passed through the flow process element map in the execution object of correspondence, summarizes the behavioural characteristic of various flow process language to carry out object, realizes the driving to flow process.For convenience of explanation, present embodiment is that example describes with BPMN2.0 flow process language, and Fig. 2 is the synoptic diagram that concerns between this BPMN2.0 flow engine and the flow process drive unit.Referring to Fig. 3, the method flow that present embodiment provides is specific as follows:
301: determine the flow process element of flow process to be driven, and the flow process behavior of this flow process element correspondence;
At this step, each specific flow process language has all comprised various flow process elements, and about flow process element and corresponding flow process behavior how to determine flow process to be driven, present embodiment is not done concrete qualification.With BPMN2.0 flow process language is example, and its flow process element has comprised Process as shown in Figure 4, Activity, and Event, flow process elements such as SequnceFlow, corresponding flow process behavior can be as shown in Figure 5.
302: for this flow process element is selected corresponding execution object;
Particularly, present embodiment represents to carry out object with Executable Object, be seen as a Java Bean, and defined three kinds of processes, be i.e. executive process execute (), wakeup process awaken () and end process complete () with specific behavior.Wherein, execute () is used to carry out service logic, and this service logic is the flow process institute loaded service logic that is mapped in this execution object; Awaken () is used to wake up the execution object, during practical application, recovers to wake up the execution object by carrying out data; Complete () then carries out at execute () and is called after service logic finishes.
Though each carries out object execute () is arranged all, awaken (), three processes of complete (), the specific implementation of these processes is not necessarily identical.Referring to Fig. 6,, can be divided into net (NetInstance), three types of node (NodeInstance) and arcs (ArcInstance) with carrying out object according to the difference of process implementation.Wherein, a net can comprise several interconnected node and arcs; Node can have several input arcs and several output arcs, and each arc must have an input node and an output node; In addition, a net can comprise subnet, and various execution relation between objects can be as shown in Figure 7.
About how being the corresponding execution object of flow process element selection, present embodiment does not limit concrete selection mode, be example still with the flow process element among the BPMN2.0, can select Process flow process element map in the execution object of Net type, flow process such as Activity, Event element map in the execution object of Node type, and with flow process element map such as SequnceFlow in the execution object of Arc type.
303: this flow process element map in the execution object of correspondence, and is assembled to the flow process behavior of this flow process element in the corresponding execution object;
Wherein, after being assembled to the flow process behavior of this flow process element in the corresponding execution object, all can be carried out object and be assembled to the inner core managing device, be in charge of a series of execution objects that cross correlation is arranged by this inner core managing device, externally call when carrying out object, be responsible for calling the implementation of carrying out object by this inner core managing device.
304: the implementation that starts this execution object when externally calling this execution object.
At this step, because the mode of different process definition languages expression institute loaded service logic is different, ExecutableObject can not be hard coded into all situations in the flow process drive unit framework in advance.Therefore, the method that present embodiment provides adopts the design philosophy of extension point to satisfy this demand: for each ExecutableObject has assembled 3 extension points, promptly quote 3 fixing interface: IncomingLogic, BusinessLogic, LeavingLogic, as shown in Figure 8.
Wherein, be provided with canBeFired () object in the IncomingLogic interface, be used to judge whether service logic has satisfied executive condition; Be provided with perform () object among the BusinessLogic, be used to carry out real service logic; Be provided with determineLeavingStragegy () object among the LeavingLogic, be used for when service logic finishes, indicating next step operation, next step operation may be to carry out a new ExecuteObject, also may be to return upper level ExecuteObject, and call its complete () method.
When then starting the implementation of carrying out object, at first call the canBeFired () object that is provided with in the IncomingLogic interface, call the perform () object that is provided with among the BusinessLogic again, call the determineLeavingStragegy () object that is provided with among the LeavingLogic at last, that is to say, when starting the implementation of carrying out object, specifically comprise:
Judge whether to trigger the pairing service logic of execution object;
If then carry out service logic, and after carrying out end, indicate next step operation.
Wherein, carry out service logic, specifically comprise:
Call executive process execute () and carry out service logic, and after carrying out the service logic end, call end process complete ();
Carry out service logic if desired for a long time, the state that then will carry out object is kept in the storage medium, finishes until carrying out service logic, calls wakeup process awaken () and carries out the data recovery, and call end process complete () after data are recovered.
The method that present embodiment provides, by with the flow process element map in the execution object of correspondence, and start the implementation of carrying out object when externally calling this execution object, promptly summarize the behavioural characteristic of various flow process language to carry out object, realization is to the driving of flow process, not only can support block flow process language, also can support figure shape flow process language well, thereby improve the extendability that flow process drives; In addition, because the technical scheme that the embodiment of the invention provides is not bound with any specific data storage layer technology and IOC container, therefore, has very high portability.
Embodiment three
Referring to Fig. 9, present embodiment provides a kind of flow process drive unit, and this device comprises:
Determination module 901 is used for determining the flow process element of flow process to be driven and the flow process behavior of flow process element correspondence;
Mapping block 902 is used for the execution object of flow process element map to correspondence, and the flow process behavior of flow process element is assembled in the corresponding execution object;
Driver module 903 is used for externally calling the implementation that starts the execution object when carrying out object.
Particularly, referring to Figure 10, driver module 903 specifically comprises:
Judging unit 9031 is used for externally calling when carrying out object, judges whether to trigger the pairing service logic of execution object;
Performance element 9032 is used for carrying out service logic when judging unit 9031 judgements can trigger service logic;
Indicating member 9033 is used for indicating next step operation after performance element 9032 is carried out the service logic end.
Further, referring to Figure 11, performance element 9032 specifically comprises:
First calls subelement 9032a, is used to call executive process and carries out service logic;
Second calls subelement 9032b, be used for first call executive process that subelement 9032a calls and carry out service logic and finish after, call the end process;
The 3rd calls subelement 9032c, be used for when first calls that executive process needs that subelement 9032a calls are long-time carries out service logic, the state of carrying out object is kept in the storage medium, finish until carrying out service logic, call wakeup process and carry out the data recovery, and after data are recovered, call the end process.
The device that present embodiment provides, by with the flow process element map in the execution object of correspondence, and start the implementation of carrying out object when externally calling this execution object, promptly summarize the behavioural characteristic of various flow process language to carry out object, realization is to the driving of flow process, not only can support block flow process language, also can support figure shape flow process language well, thereby improve the extendability that flow process drives; In addition, because the technical scheme that the embodiment of the invention provides is not bound with any specific data storage layer technology and IOC container, therefore, has very high portability.
Need to prove: the flow process drive unit that the foregoing description provides is when driving flow process, only the division with above-mentioned each functional module is illustrated, in the practical application, can as required the above-mentioned functions distribution be finished by different functional modules, the inner structure of the equipment of being about to is divided into different functional modules, to finish all or part of function described above.In addition, flow process drive unit that the foregoing description provides and flow process driving method embodiment belong to same design, and its specific implementation process sees method embodiment for details, repeats no more here.
The invention described above embodiment sequence number is not represented the quality of embodiment just to description.
All or part of step in the embodiment of the invention can utilize software to realize that corresponding software programs can be stored in the storage medium that can read, as CD or hard disk etc.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.