CN103049264A - Method for controlling business system by dynamic modeling of state machine - Google Patents

Method for controlling business system by dynamic modeling of state machine Download PDF

Info

Publication number
CN103049264A
CN103049264A CN2012105457071A CN201210545707A CN103049264A CN 103049264 A CN103049264 A CN 103049264A CN 2012105457071 A CN2012105457071 A CN 2012105457071A CN 201210545707 A CN201210545707 A CN 201210545707A CN 103049264 A CN103049264 A CN 103049264A
Authority
CN
China
Prior art keywords
state machine
machine model
business object
state
node
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.)
Pending
Application number
CN2012105457071A
Other languages
Chinese (zh)
Inventor
朱海东
李晓东
黄炳良
俞兴进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guodian Nanjing Automation Co Ltd
Original Assignee
Guodian Nanjing Automation Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guodian Nanjing Automation Co Ltd filed Critical Guodian Nanjing Automation Co Ltd
Priority to CN2012105457071A priority Critical patent/CN103049264A/en
Publication of CN103049264A publication Critical patent/CN103049264A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a method for controlling a business system by dynamic modeling of a state machine. The method includes the steps: defining and generating a state machine model file of a business object in an XML (extensive makeup language) mode by a graphing tool; dynamically loading the state machine model file of the corresponding business object by a state machine model driving engine; and controlling the state switching process and dynamic behaviors of the business object according to a state machine model of the business object according to the state machine model driving engine. In the method, the behaviors of the business object are controlled by dynamic modeling of the state machine, a runnable state switching model and a dynamic behavior model of the business object are built by graphing configuration, and only new state node or operation rules need to be defined by the graphing definition tool of the state machine when the dynamic behaviors of the business object are changed, so that the workload of code setting due to change in requirements of the dynamic behaviors of the business object is greatly decreased, and development efficiency is improved.

Description

A kind of by the method for state machine dynamic modeling realization to operation system control
Technical field
The present invention relates to a kind of method of operation system being controlled by the realization of state machine dynamic modeling, belong to the information systems technology field.
Background technology
At present, both at home and abroad adopt basically in the Information System Design field all is the changes in demand problem that the mode of code development solves business object, this method workload is large, it is slow to take effect, and also can bring the risk of system with the adding of stylish code, increased the workload of test.
The implementation method of the state change process of existing business object is to adopt the method for exploitation code basically, and the construction cycle is long, and is strong to programmer's development level dependence, and dirigibility is inadequate aspect the changes in demand of reply interface.
Business object is to be used for realizing the core that business function is processed in the OO infosystem; the main carriers of service logic rule under the information processing form; it also is one of key factor that the most easily causes changes in demand; the behavior of business object and the situation that state changes often can appear in the business development process; business object shows different dynamic behaviours in each state; recurrent problem is that the transfer process of business object from a state to another state is uncertain; can be according to user's requirement generation frequent variations; on the other hand, the dynamic behaviour that business object can show in each state also can change because of the variation of demand.Existing method all is to adopt the mode of revising code to deal with these variations, but it is slow that this development approach cycle is grown, takes effect, and need very professional interface development programmer can be competent at this work, a complete infosystem interface development often needs to expend a large amount of manpower and materials, and can be very large to the Systems balanth reliability effect.
Current informatization at home and abroad, business object is divided into attribute and two aspects of operation usually in the OO operation system, and these features are all decided in design process basically in advance, and the mode by hard coded realizes in the performance history.And at the beginning of design, will think about the behavioural characteristics such as relevant control of authority.When business demand changes when need to adjust the behavioural characteristic of business object, just need to carry out the work such as secondary development, test, deployment, the adaptability to changes that causes system relatively a little less than, the stability of bringing thus and the promptness of demand response are all lower.
In case the user is unsatisfied with the business function that develops or has proposed new improvement requirement, the developer will face very heavy again exploitation code work, then also needs new code is tested, revised and reinstall, disposes and reach the standard grade.
In the process of an Information System configuration, the user is recurrent to the change request of business function, this has been so that become programmer's bad dream based on the business object dynamic behaviour of code development design in the construction of infosystem, so system's major issue that need to solve is exactly how to allow the variation of business object demand can be based on configuration rather than based on the exploitation of secondary code.
Summary of the invention
Technical matters to be solved by this invention provides.
For solving the problems of the technologies described above, the invention provides a kind of method of operation system being controlled by the realization of state machine dynamic modeling, it is characterized in that, may further comprise the steps:
1) mode of employing XML, by graphical tools, the state machine model file of definition and generation business object;
2) drive engine, the state machine model file of the business object that dynamic load is corresponding by state machine model;
3) state machine model drives engine according to the state machine model of this business object, and state conversion process and the dynamic behaviour of business object are controlled.
Save as an XML file after the state machine model definition is finished and be kept in the file of hard disk appointment, simultaneously the XML character string in this document is uploaded in the database.
State machine model what upload and load employing is the mode of webservice, the graphical state machine model defining tool of client communicates by mode and the server end of access webservice, and webservice provides the state machine model between SyncModel Interface realization client, server memory, the database three synchronous.
Before the new state machine model issue, carry out first the checking of correctness, the method of checking is by state machine model being loaded in the content of application server end, setting up the buffer memory of state machine model at internal memory, will verifying the correctness of state machine model in this process.
Before state machine model is brought into use, driven the loading of engine completion status machine model by state machine model, the process that loads is: at first from database the state machine model file polling that is using out, be saved in the tabulation, then whether the state machine model quantity in the judgement tabulation is more than or equal to 1, if more than or equal to 1 state machine model that just will travel through wherein, and be attached in the internal memory, construct the memory object of state machine model.
The logical relation of described state machine model inside is built the state transition graph of a business object, this figure is a digraph, the node definition of figure is each process status of business object, and each out-degree of figure and in-degree are defined as event in once conversion, switch condition and the transfer process of business object; State machine model drives engine and according to the state transition graph of business object the dynamic behaviour of business object is controlled.
State machine model is driven engine by state machine model and is loaded in the internal memory form instantiation with object, and drives the dynamic behaviour control of carrying out the business object example under the assistance of engine at state machine model.
The beneficial effect that the present invention reaches:
Method of the present invention realizes the behavior of business object is controlled by the state machine dynamic modeling, but set up running state conversion model and the Dynamic behavior model of business object by graphical configuration, the static attribute of business object and the dynamic behaviour of business object are separated, when the service dynamic behavior changes, can revise the entity code of business object, only need to get final product by new state node or the working rule of state machine figure defining tool definition.When user's business function demand changes, only need to adjust the state machine model of business object, just can change the state conversion regime of business object, realization realizes the dynamic behaviour control of business object to the dynamical state control of business object by plug-type script and code injection.
The demand change of business object only needs to revise the model configuration information and gets final product, and can realize that dynamic model loads and Version Control flexibly, and by the track record of state machine model driving engine implementation to business object behavior act and service condition variation, so that business procedure can audit and review.
The present invention has significantly reduced the workload that code that the dynamic behaviour changes in demand of business object brings is write, and promotes the development efficiency of software and the agility of software systems, and reduces the software systems risk of therefore bringing.
Description of drawings
Fig. 1 is the reimbursement application state machine object model of graphical tools definition;
Fig. 2 is the process flow diagram that state machine model loads;
Fig. 3 is the basic procedure that StateMachineSchema makes up;
Fig. 4 is that state machine model drives establishment and the driving process that engine is responsible for state machine instance.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.Following examples only are used for technical scheme of the present invention more clearly is described, and can not limit protection scope of the present invention with this.
The present invention adopts the thinking of model-driven, realize the behavior of business object is controlled by the state machine dynamic modeling, but set up running state conversion model and the Dynamic behavior model of business object by graphical configuration, it is characterized in that: comprise following concrete settlement steps to deal:
1) mode employing XML(extend markup language), by graphical tools, the state machine model file of definition and generation specific transactions object;
2) drive engine, the state machine model file of dynamic load specific transactions object by state machine model;
3) state machine model drives engine according to the state machine model of specific transactions object, and state conversion process and the dynamic behaviour of business object are controlled.
1. step 1 explanation:
The groundwork of step 1 is definition status machine model, be convenient definition with carrying out intuitively state machine model, adopt the C# development language to develop patterned defining tool, establishment is based on the state machine model file of Xml, the reimbursement application state machine object model instance of graphical tools definition as shown in Figure 1:
The concrete form of model file is as follows:
Figure BDA00002597329100041
The model of whole state machine is included in " statemachine " node, and this node comprises two child nodes, is respectively " model " node and " view " node.
The model node is the node at state machine model information place, has wherein comprised the state conversion regime of specific transactions object;
The view node is the node at the pictorial information place of state machine, when wherein having comprised user's tool using and having defined, and the displaing coordinate of every kind of graphic element on screen, this part content of view is not the emphasis of this paper, does not launch to describe.The below describes the design of model node in detail:
According to the regulation of extend markup language (XML), the flow node is made of attribute and child node.The attribute of model node is as follows:
1.1.Model the attribute of node
-Id: unique indications of state machine model, numeric type;
-Name: the name of state machine model, the user understands and identification with helping, for example: " state machine of reimbursement object ";
-description: the detailed description information of state machine model, be used for the information such as effect of description status machine, help the user to understand more clearly and the concrete effect of status recognition machine model;
-version: the version of state machine model, because the variation of a business demand, the state machine of same business object needs constantly to adjust during the course, the new demand that proposes to satisfy the user, therefore need to help state machine engine control and distinguish new and old state machine by version, guarantee the normal operation of business object;
-starttime, endtime: the effective time of state machine, certain in particular cases, need the interim state machine that creates, only come into force in specific time range, the effect of these two attributes just is this, starttime has defined the entry-into-force time of state machine, endtime has defined the out-of-service time of state machine, when entry-into-force time and out-of-service time when all being empty, represents this state machine continuously effective; The state machine model priority that has defined startime and endtime time is higher than the state machine that does not define these two attributes;
-orgid: organizational structure's coding that state machine model is corresponding when state machine is used for the infosystem of group's level, is used for distinguishing the different conditions machine model of unified business object under different organizational structures;
-bizid: the business object type id that state machine model is corresponding is used for describing this state machine and is used for controlling which kind of business object.
1.2.Model the child node of node
Above attribute to the model node is described, and the below is described the child node of model node, and the child node of model node comprises:
1.2.1.Lookups node
How the attribute that this node is used for defining enumeration type in the business object converts the literal that the user can understand to, for example: when computing machine saved as " 0 " and " 1 " to sex " sex " property value, state machine should convert thereof into " woman " and " man " is shown to the final user.The Lookups attribute can have a plurality of " lookup " child node, and its structure is as follows:
Figure BDA00002597329100061
The attribute that will change in the field attribute representation business object among the Lookup, code represents the value of Computer Storage, name represents the actual value of seeing of user, like this when the user needs to increase " type(educational background type) " or revises the literal that the user sees, as long as revise the model definition of state machine, do not need again to write code.
1.2.2.blocks node
The blocks node is used for defining the property control zone of business object, business object has a lot of attributes, usually these attributes are not can both be for the business personnel accessed or revised, therefore in the state machine definition, need to be defined in the attribute access authority that the business personnel can have under each state, can only revise the amount of money (price) attribute of reimbursement application object such as the financial staff, but can not revise other information such as claimer, when the attribute of business object is many especially, in order to simplify the configuration of state machine, reduce the workload of definition, the attribute of business object can be sorted out, attribute with identical access rights is defined within the attribute block (block), concentrates the access control configuration of carrying out authority.Its feature structure is as follows:
Figure BDA00002597329100071
Id among the block is unique sign of property control piece, and attrs is concrete attribute list.The concrete use-pattern of block is described in the bizright node in the back.
1.2.3.Startconditions node
The entry condition node of state machine, this node definition the state machine entry condition of concrete business object, such as: after an expense report object is filled in and is finished, submit to examine application before, can only submit an expense account the expense that occurs then.This node can comprise one group of conditions condition node, has defined condition condition node in each conditions node, and concrete feature is as follows:
A) be the relation of "or" between the condition node in the conditions node;
B) between the conditions node be " with " relation;
Be exemplified below:
Figure BDA00002597329100072
Illustrate: between above-mentioned " entry condition 1 " and " entry condition 2 " be " with " relation, the relation of "or" between " userid " and " price ", field has defined the attribute of business object in the condition node, the legal detection mode that type has defined this attribute is " field relatively ", value has defined fiducial value, symbol has defined relatively symbol, and datetype has defined field relatively and should compare according to which kind of data type.
Type attribute in the condition node has a plurality of values, is respectively " field, expression, action, storeproc, service ", and the specific features value implication of type attribute is as follows:
-field: represent that this condition is to compare according to the concrete value that defines in the field of business object and the model, draws " true and false ";
-expression: represent that this condition node is that the calculating that expression formula calculates to finish result " true and false " is carried out in requirement;
-action: expression need to draw " true and false " by calling certain concrete predefine class;
-storeproc: expression need to draw condition " true and false " by calling certain storing process;
-service: expression need to draw condition " true and false " by calling certain webservice;
1.2.4.states node
The state model node set of state machine model, this node is made of one group of state node, it is the core node of state machine model, each state node has defined a kind of intermediateness of business object in operational process, and the state node has three types: startstate node, state node, endstate node.
The Startstate node is the starter node of state machine, namely initiates a little;
The State node is general node;
The Endstate node is the end node of state machine, and namely terminating point says that from the angle of graph theory this node only has in-degree, does not have out-degree.
Above-mentioned three kinds of nodes do not have special difference from characterizing definition, come related by the transitions nodal community between the node; The state node comprises attribute and child node equally, and the below is described in detail:
The attribute of state node:
-Id: unique indications of state node;
-name: the Chinese of state node;
-description: the functional description of state node;
-colorremind: whether be that the object that state machine is controlled arranges special Show Color, when this attribute is true, the business datum that the user sees will present different colors according to the difference of state, help more clearly the user to find specific need to manage business;
-signaturetype: state manually examine type, value is that single(is single) or the counter(countersign);
The child node of state node
The basic structure of state node is as follows:
<state……>
<assignees/〉// definition this state the participant
<events/〉// event that definition relates in this state
<filters/〉// filtercondition that need to carry out of this state of definition
<buttonsright/〉// increase, the deletion of this state of definition, the access rights of modification button
<recover/〉// whether this state of definition allow condition and the event of recovering and recovering
<bizright/〉// the attribute access authority of business object of this state of definition
<transitions/〉// NextState id that the event that triggers when the definition out-degree (" out-degree " graph theory term) of this state and the conversion of generation state and needing activates
</state>
The detailed description of said structure:
A) assignees child node: define the participant of this state, the feature structure of this node is as follows:
<assignees>
<assignee name=" reimbursement applicant " type=" anonymous " andparentfilter=" true " value=" * " 〉
<leaveevents/〉// action behavior that definition need to trigger when this participant's executing state is changed
<filters/〉// when this participant of definition carries out the operation of business object, the filtercondition of system
</assignee>
<assignee〉// participant of another participant or another kind of type
……
</assignee>
</assignees>
An assignees node can have a plurality of assignee child nodes, and each assignee child node has defined the state participant of or a type.Assignee node diagnostic structure is as follows in the said structure:
The type attribute: this attribute definition participant's type, the type is an enumeration type, span is as follows:
-user: the user that certain is concrete;
-creator: founder or the startup person of state machine;
-anonymous: anonymous, namely all people that can access business object corresponding to this state machine model can operate;
-actor: the user who belongs to certain role;
-leader: Last status participant's leading body at a higher level, such as: the applicant is the office worker of engineering department, and the participant of this state is exactly the manager of engineering department so;
-group: the user who belongs to certain working group;
-assigneeAction: the participant who obtains this step by carrying out certain predefined class;
-subordinate: Last status participant's subordinate office worker;
-assigneeService: obtain the participant of this step by accessing certain web services, obtain the participant such as certain ldap directory service of access;
Andparentfilter attribute: compound father's condition whether, this attribute is to be used in when the participant is some special user, need to apply to the access of business object some special filterconditions, will carry out the filtercondition that defines in the filter child node of this node and the filter condition in the father node when property value is true " with " merge;
Value attribute: participant's concrete value;
Leaveevents node: the action behavior that definition need to trigger when this participant's executing state conversion
The filters node: when defining this participant and carrying out the operation of business object, the filtercondition of system, the back will be described in detail.
B) events child node: defined the behavior event that relates in the current state state node, comprised enterevents, leaveevents, humanevents three types:
Enterevents: the event that triggers when business object enters into current state;
Leaveevents: the event that triggers when business object is left current state;
Humanevents: the action event that business object can be carried out in current state;
Each event can trigger a plurality of actions in above-mentioned three kinds of events, is exemplified below:
Figure BDA00002597329100111
Enterevents(enters event in the above-mentioned example) defined two actions in the node, " event 1 " made the status property value of business object into " general manager (GM) receives ", and " event 2 " made the price property value of business object into 5000; Two actions have been defined in humanevents (manual event) node, " operation 1 " will call the com.sac.patent.statusAction class status attribute of business object will be carried out assignment, and " operation 2 " will call the com.sac.patent.priceAction class price attribute of business object is carried out assignment;
Different is, the event that defines in two nodes of enterevents and leaveevents all is that system automatically performs, the time that carry out to occur is that business object is when entering into current state and leaving current state, each the event event that defines among the humanevents will appear in the tool bar of user interface as a button, in the above-mentioned example, after business object enters this state, can occur " operation 1 " and " operation 2 " two buttons in the toolbar when user opens the current operation interface, these two buttons will disappear automatically when leaving this state.
C) filters child node: the participant is when business object is in current state in definition, the filtercondition of system, and being consisted of by several filter child nodes of filters node, each filter child node is finished one group of filtercondition:
Figure BDA00002597329100121
Filter inside has conditions condition child node to consist of, and finishes the definition work of actual conditions expression formula, and the constitutive characteristic of conditions condition node is identical with the feature of Startconditions node.The filters node can define business object when current state, and system is to the condition of business object retrieval.The final user is when the access system page, and the business object of seeing will be after the condition filter according to filter definition.
D) buttonsright child node: the access control right of definition business object when being in current state comprises the access rights of increases, deletion, modification button.In the default situation, comprised for the operation of a business object that the CRUD(additions and deletions change and looked into) four kinds of operations, the buttonsright child node in the state node changes three kinds of operations to additions and deletions to be controlled, and its feature structure is as follows:
Figure BDA00002597329100122
Figure BDA00002597329100131
Operating right " right=1 " expression that the participant of the right property control current operation in the right child node has has corresponding authority, and " right=0 " expression does not have corresponding authority;
E) recover child node: define this state and whether allow the precondition of recovering and recovering and recover to need the event that causes in the process, be in " pending " if the business object of state has defined recover information in state, and when business object has satisfied the condition that permission " recovers ", the business personnel of Last status (state) can carry out and recover operation, and state is transformed into Last status again.For example: the claimer has filled in reimbursement application and has submitted to leading body at a higher level and examine, catch sight of fill in have problem, before leading body at a higher level does not examine, system will allow it to recover reimbursement application and again processing so.The feature structure of Recover child node is as follows:
<recover allow=" true "〉// whether allow when defining this state to carry out to recover operation
<conditions/〉if // allow=true, defined then what the condition that allows to recover is, its structure is identical with the startconditions node
<events/〉// to carry out when recovering operation the system acting that triggers, the events child node of its structure and state is identical
</recover>
F) bizright child node: the attribute access authority that defines the business object of this state, the business personnel who namely is authorized to (participant who defines among the assignees) is under current state during the access service object, the property rights of the business object that can access, such as: reimbursement application object at state from the process that these several states of " application "-〉 " approval "-〉 " audit " are changed, the participant of " audit " link can revise " price " attribute of reimbursement object, but can not revise the claimer, other attributes such as reimbursement article, state machine is realized control to business object price attribute by definition bizright in the configuration information of " audit " state, and its feature is as follows:
<bizright default=" readonly "〉// arrange that business object all is read only attribute at all properties of current state in the default situation
<info id=" price " right=" modify " isblock=" false "/〉 // expression price attribute is in the current state operation of can making amendment
<infoid=" subject " right=" readonly " isblock=" true "/〉 // represent that all properties that defines in " subject " piece is all read-only
</biright>
Business object is in the attribute access authority of current state in the default situation of default setup of attribute of bizright, and readonly represents that all properties all is that read-only, modify represents that all properties can revise,
G) transitions child node: the event that triggers when out-degree (" out-degree " graph theory term) conversion of definition current state (state) and the conversion of generation state and the NextState id that needs to activate.Its feature structure is schematically as follows:
Figure BDA00002597329100141
Among the above-mentioned transition:
-name attribute: defined the button name that finally appears in the user interface tool hurdle;
-icon attribute: the icon id(icon resource that has defined button is deposited in the resource file of system, does not give unnecessary details);
-destination attribute: defined when carrying out this conversion (transition), the dbjective state id(of state transition defines in the id of state node attribute)
-silence attribute: defined whether need participant's (defining among the assignees) typing remark information of be correlated with when carrying out conversion, such as: suggestions made after examination etc., " 0 " expression does not need, and " 1 " expression need to.
-counter attribute: defined whether need the number of conutersigning when carrying out this conversion, " 1 " is as long as expression has the individual consent (or disagreeing with) just can transition status, " * " represents that all meet the people who defines in the assignees node and all will agree (or disagreeing with) ability transition status, and other digital watch are shown with concrete How many people and agree that (or disagreeing with) just can carry out transition status.
-showconditions child node: defined the condition that shows switching button at the interface tool bar, shown when satisfying condition, otherwise do not show.Can only check business object such as some people but can not carry out when examining action.
Figure BDA00002597329100151
-assignees child node: defined the participant that can carry out this conversion, this participant's priority is higher than the participant (assignees that defines among the state) who defines in the state node, if the content of this child node is empty, adopt the participant who defines among the state.
2. step 2 explanation:
Can save as an XML file after state machine model definition is finished is kept in the file of hard disk appointment and (is defaulted as " model " file under the graphical state machine model defining tool installation directory, the expansion of model file is called " .sm "), can adopt simultaneously the mode of blob field that the XML character string in this document is uploaded in the database, list structure is as follows:
Figure BDA00002597329100161
State machine model what upload and load employing is the mode of webservice, the graphical state machine model defining tool of client communicates by mode and the server end of access webservice, and webservice provides the state machine model between SyncModel Interface realization client, server memory, the database three synchronous;
Before the new state machine model issue, need carry out first the checking of correctness, the method of checking is by state machine model being loaded in the content of application server end, setting up the buffer memory of state machine model at internal memory, will verifying the correctness of state machine model in this process.
The flow process that state machine model loads as shown in Figure 2.
Before state machine model is brought into use, state machine model drives the loading that engine can call the method completion status machine model of a loadAllStateMachines by name, the exemplary flow that loads is as implied above: at first from database the state machine model file that is using (that is: status=acitive) is checked out, be saved in the tabulation (List), then whether the state machine model quantity in the judgement tabulation is more than or equal to 1, if more than or equal to 1 state machine model that just will travel through wherein, and be attached in the internal memory, construct the memory object of state machine model.
In the process if there is unusually, the definition information that shows this state machine model has problem, the problematic place of meeting prompting in error handling processing (such as: the organizational structure that defines in the state machine model does not exist, business object does not exist, the user does not exist or the predefine class of wherein appointment does not exist etc.), thereby realize the checking of state machine model correctness, and abandon the structure of this state machine model memory object, carry out next one circulation, make up other state machine model memory object, finish until all state machine model memory objects all make up.
In fact the memory object building process of state machine model is exactly the process of analyzing XML file, because the xml file more complicated of state machine model, and therefore also relative complex in the process that memory object makes up.The method that this patent has adopted the common completion status machine of a plurality of classes model memory object to make up realizes the loading of state machine model, and concrete kind is as follows:
Figure BDA00002597329100171
Figure BDA00002597329100181
Above-mentioned these class functions have been finished memory object (StateMachineSchema) function of state machine model, finally build one group of StateMachineSchema object, each StateMachineSchema object represents the state machine model of a class business object, this group StateMachineSchema object is stored among the core buffer object StateMachineSchemaBuffer with the hashmap organization definition, convenient in the operation system operational process, locate fast and operate.
The mode of employing class is finished the parsing work to the xml document, the benefit of bringing for the performance of system is self-evident, the StateMachineSchema object has been arranged, and operation system is in operation just can adopt OO mode of operation Access status machine model, fast and stable.Use the Id attribute to distinguish between the StateMachineSchema object, adopt the StateMachineVersion attributes object to distinguish between the StateMachineSchema object of identical name attribute.
The basic procedure that StateMachineSchema makes up is as shown in Figure 3:
(dom4j is the java version of DOM Document Object Model at first to create an org.dom4j.Document object, be used in java, accessing the object structure that the XML document mode is stored), the state machine model information that the XML structure that obtains in the database is preserved is loaded in the org.dom4j.Document object, is convenient to like this in internal memory the accessing operation to the xml document information.
Then, state machine model drives engine will create the object instance of a StateMachineSchema type, and the loadXmlDefine method loading of calling example is kept at the model data in the Document object.
The process that the loadXmlDefine method is carried out:
-load the attribute information of Model node, comprise Id, version, name
-create BlockSchema list object (BlockList), the child node among the circulation blocks, and for each child node creates a BlockSchema subobject, finish the loading work to control of authority zone (blocks) information;
-create Lookup list object (LookupList), the child node of circulation Lookups, and for each child node creates a Lookup subobject, finish the loading of lookups nodal information;
-establishment Condition list object (ConditionList), circulation Conditions(or startconditions) child node, and for each child node creates a Condition subobject, finish Conditions(or startconditions) loading of nodal information;
-create state list object (StateList), the child node of circulation states, and be that each state child node creates a stateschema object, finish the loading of states nodal information;
Because the content relative complex of stateschema object, also need to create the assigneeschema list object in the loading procedure, event list object, transition list object, condition list object, filter list object, bizright list object, buttonright list object are used for loading the corresponding configuration information in the state node;
The state machine model file is complete to be loaded in the internal memory and to finish after document object (dom) makes up to the java object with StateMachineSchema, and the model of state machine model has just been realized setting up and buffer memory in internal memory.
The inner logical relation of a state machine model (StateMachineSchema) finally builds the state transition graph of a business object, this figure is a digraph, the node definition of figure each process status of business object, each out-degree of figure and in-degree have defined event in once conversion, switch condition and the transfer process of business object, thus finishing service Dynamic behavior of object feature.End-state machine model-driven engine is exactly to finish dynamic behaviour control work to business object according to the state transition graph of business object.
3. step 3 explanation:
State machine model is driven engine by state machine model and is loaded in the internal memory and after the form instantiation with object, will carry out the dynamic behaviour control of business object example under state machine model drives the assistance of engine.State machine model drives establishment and the driving process that engine is responsible for state machine instance, and driving method as shown in Figure 4.
State machine model driving engine is divided into following feature to the dynamic behaviour control of business object example:
Business object is defined as " entering ", " pending ", " in the processing ", " processing ", " leaving " five kinds of little states in a state conversion process, namely comprised above-mentioned five little states in state:
-entering (enter): the expression business object is transformed into transition state the process of another state from a state, state machine model drives engine and can enter some initial work before this state to business object in this state, and concrete work just is defined in the enterevents node.
-pending (wait): the expression business object has been passed through the state that is in after the transition state of " entering ", business object is placed in the task queue under this state, be in the state that the latency services personnel process, be in the business object of this state, if having defined recover(in the state node recovers) information, can be recovered a upper state state node.In case this business object is chosen by the business personnel and is retrieved, just will enter into " processing " state from " pending " state from task queue.
In-the processing (process): the expression business object has been left " pending " state, is begun to process by business personnel (participant who defines among the assignees).The business personnel can carry out various operations to this business object under this state in the scope that authority allows.When being in " in the processing " state, can not being performed recover(and recovering) operation;
-to process (completed): the expression business object is disposed, and waits for the next state that enters.The user can not make amendment to the information of business object again under this state.
-to leave (leave): the transition state of business object when leaving current state, this state descend and trigger the event that defines in the leaveevents node.
Above-mentioned five little states are that business object experiences during another state from a state transition in operational process.Different according to business demand and business operation behavior have one's own state machine instance, that is: a StateMachineInstance for each business object.
Service condition machine model (StateMachineSchema) has been described the dynamic behaviour feature of a class business object, and state machine instance (StateMachineInstance) has been described the dynamic behaviour of concrete certain business object, and state machine instance is the specific product of state machine model thus.
The above only is preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the technology of the present invention principle; can also make some improvement and distortion, these improvement and distortion also should be considered as protection scope of the present invention.

Claims (7)

1. a method that realizes operation system is controlled by the state machine dynamic modeling is characterized in that, may further comprise the steps:
1) mode of employing XML, by graphical tools, the state machine model file of definition and generation business object;
2) drive engine, the state machine model file of the business object that dynamic load is corresponding by state machine model;
3) state machine model drives engine according to the state machine model of this business object, and state conversion process and the dynamic behaviour of business object are controlled.
2. according to claim 1 by the method for state machine dynamic modeling realization to operation system control, it is characterized in that, save as an XML file after the state machine model definition is finished and be kept in the file of hard disk appointment, simultaneously the XML character string in this document is uploaded in the database.
3. according to claim 1 by the method for state machine dynamic modeling realization to operation system control, it is characterized in that, state machine model what upload and load employing is the mode of webservice, the graphical state machine model defining tool of client communicates by mode and the server end of access webservice, and webservice provides the state machine model between SyncModel Interface realization client, server memory, the database three synchronous.
4. according to claim 3 by the method for state machine dynamic modeling realization to operation system control, it is characterized in that, before the new state machine model issue, carry out first the checking of correctness, the method of checking is by state machine model being loaded in the content of application server end, set up the buffer memory of state machine model at internal memory, will verify the correctness of state machine model in this process.
5. according to claim 2 by the method for state machine dynamic modeling realization to operation system control, it is characterized in that, before state machine model is brought into use, driven the loading of engine completion status machine model by state machine model, the process that loads is: at first from database the state machine model file polling that is using out, be saved in the tabulation, then whether the state machine model quantity in the judgement tabulation is more than or equal to 1, if more than or equal to 1 state machine model that just will travel through wherein, and be attached in the internal memory, construct the memory object of state machine model.
6. according to claim 1 by the method for state machine dynamic modeling realization to operation system control, it is characterized in that, the logical relation of described state machine model inside is built the state transition graph of a business object, this figure is a digraph, the node definition of figure is each process status of business object, and each out-degree of figure and in-degree are defined as event in once conversion, switch condition and the transfer process of business object; State machine model drives engine and according to the state transition graph of business object the dynamic behaviour of business object is controlled.
7. according to claim 5 by the method for state machine dynamic modeling realization to operation system control, it is characterized in that, state machine model is driven engine by state machine model and is loaded in the internal memory form instantiation with object, and drives the dynamic behaviour control of carrying out the business object example under the assistance of engine at state machine model.
CN2012105457071A 2012-12-17 2012-12-17 Method for controlling business system by dynamic modeling of state machine Pending CN103049264A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012105457071A CN103049264A (en) 2012-12-17 2012-12-17 Method for controlling business system by dynamic modeling of state machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012105457071A CN103049264A (en) 2012-12-17 2012-12-17 Method for controlling business system by dynamic modeling of state machine

Publications (1)

Publication Number Publication Date
CN103049264A true CN103049264A (en) 2013-04-17

Family

ID=48061916

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012105457071A Pending CN103049264A (en) 2012-12-17 2012-12-17 Method for controlling business system by dynamic modeling of state machine

Country Status (1)

Country Link
CN (1) CN103049264A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068793A (en) * 2015-07-16 2015-11-18 浪潮通用软件有限公司 Method and apparatus for generating business logic relation diagram and realizing business application
CN105656688A (en) * 2016-03-03 2016-06-08 腾讯科技(深圳)有限公司 State control method and device
CN105930205A (en) * 2016-04-14 2016-09-07 北京思特奇信息技术股份有限公司 Method and device for processing service states based on state machine mode
CN110765099A (en) * 2019-09-06 2020-02-07 阿里巴巴集团控股有限公司 Business construction method and device and computer equipment
CN110825428A (en) * 2019-11-06 2020-02-21 政采云有限公司 State machine configuration method, device, equipment and readable storage medium
CN111222850A (en) * 2019-12-31 2020-06-02 深圳瑞为智能科技有限公司 Front-end and back-end cooperation work order processing flow method based on finite state machine
CN111708524A (en) * 2020-06-02 2020-09-25 苏州宏软信息技术有限公司 Method and system for realizing distributed dynamic finite state machine
CN113553062A (en) * 2021-07-23 2021-10-26 中国电子科技集团公司第二十八研究所 State machine code generation method based on template technology
CN113592426A (en) * 2021-06-28 2021-11-02 文思海辉智科科技有限公司 Generation method and device of approval strategy, computer equipment and storage medium
CN115061718A (en) * 2022-03-24 2022-09-16 上海任意门科技有限公司 Method, computing device and computer storage medium for configuring and running state machine

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020152102A1 (en) * 1998-11-30 2002-10-17 Brodersen Karen Cheung State models for monitoring process
CN102819609A (en) * 2012-08-23 2012-12-12 国电南京自动化股份有限公司 Modeling method for persisting data model

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020152102A1 (en) * 1998-11-30 2002-10-17 Brodersen Karen Cheung State models for monitoring process
CN102819609A (en) * 2012-08-23 2012-12-12 国电南京自动化股份有限公司 Modeling method for persisting data model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
孙学锋: "基于有限状态机的工作流引擎的设计和实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
杨扬: "基于FSM模型的流程引擎研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068793A (en) * 2015-07-16 2015-11-18 浪潮通用软件有限公司 Method and apparatus for generating business logic relation diagram and realizing business application
US11184216B2 (en) 2016-03-03 2021-11-23 Tencent Technology (Shenzhen) Company Limited State control method and apparatus
CN105656688A (en) * 2016-03-03 2016-06-08 腾讯科技(深圳)有限公司 State control method and device
WO2017148233A1 (en) * 2016-03-03 2017-09-08 腾讯科技(深圳)有限公司 State control method and device
CN105656688B (en) * 2016-03-03 2019-09-20 腾讯科技(深圳)有限公司 Condition control method and device
CN105930205A (en) * 2016-04-14 2016-09-07 北京思特奇信息技术股份有限公司 Method and device for processing service states based on state machine mode
CN110765099A (en) * 2019-09-06 2020-02-07 阿里巴巴集团控股有限公司 Business construction method and device and computer equipment
CN110765099B (en) * 2019-09-06 2024-01-30 创新先进技术有限公司 Service construction method and device and computer equipment
CN110825428A (en) * 2019-11-06 2020-02-21 政采云有限公司 State machine configuration method, device, equipment and readable storage medium
CN111222850A (en) * 2019-12-31 2020-06-02 深圳瑞为智能科技有限公司 Front-end and back-end cooperation work order processing flow method based on finite state machine
CN111708524A (en) * 2020-06-02 2020-09-25 苏州宏软信息技术有限公司 Method and system for realizing distributed dynamic finite state machine
CN111708524B (en) * 2020-06-02 2024-02-23 苏州宏软信息技术有限公司 Method and system for realizing distributed dynamic finite state machine
CN113592426A (en) * 2021-06-28 2021-11-02 文思海辉智科科技有限公司 Generation method and device of approval strategy, computer equipment and storage medium
CN113592426B (en) * 2021-06-28 2023-10-20 文思海辉智科科技有限公司 Approval policy generation method and device, computer equipment and storage medium
CN113553062A (en) * 2021-07-23 2021-10-26 中国电子科技集团公司第二十八研究所 State machine code generation method based on template technology
CN115061718A (en) * 2022-03-24 2022-09-16 上海任意门科技有限公司 Method, computing device and computer storage medium for configuring and running state machine
CN115061718B (en) * 2022-03-24 2023-12-22 上海任意门科技有限公司 Method for configuring and operating a state machine, computing device and computer storage medium

Similar Documents

Publication Publication Date Title
CN103049264A (en) Method for controlling business system by dynamic modeling of state machine
US9852382B2 (en) Dynamic human workflow task assignment using business rules
JP2843763B2 (en) Interface method and apparatus in object-oriented computer system
US6158044A (en) Proposal based architecture system
Suh et al. Axiomatic design of software systems
CN101794226B (en) Service software construction method and system adapting to multiple business abstraction levels
Casati et al. Deriving active rules for workflow enactment
Bussler et al. Policy resolution for workflow management systems
CN102810057B (en) A kind of method of log
US20050027582A1 (en) Project modelling and management tool
US20080235249A1 (en) Hierarchy global management system and user interface
WO2007123706A2 (en) Smart containers
JPH1173321A (en) Method for developing framework and software system
EP0841612A2 (en) Framework for software development
US20130254162A1 (en) Governing information
US20110264592A1 (en) Template-based technique for making a best practices framework actionable
Polo et al. An MDA‐based approach for database re‐engineering
AU2002218864A1 (en) Method for systemic enterprise knowledge management
CN102486731B (en) Strengthen the visualization method of the call stack of software of software, equipment and system
Beznosov Information enterprise architectures: problems and perspectives
Krishnakumar et al. Specification of workflows with heterogeneous tasks in meteor
Il-Yeol Developing sequence diagrams in UML
Snoeck et al. An architecture for bridging OO and business process modelling
Cabrero et al. ARMISTICE: an experience developing management software with Erlang
Beznosov Architecture of information enterprises: Problems and perspectives

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB03 Change of inventor or designer information

Inventor after: Zhu Haidong

Inventor after: Tang Yiliang

Inventor after: Li Xiaodong

Inventor after: Huang Bingliang

Inventor after: Yu Xingjin

Inventor before: Zhu Haidong

Inventor before: Li Xiaodong

Inventor before: Huang Bingliang

Inventor before: Yu Xingjin

COR Change of bibliographic data

Free format text: CORRECT: INVENTOR; FROM: ZHU HAIDONG LI XIAODONG HUANG BINGLIANG YU XINGJIN TO: ZHU HAIDONG TANG YILIANG LI XIAODONG HUANG BINGLIANG YU XINGJIN

C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20130417