Workflow Engine Development Series 2 Database Design

Source: Internet
Author: User

The basic principles are briefly explained in the previous section, which will be explained in detail from this section. The first thing to explain is the data design. The following is the related design of the database.

Table Name: workflowtemplate -- workflow Template
Serial number Column name Data Type Length Decimal places Identifier Primary Key Null allowed Default Value Description
1 Templateid Uniqueidentifier 16 0   Yes No    
2 Templatename Nvarchar 36 0     Yes    
3 Workflow Nvarchar 100 0     Yes    
4 Recordstatus Nvarchar 36 0     Yes    
5 Createdate Smalldatetime 4 0     Yes Getdate  
6 Createuserid Int 4 0     Yes    
7 Modifydate Smalldatetime 4 0     Yes Getdate  
8 Modifyuserid Int 4 0     Yes    
Table Name: workflowtemplateflow -- template Activity
Serial number Column name Data Type Length Decimal places Identifier Primary Key Null allowed Default Value Description
1 Flowid Uniqueidentifier 16 0   Yes No    
2 Activity Nvarchar 100 0     Yes    
3 Activityname Nvarchar 36 0     Yes    
4 Activitytype Nvarchar 36 0     Yes    
5 Applicationcode Nvarchar 100 0     Yes    
6 Templateid Uniqueidentifier 16 0     Yes    
7 Parentflowid Uniqueidentifier 16 0     Yes    
8 Containerflowid Uniqueidentifier 16 0     Yes    
9 Groupid Uniqueidentifier 16 0     Yes    
10 Isgroup Int 4 0     Yes    
11 Isexpire Bit 1 0     Yes    
12 Isnotice Bit 1 0     Yes    
13 Expireday Int 4 0     Yes    
14 Desciption Nvarchar 250 0     Yes    
15 Recordstatus Nvarchar 36 0     Yes    
16 Createdate Smalldatetime 4 0     Yes Getdate  
17 Createuserid Int 4 0     Yes    
18 Modifydate Smalldatetime 4 0     Yes Getdate  
19 Modifyuserid Int 4 0     Yes    
Table Name: workflowflowrole -- activity approval permission
Serial number Column name Data Type Length Decimal places Identifier Primary Key Null allowed Default Value Description
1 Roleid Uniqueidentifier 16 0   Yes No    
2 Flowid Uniqueidentifier 16 0     Yes    
3 Refroletable Nvarchar 100 0     Yes    
4 Refroleid Int 4 0     Yes    
5 Roleremark Nvarchar 250 0     Yes    
Table Name: workflowflowcondition -- branch node Condition
Serial number Column name Data Type Length Decimal places Identifier Primary Key Null allowed Default Value Description
1 Conditionid Uniqueidentifier 16 0   Yes No    
2 Flowid Uniqueidentifier 16 0     Yes    
3 Targetflowid Uniqueidentifier 16 0     Yes    
4 Entityname Nvarchar 100 0     Yes    
5 Entityformula Nvarchar 250 0     Yes    
6 Entityvalue Nvarchar 250 0     Yes    
7 Entityremark Nvarchar 250 0     Yes    

 

Table Name: workflowinstance -- Workflow running instance
Serial number Column name Data Type Length Decimal places Identifier Primary Key Null allowed Default Value Description
1 Instanceid Uniqueidentifier 16 0   Yes No    
2 Templateid Uniqueidentifier 16 0     Yes    
3 Templatename Nvarchar 36 0     Yes    
4 Workflow Nvarchar 100 0     Yes    
5 Bizkey Nvarchar 100 0     Yes    
6 Orgkey Nvarchar 100 0     Yes    
7 Runstatus Nvarchar 36 0     Yes    
8 Recordstatus Nvarchar 36 0     Yes    
9 Createdate Smalldatetime 4 0     Yes Getdate  
10 Createuserid Int 4 0     Yes    
11 Modifydate Smalldatetime 4 0     Yes Getdate  
12 Modifyuserid Int 4 0     Yes    
Table Name: workflowinstanceflow -- Workflow running instance Node
Serial number Column name Data Type Length Decimal places Identifier Primary Key Null allowed Default Value Description
1 Instanceflowid Uniqueidentifier 16 0   Yes No    
2 Instanceid Uniqueidentifier 16 0     Yes    
3 Flowid Uniqueidentifier 16 0     Yes    
4 Activity Nvarchar 100 0     Yes    
5 Activityname Nvarchar 36 0     Yes    
6 Activitytype Nvarchar 36 0     Yes    
7 Applicationcode Nvarchar 100 0     Yes    
8 Templateid Uniqueidentifier 16 0     Yes    
9 Parentflowid Uniqueidentifier 16 0     Yes    
10 Containerflowid Uniqueidentifier 16 0     Yes    
11 Prevflowid Uniqueidentifier 16 0     Yes    
12 Groupid Uniqueidentifier 16 0     Yes    
13 Isgroup Int 4 0     Yes    
14 Isnotice Bit 1 0     Yes    
15 Isexpire Bit 1 0     Yes    
16 Expireday Int 4 0     Yes    
17 Desciption Nvarchar 250 0     Yes    
18 Recordstatus Nvarchar 36 0     Yes    
19 Createdate Smalldatetime 4 0     Yes Getdate  
20 Createuserid Int 4 0     Yes    
21 Modifydate Smalldatetime 4 0     Yes Getdate  
22 Modifyuserid Int 4 0     Yes    
Table Name: workflowinstancerole -- Workflow running instance role
Serial number Column name Data Type Length Decimal places Identifier Primary Key Null allowed Default Value Description
1 Instanceroleid Uniqueidentifier 16 0   Yes No    
2 Instanceflowid Uniqueidentifier 16 0     Yes    
3 Roleid Uniqueidentifier 16 0     Yes    
4 Flowid Uniqueidentifier 16 0     Yes    
5 Refroletable Nvarchar 100 0     Yes    
6 Refroleid Int 4 0     Yes    
7 Roleremark Nvarchar 250 0     Yes    
Table Name: workflowinstancecondition -- Workflow running instance Conditions
Serial number Column name Data Type Length Decimal places Identifier Primary Key Null allowed Default Value Description
1 Instanceconditionid Uniqueidentifier 16 0   Yes No    
2 Instanceflowid Uniqueidentifier 16 0     Yes    
3 Conditionid Uniqueidentifier 16 0     Yes    
4 Flowid Uniqueidentifier 16 0     Yes    
5 Targetflowid Uniqueidentifier 16 0     Yes    
6 Entityname Nvarchar 100 0     Yes    
7 Entityformula Nvarchar 250 0     Yes    
8 Entityvalue Nvarchar 250 0     Yes    
9 Entityremark Nvarchar 250 0     Yes    
It can be seen from the above that running an instance is a template copy, that is, copying the same business process while running, and then running all instances to operate on instance objects.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.