Document forwarding process custom data modeling

xiaoxiao2021-03-06  54

Develop a complicated enterprise multi-user management information system (MIS), it is impossible to involve the development of data files between multiple users within the system, approval. Since the needs of enterprises always chase over time, in addition, the office processes set up in each enterprise are not the same, a versatility comparison management information system should allow system administrators to define documents.

Although the author did not have the opportunity to implement the file forwarding process customization in the developed MIS, it has been deeply reflecting this design in early 2002. At that time, because some reasons were unable to disclose their design ideas. Now there are many MIS products on the market to provide such functions. The author has left, so it is time to organize my design ideas, share it with you.

First, let us analyze the needs and set the goal.

1) Under normal circumstances, the official documents within the enterprise forwarded, and the approval is transferred according to the department or position, that is, the position is not right. For example, a process of a process requires a financial director approval, and the financial officer for financial officers will be unaffected. Moreover, there may be any one of a certain sector in a certain sector, or all personnel of the department need to approval. 2) The process is transferred, and the approved documents are generally divided into two formats of documents and forms. The official document in the file format should support batch processing, which can forward multiple files at a time. You can only return to one of the unqualified files when applying approval, and other files can be transferred to the next link to continue processing. The format of the form of form should allow users to define their own format to determine the entries in the form. Similarly, the form should also support batch processing. 3) The action of processing the document in the process should be able to let the user define themselves. This will increase the new processing action in the future, nor does it need to modify the underlying data modeling of the MIS system. Of course, to achieve new processing actions, but also need to write corresponding code in the business logic layer, but it is much more effort to modify the underlying data modeling. 4) The number of the links of each process is not necessarily the same, and the user should be allowed to set the number of links, specify the transmission department and acceptor, processing mode, and longest wait time of each link in the official circulation. 5) After the document to be processed is issued, the system should issue a notification to the user (we) of the next link in the flow time in the waiting time, reminding the user (we) to process until the official document has been processed. If the longest waiting time is exceeded, the official document has not been processed by the user (we), the process failed. Enterprise management may require recording related information to refer to the date of business process restructuring (BPR) in the future. 6) Some companies require cross-link processing in a process due to special reasons. For example, the flow has 6 steps, and the intermediate three links can be skipped after the process is executed to the second link, directly to the last link waiting. In fact, in this case, it is not necessary to implement its flexibility on the technical level, which is a few. Users only need to define a new process, add the first, 2rd, 6 steps of the above flow, and the process is distinguished between the two processes. An excellent system architect should make full use of existing tools, don't make anything you have to develop.

The above demand is high, the degree of abstraction is deep, so the development of the performance layer and the business logic layer is large, the initial investment is more, but it is estimated that it is estimated that there is no need to modify the underlying database. The continuous change in documents in the future. If you don't need such high flexibility, you can simplify some assumptions according to the actual project. The use case analysis and data modeling is performed in accordance with the above requirements.

1) Since the sender and acceptor of the process link is not a person, we should first describe the organization of the entire enterprise and determine the responsibility of each department. There may be some sub-sectors in the large sectors, and there are different positions in each sub-sector, which is responsible for handling corresponding transactions. Therefore, you can build a tree-related data table to save your corporate structure, then, then, use the rights list and user groups to save the functions of each department for each department. This design idea sees my previous "Talking about Database Design Skills (Parts), (below)", I will directly give a rough data table structure directly: department table (Department_table) Name Type constraint condition Description DP_ID INT No Repeat the category ID, the primary key DP_NAME VARCHAR (50) does not allow the empty type name, not allowing DP_FATHER INT to be repeated, the parent category identification of this category is not allowed, if it is the top node, set to a single value DP_LAYER VARCHAR (6) Limited 3 layers, the initial value of 000000 category is traversed, mainly for retrieving the number of retrieval databases

Function_Table Name Type Constrained Condition Description F_ID INT No Duplicate Function Identity, Motor Keys F_NAME VARCHAR (20) Does Not Allows F_Desc Varchar (50) Allow Empty Function Description

User Group (User_Group) Name Type Constraint Condition Description Group_ID INT No Duplicate User Group Identification, Primary Key Group_Name Varchar (20) Does Not Allow Empty User Group Name Group_Power Varchar (100) Does not allow empty user group rights list, content is a functional table F_ID collection

User_Table Name Type Constraint Condition Description User_ID INT No Duplicate User ID, Motor Key User_name Varchar (20) None User Name User_PWD VARCHAR (20) Does not allow empty user password USER_TYPE INT Not allowed to be empty belonging to the user group identifier, and User_group.group_id association

Description: A user group of different permissions, such as a user group as a "Marketing Sales", and the user group can send a reimbursement application in the process "reimbursement application".

2) Although the documents in the process are divided into files and forms of format, each file / form should have its unique identity, name and other attributes. Therefore, we extract the official documents to extract the common attributes of the two formats to establish a document form.

Document Form (Document_Table) Name Type Constrained Condition Description Doc_id Int No Duplicate Document Identity, Master DOC_NAME VARCHAR (50) Does not allow empty document name DOC_TYPE CHAR (1) Do not allow empty document type

The DOC_TYPE field is used to distinguish the official document format. At present, there are only 2 formats, and "1" indicates that the file format, "2" indicates a form of format. It is estimated that there is not too much new document format in the future, so this field only needs one character. Documents in the file format are generally fixed in the file, and we can save the entire file directly with a binary field. The official document in the file format needs to build a table to save related information. The general data sheet is as follows: File (file_table) Name Type constraint condition Description File_ID INT No duplicate file ID, the primary key file_name varchar (50) does not allow empty file name File_Value Binary Do not allow empty file content ...

The format of the form is to let the user define their own format to determine the entry in the form. There are two ways to implement: 1 When the user creates a new format form, a table is created, and the table item entered by the user is created as the field of the table. The advantage of this approach is that the form query is relatively convenient, and the development of the business logic layer is small. The disadvantage is that it is not flexible. If the format of the different formats used in the company (> 20), the structure of the entire database is more confusing, and there are the same fields in most forms, which also adds data redundancy. The data modeling in this way is as follows:

Form Table (SHEET_TABLE) Name Type Constrained Condition Description SHEET_ID INT No Duplicate Form ID

Table 1 (SUB_TABLE1) Name Type Type Constrained Condition Description Sub_ID INT No Duplicate Table Subscum Identifier, Probate Option1 VARCHAR Does Not Allow Empty Form Table Item 1Option2 VARCHAR Does Not Allow Empty Form Table Item 2Option3 VARCHAR Not Allowed for Empty Form Table Item 3 ......

Table 2 (SUB_TABLE2) Name Type Constrained Condition Description Sub_ID INT No Duplicate Table Subscriber Identity ......

......

2 A summary of the form, regarding the form as a collection of several form forms. The advantage of this way is quite flexible. When the user creates a new format, only the desired entries needed from the existing form table, and the entire database structure is clear, no data redundancy. The disadvantage is that the development is complicated, the workload is much higher than the above, and the form query is slow. Below is the data modeling of this way:

Form Table (Sheet_Table) Name Type Constrained Condition Description SHEET_ID INT No Duplicate Form ID

Form table read table (OPTION_TABLE) Name Type Constrained Condition Description OP_ID INT No Duplicate Form Table Item Identification, Primary Keys OP_NAME VARCHAR (50) Does not allow the empty form entry name OP_LENGTH INT does not allow the empty form table Item length op_Unit varchar (10) Allows the unit unit

Form Information Table (SheetInfo_Table) Name Type Constrained Condition Description INFO_ID INT No Duplicate Form Information ID Associated info_value varchar () does not allow empty form information value 3) We can forward the process of document forwarding, seeing as an entity superclass. The table is as follows:

Flow Table (Flow_Table) Name Type Constrained Condition Description Flow_ID INT No Duplicate Process Identity, Master Key Flow_name Varchar (50) Does Allow Empty Process Name Flow_Stepnum Int Not Allows Empty Process Step_Desc VARCHAR (200) Allow Empty Process Description

Each step in the process can abstract into the use case from the sender to the recipient, and its data modeling is approximately as follows:

Processing action table (Action_Table) Name Type Constrained Condition Description A_ID INT No Duplicate Action Identification, Mode A_NAME VARCHAR (20) Does Not Allow Module A_Call Varchar (50) Module A_Desc VARCHAR (200) allowed to be called empty action Empty action description

Note: If you use a process-oriented development method, such as a pure scrip language, you can write each processing action into a function, call the A_CALL field record, you can complete the corresponding processing action. If an object-oriented development method can be encapsulated with a COM component, a_call is used to record the interface method of the corresponding COM component. If it is in the .NET Framework environment, a web service can be used. Of course, the sender, the acceptor, and the official document identifier are input parameters.

Procedure Table (STEP_TABLE) Name Type Constrained Condition Description Step_ID INT No Duplicate Logo, the primary key Belong Int does not allow the space belonging, and the flow_table.flow_id associated setp_order int does not allow the step order Sender Int of the empty space to be illegal Empty sender ID, and user_group.group_id association Receiver Int does not allow empty acceptor ID, and user_group.group_id association A_ID INT does not allow empty processing action identity, and action_table.a_id association A_TYPE INT does not allow empty acceptance The number of handles MAX_WAIT INT is not allowed to wait for the longest waiting time WAIT_UNIT VARCHAR (5) Do not allow the unit of empty waiting time

Note: A_TYPE is used to determine the number of processing required to accept the acceptor, and "0" means that everyone needs to be processed together, "1" means that only one of the positions, "2" means that the position is required. Any two employees are handled together, and the ways to process ... together ... together, for example, a voting method, a few obeys a majority, or someone has a ticket veto right. It may be refined for some processing actions, and the relevant data modeling is performed, and I will not subdue it here. 4) The process link record forwarded by the official document is analyzed. At this time, it is equivalent to instantiating an object, the sender, and the acceptance method should be concluded to a certain (some) users of the management information system, not a user group. Each time, in addition to saving this information, we must also save the documents forwarded by the link, as well as information such as processing. Moreover, the number of documents forwarded the number of official documents is greater than or equal, so I can refer to the "Simple Batch M: N Design" in Database Design Skills (below) "before I have released, and I have been roughly as follows:

Procedures Log_ID INT No Duplicate Logo, Main Keys STEP_ID INT does not allow empty link identification, and STEP_TABLE.STEP_ID INT does not allow empty transmission user ID, related users The set of User_Table.user_IDs of the group Receiver Varchar (100) does not allow empty accept user ID, the collection DOC_ID INT of the associated user group's user_table.user_id is not allowed to forward the official document identifier, and Document_Table.doc_id associated BATCH_NO INT is not allowed to be empty Batch forwarding the official document number, the same procedure Forward BATCH_NO The same State Char (1) does not allow empty processing status SUB_DATE DATETIME does not allow empty submission time RES_DATE DATETIME to allow empty processing reply time comment varchar (255) Allow empty processing Reply Note

Note: 1 BATCH_NO forwarded by the same procedure and the LOG_ID of the first entry into the library. Example: Suppose the current largest log_id is 64, then a user forwarded 3 documents at a time, the BATCH_NO recorded by the batch inserted three process links is 65. The other user has forwarded a document through a process link, and the BATCH_ID recorded by the process link is 68. The 2State field is used to describe the state in which the process is located is processed, and it has been processed. It has been processed, or the longest wait time is automatically reclaimed by the system. Through this field, we will issue a notice of accepting users, and you can easily query all the processes that are automatically reclaimed by the system exceeding the longest wait time so that the enterprise management is referred to in the future business process restructuring (BPR). 3 If a copy of the document is handled in a certain process, it can be seen as the document to be rejected into the starting point in this process, and the initial transmission user can re-send after modifying the official document according to the processing reply.

转载请注明原文地址:https://www.9cbs.com/read-114975.html

New Post(0)