Building a workflow Designer using Silverlight (16)-Persisting data to database-database structure

Source: Internet
Author: User
Tags silverlight backup

16.1 Data structure

The current process information is not saved to any one of the sustainable environment, according to the suggestions of users, increase the function of storing workflow XML files. This feature is implemented using a database, and you can have more persistent ways.

Depending on the implementation of the workflow engine, some engines require only an XML file configuration, and some engines need to build a database model. In this article, assume that the workflow engine is related to the database.

The whole persistence process is like this:

Download the appropriate process XML description from the server using WebServices (or create a new process)

Process design or modification by using the process designer on the client, where any modifications are done locally

After the user clicks on the Save button, the corresponding XML string is generated according to the current process and uploaded to the server via WebServices.

Parse the XML file on the server and update the corresponding data to the database

First you need to define the data tables for some workflows, including process tables, activity tables, and rule tables. Because process monitoring is not yet involved, the workflow instance table is not considered. In addition, in order to simplify the program, also did not configure the activity type, the rule type and so on auxiliary table, but directly in the related activity and the rule table set the related field.

Process table (workflow_process)

Field name Type Significance
WorkflowId Pk,varchar (M), not nul Primary key
Workflowname Nvarchar (M), not nul Process Name
Workflowxm Ntext,not nul Process XML Description file

Activity Table (workflow_activity)

Field name Type Significance
ActivityID Pk,varchar (M), not nul Primary key
Activityname Nvarchar (M), not nul Activity name
Activitytype Varchar (M), not nul Activity type
ProcessID Fk,varchar (M), not nul Associated Process ID

Rules table (Workflow_rule)

Field name Type Significance
RuleId Pk,varchar (M), not nul Primary key
RuleName Nvarchar (M), not nul Rule name
Beginactivityid Fk,varchar (M), nul Relevance of the Revelation activity
Endactivityid Fk,varchar (M), nul Associated End Activity
Condition Nvarchar (1000), nul Circulation conditions
RuleType Varchar (M), not nul Rule type

The following picture shows the relationship of these tables.

You can download this program source code and database backup file (sq2005 data backup file) in CodePlex

(Recent update is not so frequent, forgive me.) )

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.