A kind of automatization's code generating method of quick adjustment transaction flow docking and system
Technical field
The present invention relates to field of computer technology, automatization's code of more particularly, to a kind of quick adjustment transaction flow docking
Generation method and system.
Background technology
Existing electric business platform docking project groundwork includes: commodity synchronization, transaction flow control, event handling, number
According to multiple projects such as analysis, display data outputs.And the different electric business platforms that run in existing project are poor in transaction flow
Different very big problem, in this process, needs programmer to carry out the work such as code development, multiple when being related in a model
During table structure, even if it is related to the newly-increased, modification of field and deletes it is also desirable to re-start the making of code, so that
In code generation process, need excessive artificial participation and need substantial amounts of time and manpower to carry out the code system of repeatability
Make work.
Existing code generator be usually according to a kind of specific form, generate a kind of mesh that defines of specific frame
The file of the naming rule of directory structures and this specific frame predefined, and in actual project middle frame and catalogue each side
Should be customized by project itself, in use cannot log history script change record each time, do not possess yet with
The ability that script in once changing merges automatically.
And the existing code generator overwhelming majority requires connect in corresponding data base, rely on the support of data base
Enable the generation of code, and be generally subject to account number cipher and corresponding dictionary reading authority to be limited, using being not very
Convenient.
For different transaction flows in electric business platform in prior art, backstage will will be entered respectively to each transaction flow
Row coding, between different transaction flows cannot mating operation amount big, the time of expending is long, causes substantial amounts of overprogram work.
Therefore, prior art has yet to be improved and developed.
Content of the invention
In view of the deficiencies in the prior art, present invention aim at provide a kind of automatization of quick adjustment transaction flow docking
Code generating method and system are it is intended to solve will be to every for different transaction flows in electric business platform, backstage in prior art
Individual transaction flow will be encoded respectively, between different transaction flows cannot mating operation amount big, the time of expending is long, causes a large amount of
Overprogram work defect.
Technical scheme is as follows:
A kind of automatization's code generating method of quick adjustment transaction flow docking, wherein, method includes:
A, each transaction flow obtaining in advance in electric business platform, each transaction flow is abstracted into corresponding flow operations group
Part, obtains the corresponding Code Template of flow operations assembly and is stored in Component Gallery;
The code configuration parameter of the corresponding transaction flow of code to be generated that b, acquisition are inputted by user interface, according to obtain
Code configuration parameter obtains structured data;
C, corresponding Code Template is extracted from Component Gallery according to the type of the corresponding transaction flow of code to be generated and code;
D, structured data and code configuration parameter are filled in the Code Template of extraction, obtain code to be generated.
Automatization's code generating method of described quick adjustment transaction flow docking, wherein, described a also includes:
Between a1, each flow operations assembly, data conversion is carried out by data adapter unit.
Automatization's code generating method of described quick adjustment transaction flow docking, wherein, also includes after described d:
Execute after e, the described code to be generated of acquisition, the docking of adjustment transaction flow.
Automatization's code generating method of described quick adjustment transaction flow docking, wherein, also includes before described a:
S1, described data adapter unit and described flow operations assembly are stored in particular category in the form of plug-in unit.
Automatization's code generating method of described quick adjustment transaction flow docking, wherein, described a also includes:
A2, obtain the flow operations assembly of user input, and judge whether the flow operations assembly of user input meets Component Gallery
Element format, if meeting, the corresponding code of flow operations assembly of user input being added to Component Gallery and form new generation
Code mask.
A kind of automatization's code generating system of quick adjustment transaction flow docking, wherein, system includes:
Code Template memory module, for obtaining each transaction flow in electric business platform in advance, will be abstract for each transaction flow
Become corresponding flow operations assembly, obtain the corresponding Code Template of flow operations assembly and be stored in Component Gallery;
Data acquisition module, for obtaining the code configuration of the corresponding transaction flow of code to be generated inputting by user interface
Parameter, the code configuration parameter according to obtaining obtains structured data;
Template extraction module, extracts corresponding for the type according to the corresponding transaction flow of code to be generated and code from Component Gallery
Code Template;
Code generation module, for being filled into structured data and code configuration parameter in the Code Template of extraction, is treated
Generate code.
Automatization's code generating system of described quick adjustment transaction flow docking, wherein, described Code Template storage
Module also includes:
Date Conversion Unit, carries out data conversion between individual flow operations assembly by data adapter unit.
Automatization's code generating system of described quick adjustment transaction flow docking, wherein, described system also includes:
Transaction flow, to connection module, for obtaining execution after described code to be generated, adjusts the docking of transaction flow.
Automatization's code generating system of described quick adjustment transaction flow docking, wherein, described system also includes:
Memory module, is stored in particular category for described data adapter unit and described flow operations assembly in the form of plug-in unit
In.
Automatization's code generating system of described quick adjustment transaction flow docking, wherein, described Code Template storage
Module also includes:
Code Template adding device, for obtaining the flow operations assembly of user input, and judges the flow operations of user input
Whether assembly meets the Element format of Component Gallery, if meeting, the corresponding code of flow operations assembly of user input is added
Form new Code Template to Component Gallery.
The invention provides a kind of automatization's code generating method of quick adjustment transaction flow docking and system, the present invention
The commodity of different businessmans and transaction flow can be analyzed it is only necessary to speed code life is carried out by graphical operation and parameter setting
Become, accelerate docking development process, reduce overprogram work.
Brief description
Fig. 1 is the preferred embodiment of automatization's code generating method of a kind of quick adjustment transaction flow docking of the present invention
Flow chart.
Fig. 2 is the preferred embodiment of automatization's code generating system of a kind of quick adjustment transaction flow docking of the present invention
Operation principle schematic diagram.
Fig. 3 is the preferred embodiment of automatization's code generating system of a kind of quick adjustment transaction flow docking of the present invention
Functional schematic block diagram.
Specific embodiment
For making the purpose of the present invention, technical scheme and effect clearer, clear and definite, below to the present invention further specifically
Bright.It should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The invention provides a kind of preferred embodiment of automatization's code generating method of quick adjustment transaction flow docking
Flow chart, as shown in figure 1, wherein, method includes:
Step s100, each transaction flow obtaining in advance in electric business platform, each transaction flow is abstracted into corresponding flow process
Operating assembly, obtains the corresponding Code Template of flow operations assembly and is stored in Component Gallery.
When being embodied as, the transaction flow in electric business platform includes but is not limited to shopping cart, order, payment, comment, popularization
Etc. flow process.In docking, different businessman is variant and have general character in transaction flow.According to general character therein, using figure
The mode changed designs elementary event element;By patterned operation, realize flow process docking.
Each transaction flow is taken out various flow operations assemblies, such as shopping cart, order, payment, comment, popularization etc.
Deng.Each flow operations assembly corresponds to a node, and each node is the program module of functional independence, passes through between functional module
Data flow interacts.The code of the realization of node is Code Template, is stored in Component Gallery.
In the examples below, represent flow operations assembly with node.
Further, step s100 also includes:
Between step s101, each flow operations assembly, data conversion is carried out by data adapter unit.
When being embodied as, because the service logic that each assembly is processed is different, so in order to be connected each node, needing
Place a data adapter unit between two nodes of linking, effect is by data conversion.
Further, step s100 also includes:
Step s102, obtain the flow operations assembly of user input, and judge whether the flow operations assembly of user input meets
The Element format of Component Gallery, if meeting, the corresponding code of flow operations assembly of user input being added to Component Gallery and is formed
New Code Template.
When being embodied as, user also can add self-defining node according to concrete service needed, as long as according to specification and group
The assembly of the assembly identical protocol realization in part storehouse just can realize seamless access, becomes the assembly of Component Gallery.
In further embodiment, also include before step s100:
Step s1, described data adapter unit and described flow operations assembly are stored in particular category in the form of plug-in unit.
When being embodied as, node, data adapter unit are occurred with card format, and this Plugin Mechanism makes the user can flexible root
Extend " Code Generator " according to concrete business demand.
Node, data adapter unit, each node between flow process relation technically reflect be xml configuration
Fragment, then operation flow is executed according to the xml fragment of parsing by analytics engine.Part xml fragment code is as follows:
<config>
<!-- component definition node -- >
<node>
<!-- define group id-- belonging to node >
<groupid></groupid>
<!-- defining unique mark in affiliated group for the node -- >
<artifactid></ artifactid >
<!-- defining being specifically defined of nodal community -- >
<define></define>
</node>
<!-- adapter node -- >
<adapter>
<!-- define group id-- belonging to node >
<groupid></groupid>
<!-- defining unique mark in affiliated group for the node -- >
<artifactid></ artifactid >
<!-- defining the preposition node of adapter -- >
<prenode>
<!-- group id-- belonging to preposition node >
<groupid></groupid>
< !-- preposition node unique mark in affiliated group -- >
<artifactid></ artifactid >
</prenode>
<!-- defining the rearmounted node of adapter -- >
<nextnode>
<!-- group id-- belonging to rearmounted node >
<groupid></groupid>
<!-- rearmounted node unique mark in affiliated group -- >
<artifactid></ artifactid >
</nextnode>
</adapter>
</config>
Above fragment code respectively defines component definition node and adapter node.Wherein node defined in component definition node
Affiliated group id, define unique mark in affiliated group for the node, and being specifically defined of nodal community.Fixed in adapter node
Group id belonging to node for the justice, definition unique mark in affiliated group for the node, and define the preposition node of adapter, preposition
The group id of node, the unique mark in affiliated group of preposition node, the rearmounted node defining adapter, group id of rearmounted node,
The data such as the unique mark in affiliated group of rearmounted node.
The code configuration ginseng of the corresponding transaction flow of code to be generated that step s200, acquisition are inputted by user interface
Number, the code configuration parameter according to obtaining obtains structured data.
When being embodied as, transaction flow is shown on a user interface by user, and obtain input in user interface to be generated
The code configuration parameter of the transaction flow of code, obtains structured data according to code configuration parameter.Wherein structural parameters refer to not
With the corresponding data including ad hoc structure of code.Carry out bottom layer realization using java language in the present invention.Also can be passed through it
He realizes programming language.
Step s300, in corresponding generation, is extracted from Component Gallery according to the type of the corresponding transaction flow of code to be generated and code
Code mask.
When being embodied as, if code user is detected is java code, obtain the transaction flow that user will adjust,
The corresponding Code Template that type of code is java code is obtained from Component Gallery.
Step s400, structured data and code configuration parameter are filled in the Code Template of extraction, obtain to be generated
Code.
When being embodied as, realize the structured data obtaining and user configured configuration information are filled into the code of extraction
In template, obtain code to be generated.Wherein, the filling of Code Template is based on keyword principle, carries out at keyword content
The replacement of relevant position, such as table name, column region, comment field etc., before content is not yet completed, they will not replace
Change, but each assembled according to grammatical ruless;In addition, the base attribute data type in interface template is also based on one
Individual template classification is completing, and be finally completed unified keyword check, type definition limits etc..
In further embodiment, also include after step s400:
Execute after step s500, the described code to be generated of acquisition, the docking of adjustment transaction flow.
When being embodied as, after code building to be generated, user executes corresponding code, thus adjusting existing transaction flow
Journey.
Present invention also offers a kind of preferable enforcement of automatization's code generating system of quick adjustment transaction flow docking
The operation principle schematic diagram of example, as shown in Fig. 2 built-in node is the assembly taking out previously according to operation flow, such as: shopping cart
Assembly, order component, and supporting built-in sub- analytics engine corresponding with assembly;User- defined Node is user according to concrete business need
Seek the node of personalized definition, and supporting sub- analytics engine corresponding with Custom component, wherein, User- defined Node and corresponding
Sub- analytics engine defers to technical specification.As long as that is, just can be with seamless access automatization generation according to the assembly that specification is realized
Code generation system becomes the assembly of Component Gallery.Simultaneously as the service logic that each assembly is processed is different, so in order to be connected
Each node, needs to place a data adapter unit between two nodes of linking, and effect is by data conversion.
Automatization's code generating system includes environment and runtime environment during design." environment during design " refers to by figure
Change the environment of interface configurations operation flow;" runtime environment " refers to run the ring of the operation flow that " environment during design " configures
Border.
As long as node and analytics engine be placed under automatization's code generating system regulation catalogue with card format it is possible to
Seamless access " Code Generator " becomes the assembly of Component Gallery and sub- analytics engine.
The node of automatization's code generating system, data adapter unit are occurred with card format, and this Plugin Mechanism makes user
Flexibly automatization's code generating system can be extended according to concrete business demand.
From above method embodiment, the invention provides a kind of automatization's code of quick adjustment transaction flow docking
Generation method, in project development process, analyzes commodity and the transaction flow of different businessmans, then using the present invention, only first
Need to carry out speed code generation by graphical operation and parameter setting, accelerate docking development process, reduce overprogram labor
Dynamic.
In the exemplary embodiment, device can be by one or more application specific integrated circuits (asic), digital signal
Processor (dsp), digital signal processing appts (dspd), PLD (pld), field programmable gate array
(fpga), controller, microcontroller, microprocessor or other electronic components are realized, for executing said method.
In the exemplary embodiment, a kind of non-provisional computer-readable recording mediums including instruction are additionally provided, for example
Including the memorizer of instruction, above-mentioned instruction can be by the computing device of device to complete said method.For example, described non-transitory
Computer-readable recording medium can be rom, random access memory (ram), cd-rom, tape, floppy disk and optical data storage
Equipment etc..
Present invention also offers a kind of preferable enforcement of automatization's code generating system of quick adjustment transaction flow docking
The functional schematic block diagram of example, as shown in figure 3, system includes:
Code Template memory module 100, for obtaining each transaction flow in electric business platform in advance, each transaction flow is taken out
As becoming corresponding flow operations assembly, obtain the corresponding Code Template of flow operations assembly and be stored in Component Gallery;Concrete such as method
Shown in embodiment.
Data acquisition module 200, for obtaining the corresponding transaction flow of code to be generated inputting by user interface
Code configuration parameter, the code configuration parameter according to obtaining obtains structured data;Specifically as shown in embodiment of the method.
Template extraction module 300, for according to the type of the corresponding transaction flow of code to be generated and code from Component Gallery
Extract corresponding Code Template;Specifically as shown in embodiment of the method.
Code generation module 400, for structured data and code configuration parameter are filled in the Code Template of extraction,
Obtain code to be generated;Specifically as shown in embodiment of the method.
Automatization's code generating system of described quick adjustment transaction flow docking, wherein, described Code Template storage
Module also includes:
Date Conversion Unit, carries out data conversion between individual flow operations assembly by data adapter unit;Concrete such as method
Shown in embodiment.
Automatization's code generating system of described quick adjustment transaction flow docking, wherein, described system also includes:
Transaction flow, to connection module, for obtaining execution after described code to be generated, adjusts the docking of transaction flow;Concrete such as side
Shown in method embodiment.
Automatization's code generating system of described quick adjustment transaction flow docking, wherein, described system also includes:
Memory module, is stored in particular category for described data adapter unit and described flow operations assembly in the form of plug-in unit
In;Specifically as shown in embodiment of the method.
Automatization's code generating system of described quick adjustment transaction flow docking, wherein, described Code Template storage
Module also includes:
Code Template adding device, for obtaining the flow operations assembly of user input, and judges the flow operations of user input
Whether assembly meets the Element format of Component Gallery, if meeting, the corresponding code of flow operations assembly of user input is added
Form new Code Template to Component Gallery;Specifically as shown in embodiment of the method.
In sum, the invention provides automatization's code generating method of a kind of quick adjustment transaction flow docking and be
System, method includes: obtains each transaction flow in electric business platform in advance, each transaction flow is abstracted into corresponding flow process behaviour
Make assembly, obtain the corresponding Code Template of flow operations assembly and be stored in Component Gallery;Obtain by user interface input to be generated
Become the code configuration parameter of the corresponding transaction flow of code, the described code configuration parameter according to obtaining obtains structured data;Root
Type according to the corresponding transaction flow of code to be generated and code extracts corresponding Code Template from Component Gallery;By structured data with
And code configuration parameter is filled in the described Code Template of extraction, obtain code to be generated.The present invention can analyze different businessmans
Commodity and transaction flow it is only necessary to speed code generation is carried out by graphical operation and parameter setting, accelerate docking exploitation
Flow process, reduces overprogram work.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can
To be improved according to the above description or to convert, all these modifications and variations all should belong to the guarantor of claims of the present invention
Shield scope.