Building a workflow designer with Silverlight (iii)

Source: Internet
Author: User

This article supporting source code

Latest Version Online Demo: HTTP://219.153.66.61/WF

New feature survey: The system here already has a prototype of the designer, of course, there are many needs to improve the function, if you have experience in this area, please provide your valuable advice, you can leave you want to implement the function, in the subsequent version, we will consider your comments, thank you very much:

This article continues the contents of the previous article, mainly about and import XM, export Xm,xml storage related to some content. Contains the following sections:

Designing an XML description file for a flowchart

Export a flowchart to XM

Rendering a flowchart from an XML file

After the completion of the above content, further in-depth thinking, now that you can save the current state of the process as XM, save the current state in memory every time the process changes, and then restore from memory when needed, so that you can implement the Undo and forward function in Word, so the function adds two more.

Revoke

Forward

In the further, if the memory of the collection of XML objects automatically play according to a certain frequency, is not an animation, hehe, we can use this to make a simple cartoon.

IV. XML Access

4.1 XML content

is the ability to save flowcharts as XML files and to restore flowcharts based on XML files. First look at the format of the XML file. The XML file is used to describe the process, in this article, the layout information of the process has several main aspects:

The property information for the process. such as process name, etc.

Activity and rule property information, such as activity name, etc.

Location information for activities and rules

Associated information for activities and rules

We have designed an XML file that can fully describe the above content, and here is an implementation of this XML description.

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>

<WorkFlow ID="" Name="" Description="">

<Activitys>

<Activity ActivityID="" ActivityName="" PositionX="" PositionY="" ZIndex="">

</Activity>

</Activitys>

<Rules>

<Rule RuleID="" RuleName="" BeginActivityID="" EndActivityID="" BeginPointX="" BeginPointY="" EndPointX="" EndPointY="" ZIndex="">

</Rule>

</Rules>

</WorkFlow>

The above content needless to say, everybody looks the name should be possible to guess.

We can also generate the corresponding workflow.xsd file using the Xsd.exe tool (. NETFramework SDK), which is the way to manipulate this XML file by generating class from the. xsd file. NET is very convenient. (This is not done here, and the XML file is manipulated directly using LINQ to XML)

If you don't understand some of the XML-related technologies, you can refer to

http://www.w3schools.com/xm/default.asp or http://www.w3schoo.com.cn/(Chinese version)

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.