Disclosure of Invention
Based on this, the present invention provides a workflow model implementation method, system, readable storage medium and computer device to solve at least the above technical deficiencies.
The invention provides a workflow model implementation method, which comprises the following steps:
creating a plurality of workflow model attributes, and rendering the workflow model attributes to a server;
when an operation request of a user side is obtained, calling an interface of the server side, and establishing connection between the user side and the server side through the interface;
and acquiring the workflow model attribute corresponding to the operation request in the server through the interface so as to enable a user to execute corresponding operation according to the corresponding workflow model attribute.
Further, the workflow model attributes at least include attribute identification, attribute name and attribute configuration.
Further, the step of rendering the plurality of workflow model attributes to a server includes:
rendering the attributes of the workflow models in sequence through the attribute names to obtain a plurality of form items;
and adding the form item and the attribute value and the attribute identification corresponding to the form item to the server.
Further, the step of calling an interface of the server and establishing the connection between the user side and the server through the interface includes:
calling an interface of the server through an HTTP service request, and acquiring interface information of the interface;
generating a corresponding interface connection file according to the interface information, and judging whether the interface connection file meets a preset standard or not;
and if the interface connection file meets the preset standard, introducing the interface connection file into the user side so as to construct the connection between the user side and the server side.
Further, the step of obtaining the workflow model attribute corresponding to the operation request in the server through the interface to enable the user to execute the corresponding operation according to the corresponding workflow model attribute includes:
obtaining workflow model data corresponding to the operation request and the server through the interface, and analyzing workflow model attributes in the workflow model data;
and calling an attribute processing implementation code corresponding to the operation request in the workflow model attribute so that a user executes corresponding operation according to the attribute processing implementation code.
The invention also provides a workflow model implementation system, which comprises:
the system comprises a creating module, a service end and a service end, wherein the creating module is used for creating a plurality of workflow model attributes and rendering the workflow model attributes to the service end;
the calling module is used for calling an interface of the server when an operation request of a user side is obtained, and establishing connection between the user side and the server side through the interface;
and the execution module is used for acquiring the workflow model attribute corresponding to the operation request in the server through the interface so as to enable a user to execute corresponding operation according to the corresponding workflow model attribute.
Further, the workflow model attributes at least include an attribute identifier, an attribute name, and an attribute configuration, and the creating module includes:
the rendering unit is used for rendering the attributes of the workflow models in sequence through the attribute names to obtain a plurality of form items;
and the adding unit is used for adding the form item, and the attribute value and the attribute identification corresponding to the form item to the server.
Further, the calling module includes:
the acquisition unit is used for calling an interface of the server through an HTTP service request and acquiring interface information of the interface;
the judging unit is used for generating a corresponding interface connection file according to the interface information and judging whether the interface connection file meets a preset standard or not;
the construction unit is used for introducing the interface connection file into the user side if the interface connection file meets a preset standard so as to construct the connection between the user side and the server side.
Further, the execution module includes:
the analysis unit is used for acquiring the workflow model data corresponding to the operation request from the server through the interface and analyzing the workflow model attribute in the workflow model data;
and the execution unit is used for calling the attribute processing implementation code corresponding to the operation request in the workflow model attribute so as to enable a user to execute the corresponding operation according to the attribute processing implementation code.
The present invention also proposes a readable storage medium, on which a computer program is stored, which when executed by a processor implements the workflow model implementation method described above.
The invention also provides a computer device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor implements the workflow model implementation method when executing the computer program.
The workflow model realizing method, the system, the readable storage medium and the computer equipment of the invention can dynamically render the workflow model attribute to the server by establishing the workflow model attribute, obtain the information of the workflow model attribute by the user side and specifically realize the workflow model attribute, thereby achieving the effect that the workflow model can be dynamically expanded, leading the server side to realize code zero modification so as to be convenient for adapting to different user sides, leading the server side to expand the workflow model attribute according to the requirements of the user side at any time, leading the server side to be free from any code modification, only needing to carry out simple configuration in the system, further realizing the dynamic expansion of the workflow model attribute and keeping the stability, the robustness, the expansibility and the like of the server side. The workload of a server developer is saved, and the maintenance difficulty of the server developer is reduced.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Several embodiments of the invention are presented in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Example one
Referring to fig. 1, a method for implementing a workflow model in a first embodiment of the present invention is shown, where the method specifically includes steps S101 to S103:
s101, creating a plurality of workflow model attributes, and rendering the workflow model attributes to a server;
it should be noted that the workflow model attributes refer to some attributes contained on the process nodes.
In specific implementation, the workflow model attribute is a flow model designed by a visual flow designer, and the workflow model attribute is some attributes of flow nodes contained in the workflow model; and through visual configuration, defining the attributes of the workflow model on the interface and storing the attributes in a persistent mode.
A set of rules needs to be defined, and the attribute configuration of the workflow model needs to include three configurations, namely attribute identification, attribute name, attribute configuration and the like.
And attribute identification: the unique identifier of the workflow model attribute can acquire the information corresponding to the workflow model attribute through the identifier.
Attribute name: and rendering the name of the attribute of the workflow model into a form item name corresponding to the attribute of the workflow model.
Attribute configuration: the form items for defining the attribute of the workflow model comprise various types such as input boxes, radio boxes, check boxes, drop-down selection boxes, counters, switch buttons and the like, and are defined as the attribute configuration of the workflow model in the form of json character strings. The rules are defined as follows:
formType: form item type (must fill);
key: unique identification (must fill);
label: name (must fill);
defaultValue: a default value;
and (3) rules: checking rules;
where the key needs to be consistent with the attribute identification. label needs to be consistent with the attribute names.
For example: an attribute of the form title authority is added.
Firstly, configuring an attribute identifier as formSet, wherein the attribute name is a form title authority, and the attribute is configured as follows:
{ "fortmType": checkbox "," key ": formSet", "label": form title authority "," options "[ { label: ' read only ', value: ' readOnly ' }, { label: ' hide ', value: ' display ' }, ' defaultValue": rule: { };
and the workflow model attribute configuration obtained by the configuration is rendered on a form of a workflow model visual design interface, so that the added workflow model attribute is provided during design. And realizing dynamic rendering of the attributes of the workflow model through the dynamic form, and filling the attribute values when designing the workflow model, wherein the attribute identification and the attribute values are stored in the flow model together.
In specific implementation, a latest front-end technology is adopted to realize the dynamic form, the attributes of the workflow model are rendered into form items, and all the attributes of the workflow model are rendered by traversing the form items.
The dynamic form code can render the workflow model property configuration example described above as a check box named form title authority, the option of which includes hidden, read-only.
S102, when an operation request of a user side is obtained, calling an interface of the server side, and constructing connection between the user side and the server side through the interface;
in specific implementation, when a user side needs to execute operation, a server side interface is called through a service request such as http, and the connection between the user side and the server side is established through the interface.
S103, obtaining the workflow model attribute corresponding to the operation request in the server through the interface, so that the user executes corresponding operation according to the corresponding workflow model attribute.
In specific implementation, a user side obtains workflow model data corresponding to an operation request in a server side, stores all workflow model attributes in the workflow model data, analyzes the workflow model data, obtains the workflow model attributes in the workflow model data according to the transmitted parameters, and returns the workflow model attributes to the user side.
After the workflow model attribute is obtained, the attribute processing realization code of the workflow model attribute teammate is called according to the actual requirement of the user side, and the actual application effect of the workflow model attribute is achieved.
For example: and if the attribute set by the obtained form title is read-only, setting the attribute of the label where the corresponding form title is located in the front-end form page code as readOnly, so that the effect of read-only of the form title is achieved.
In summary, in the method for implementing a workflow model in the above embodiment of the present invention, by creating the workflow model attribute, dynamically rendering the workflow model attribute to the server, and obtaining information of the workflow model attribute by the client and specifically implementing the workflow model attribute, an effect that the workflow model can be dynamically extended is achieved, so that the server can implement zero code modification to adapt to different clients, the server can extend the workflow model attribute according to the requirements of the client at any time, and the server does not need to modify any code, but only needs to perform simple configuration in the system, thereby implementing dynamic extension of the workflow model attribute and maintaining the stability, robustness, extensibility, and the like of the server itself. The workload of a server developer is saved, and the maintenance difficulty of the server developer is reduced.
Example two
Referring to fig. 2, a method for implementing a workflow model in a second embodiment of the present invention is shown, where the method specifically includes steps S201 to S208:
s201, creating a plurality of workflow model attributes, wherein the workflow model attributes at least comprise attribute identifications, attribute names and attribute configuration;
it should be noted that the workflow model attributes refer to some attributes contained on the process nodes.
In specific implementation, the workflow model attribute is a flow model designed by a visual flow designer, and the workflow model attribute is some attributes of flow nodes contained in the workflow model; and through visual configuration, defining the attributes of the workflow model on the interface and storing the attributes in a persistent mode.
A set of rules needs to be defined, and the attribute configuration of the workflow model needs to include three configurations, namely attribute identification, attribute name, attribute configuration and the like.
And attribute identification: the unique identifier of the workflow model attribute can acquire the information corresponding to the workflow model attribute through the identifier.
Attribute name: and rendering the name of the attribute of the workflow model into a form item name corresponding to the attribute of the workflow model.
Attribute configuration: the form items for defining the attribute of the workflow model comprise various types such as input boxes, radio boxes, check boxes, drop-down selection boxes, counters, switch buttons and the like, and are defined as the attribute configuration of the workflow model in the form of json character strings. The rules are defined as follows:
formType: form item type (must fill);
key: unique identification (must fill);
label: name (must fill);
defaultValue: a default value;
and (3) rules: checking rules;
where the key needs to be consistent with the attribute identification. label needs to be consistent with the attribute names.
For example: an attribute of the form title authority is added.
Firstly, configuring an attribute identifier as formSet, wherein the attribute name is a form title authority, and the attribute is configured as follows:
{ "fortmType": checkbox "," key ": formSet", "label": form title Authority "," options "[ { label: ' read only ', value: ' readOnly ' }, { label: ' hide ', value: ' display ' }, ' defaultValue": rule: { }.
S202, rendering the attributes of the workflow models in sequence through the attribute names to obtain a plurality of form items;
during specific implementation, the workflow model attribute configuration obtained by the configuration is rendered on a form of a workflow model visual design interface, and the added workflow model attribute is provided during design. And realizing dynamic rendering of the attributes of the workflow model through the dynamic form, and filling the attribute values when designing the workflow model, wherein the attribute identification and the attribute values are stored in the flow model together.
S203, adding the form item, and the attribute value and the attribute identification corresponding to the form item to the server;
in specific implementation, a latest front-end technology is adopted to realize the dynamic form, the attributes of the workflow model are rendered into form items, and all the attributes of the workflow model are rendered by traversing the form items.
The dynamic form code can render the workflow model property configuration example described above as a check box named form title authority, the option of which includes hidden, read-only.
S204, when an operation request of a user side is obtained, calling an interface of the server side through an HTTP service request, and obtaining interface information of the interface;
in specific implementation, when a user needs to execute an operation, a server interface is called through a service request such as http and interface information of the interface is acquired, wherein an interface address and an interface parameter are recorded in the interface information.
S205, generating a corresponding interface connection file according to the interface information, and judging whether the interface connection file meets a preset standard;
s206, if the interface connection file meets a preset standard, introducing the interface connection file into the user side to construct the connection between the user side and the server side;
during specific implementation, the interface address and the interface parameter are decomposed and spliced to obtain corresponding interface connection files, standard files corresponding to the interface connection files pre-stored in the memory are called, and if the interface connection files meet the standards recorded in the standard files, the interface connection files are introduced into the user side to establish connection between the user side and the server side.
In the application, if the interface connection file does not meet the standard recorded in the standard file, a file error alarm is sent out, so that the user side can re-dispatch the operation request or re-search the server interface according to the error alarm.
S207, obtaining workflow model data corresponding to the operation request and the service end through the interface, and analyzing workflow model attributes in the workflow model data;
in specific implementation, a user side obtains workflow model data corresponding to an operation request in a server side, stores all workflow model attributes in the workflow model data, analyzes the workflow model data, obtains the workflow model attributes in the workflow model data according to the transmitted parameters, and returns the workflow model attributes to the user side.
S208, calling an attribute processing implementation code corresponding to the operation request in the workflow model attribute so that the user executes corresponding operation according to the attribute processing implementation code.
In specific implementation, after the workflow model attribute is obtained, the attribute processing realization code of the workflow model attribute teammate is called according to the actual requirement of the user side, so that the actual application effect of the workflow model attribute is achieved.
For example: and if the attribute set by the obtained form title is read-only, setting the attribute of the label where the corresponding form title is located in the front-end form page code as readOnly, so that the effect of read-only of the form title is achieved.
In summary, compared with the first embodiment, in the method for implementing a workflow model in the foregoing embodiment of the present invention, when a connection between a user side and a server side is created, a corresponding interface connection file is generated through interface information of the interface, and whether the interface connection file meets a standard or not is determined.
EXAMPLE III
Referring to fig. 3, a workflow model implementation system according to a third embodiment of the present invention is shown, and the workflow model implementation system includes:
the creating module 11 is configured to create a plurality of workflow model attributes, and render the plurality of workflow model attributes to a server;
further, the workflow model attributes at least include an attribute identifier, an attribute name, and an attribute configuration, and the creating module 11 includes:
the rendering unit is used for rendering the attributes of the workflow models in sequence through the attribute names to obtain a plurality of form items;
and the adding unit is used for adding the form item, and the attribute value and the attribute identification corresponding to the form item to the server.
The calling module 12 is configured to call an interface of the server when an operation request of a user side is obtained, and establish a connection between the user side and the server side through the interface;
further, the calling module 12 includes:
the acquisition unit is used for calling an interface of the server through an HTTP service request and acquiring interface information of the interface;
the judging unit is used for generating a corresponding interface connection file according to the interface information and judging whether the interface connection file meets a preset standard or not;
the construction unit is used for introducing the interface connection file into the user side if the interface connection file meets a preset standard so as to construct the connection between the user side and the server side.
And the execution module 13 is configured to obtain, through the interface, a workflow model attribute corresponding to the operation request in the server, so that a user executes a corresponding operation according to the corresponding workflow model attribute.
Further, the executing module 13 includes:
the analysis unit is used for acquiring the workflow model data corresponding to the operation request from the server through the interface and analyzing the workflow model attribute in the workflow model data;
and the execution unit is used for calling the attribute processing implementation code corresponding to the operation request in the workflow model attribute so as to enable a user to execute the corresponding operation according to the attribute processing implementation code.
The functions or operation steps of the modules and units when executed are substantially the same as those of the method embodiments, and are not described herein again.
The workflow model implementation system provided by the embodiment of the invention has the same implementation principle and technical effect as the method embodiment, and for brief description, no part of the system embodiment is mentioned, and reference may be made to the corresponding content in the method embodiment.
Example four
Referring to fig. 4, a computer device according to a fourth embodiment of the present invention is shown, which includes a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20, where the processor 20 implements the workflow model implementation method when executing the computer program 30.
The memory 10 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 10 may in some embodiments be an internal storage unit of the computer device, for example a hard disk of the computer device. The memory 10 may also be an external storage device in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 10 may also include both an internal storage unit and an external storage device of the computer apparatus. The memory 10 may be used not only to store application software installed in the computer device and various kinds of data, but also to temporarily store data that has been output or will be output.
In some embodiments, the processor 20 may be an Electronic Control Unit (ECU), a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data Processing chip, and is configured to run program codes stored in the memory 10 or process data, such as executing an access restriction program.
It should be noted that the configuration shown in fig. 4 does not constitute a limitation of the computer device, and in other embodiments, the computer device may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components may be used.
An embodiment of the present invention further provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the workflow model implementing method as described above.
Those of skill in the art will understand that the logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.