example demonstrates the definition of a business process using the workflow component of the Rdiframework.net framework-leave application process-web

Source: Internet
Author: User
Tags table definition

Example Demo using rdiframework.net Framework's Workflow component

make business process definition - Leave application process-web

Reference article:

Rdiframework.net-based on. NET rapid Information System development Framework-Series catalogue

Rdiframework.net━. NET rapid Information System development framework-Introduction to Workflow components

Rdiframework.net━. NET rapid Information System development Framework-Workflow component Web business platform

Rdiframework.net━. NET rapid Information System development Framework-Workflow component WinForm Business platform

example demonstrates the definition of a business process using the workflow component of the Rdiframework.net framework-leave application process-winform

The Rdiframework.net workflow component is supported by the Rdiframework.net framework, based on our years of Project experience and project practice, combined with a set of process management components developed with the characteristics of major domestic workflow products. This component takes into account not only the construction of a business system from zero, but also the integration with existing business systems. From a zero-build system, we can use the Rdiframework.net framework to build a business system quickly. With the integration of existing systems, our process engine provides a rich functional interface for three-party business system calls, and provides the full source of components for user-friendly integration. The Rdiframework.net Workflow component takes the SOA architecture pattern and the process engine supports WCF-mode access. Support B/S/C system, support SQL Server, Oracle and other mainstream databases.

The Rdiframework.net━ Workflow component mainly covers the design and definition of workflow, the initiation and operation of process instances, the monitoring and management of business processes, the integration and collaboration of workflow components with business systems, and so on.

first, leave process business description

The staff leave process in the enterprise each big information system basic will involve, this article I will show you use Rdiframework.net Workflow component to customize the employee leave process. The current request for leave business process is this:

Employees leave the first to submit to the Department of the absence of the "section manager" approval, if the number of days of absence is equal to 3 days "department manager" has the right to directly approve, otherwise need to submit to "branch general manager" approval.

ii. definition of leave application process

Leave application business process We are clear, now we use the rdiframework.net framework for the definition of leave application. The resulting leave process is as follows:

third, leave application business form development

Now the definition of the entire process of leave application we have finished, we began to develop the absence form, form development is very simple, we can follow the normal development form of the way to develop, and then loaded into the framework. We need to set up a request for leave form in the database before issuing a form. The table needs to contain the following four fields: WorkflowId (Workflow primary key), Workflowinsid (workflow instance primary key), Worktaskid (work task primary key), Worktaskinsid (work task instance primary key). As shown in the following:

  

Table Definition OK, now we are going to develop business forms, business forms refers to the form used in the process, the interface of the form file is generally divided into 2 types: The editing interface and the query interface, the editing interface refers to the new and modified information interface, the query interface refers to the query form data interface, The difference is that the former has an input area and the latter has no input area. They can also be implemented in the same form to control the editing of the page by setting the status of the form (view, modify, new). The style and design of the form can be set according to your preference, without special requirements. As long as you coordinate with other modules.

Open VS, develop a leave application form (note that there are many ways to develop it, just to make it easier to explain, to do it simply, to expand it yourself), as shown in:

Then write the form code, in the code can freely implement the form's business logic, very flexible. At the same time, the business table of the process needs to inherit from the base class (Baseusercontrol) We have implemented, and then overload the corresponding method. The following is a list of business form implementation codes for the entire leave application, as follows:

Using system;using system.data;namespace rdiframework.webapp.bizmodules{using Rdiframework.bizlogic;    Using Rdiframework.utilities;             Public partial class Ucqingjia:baseusercontrol {protected void Page_Load (object sender, EventArgs e) { Base.            Page_Load (); if (!            IsPostBack) {initdata ();        }}///<summary>////For form data presentation, considering return of form to re-processing and saving drafts//////</summary>            private void InitData () {String sql = "SELECT * from Testqingjia where [email protected]"; var sqlbuilder = new Sqlbuilder (this.            Workflowdbprovider);            Sqlbuilder.beginselect ("Testqingjia");            Sqlbuilder.setwhere ("Workflowinsid", Workflowinsid);            DataTable dt = Sqlbuilder.endselect (); if (dt! = null && dt. Rows.Count > 0)//To determine if there is data, there is data to read the value in the database {lbuserid.text = dt. rows[0]["userid"].  ToString ();              Lbusername.text = dt. rows[0]["UserName"].                ToString (); Lbdutycaption.text = dt. rows[0]["Dutycaption"].                ToString (); Lbarchcaption.text = dt. rows[0]["Archcaption"].                ToString (); Tbxstarttime.value = dt. rows[0]["BeginTime"].                ToString (); Tbxendtime.value = dt. rows[0]["EndTime"].                ToString (); Tbxdays.text = dt. Rows[0]["Days"].                ToString (); Tbxqingjia.text = dt. rows[0]["Qingjia"].                ToString (); Dpltype.text = dt. rows[0]["Qingjiatype"].            ToString ();                } else//If there is no data, initialize the default value {Lbuserid.text = UserId;                Lbusername.text = UserName;                Lbdutycaption.text = dutycaption;                Lbarchcaption.text = archcaption;                Tbxstarttime.value = DateTime.Now.ToShortDateString ();            Tbxendtime.value = DateTime.Now.ToShortDateString (); }}///<summary>///form data submission, avoid duplicate submissions       </summary> public override void Saveusercontrol (bool isdraft) {base.            Saveusercontrol (Isdraft); var sqlbuilder = new Sqlbuilder (this.            Workflowdbprovider);             String sql = "Delete Testqingjia WHERE [email protected]";//First delete the original data sqlbuilder.begindelete ("Testqingjia");            Sqlbuilder.setwhere ("Workflowinsid", Workflowinsid);            Sqlbuilder.enddelete ();            Sqlbuilder.begininsert ("Testqingjia");            Sqlbuilder.setvalue ("WorkflowId", WorkflowId);            Sqlbuilder.setvalue ("Worktaskid", Worktaskid);            Sqlbuilder.setvalue ("Workflowinsid", Workflowinsid);            Sqlbuilder.setvalue ("Worktaskinsid", Worktaskinsid);            Sqlbuilder.setvalue ("ID", Businesslogic.newguid ());            Sqlbuilder.setvalue ("UserId", Lbuserid.text);            Sqlbuilder.setvalue ("UserName", Lbusername.text);            Sqlbuilder.setvalue ("Dutycaption", Lbdutycaption.text); SqlbuildEr.            SetValue ("Archcaption", Lbarchcaption.text); if (this. Workflowdbprovider.currentdbtype = = currentdbtype.oracle) {sqlbuilder.setvalue ("BeginTime",!st Ring. IsNullOrEmpty (tbxstarttime.value)? Businesslogic.getoracledateformat (Datetimehelper.todate (tbxstarttime.value)):                Businesslogic.converttodatetostring (Tbxstarttime.value)); Sqlbuilder.setvalue ("EndTime",!string. IsNullOrEmpty (tbxendtime.value)? Businesslogic.getoracledateformat (Datetimehelper.todate (Tbxendtime.value)): businesslogic.converttodatetostring            (Tbxendtime.value)); } else {sqlbuilder.setvalue ("BeginTime", Businesslogic.converttodatetostring (Tbxstar                Ttime.value));            Sqlbuilder.setvalue ("EndTime", Businesslogic.converttodatetostring (Tbxendtime.value));            } sqlbuilder.setvalue ("Days", Tbxdays.text); Sqlbuilder.setvalue ("Qingjiatype", Businesslogic.converttostring (Dpltype.selecteditEm.            Text));            Sqlbuilder.setvalue ("Qingjia", Tbxqingjia.text);        Sqlbuilder.endinsert (); }    }}
Iv. binding of forms to business processes

Once the form development is complete, we need to bind the form in the Rdiframework.net framework, as shown in:

A description of the specific items can be found in the introduction document of the Rdiframework.net Workflow section.

You can also set the User Form Management module in the web's business platform, as shown in:

In the, I have defined the "form" sub-form, we click on "Modify sub-form", see the settings, as shown:

In the "Modify sub-form" interface, the "Location:" setting, that is, we developed a business form published to the relative address under IIS, as set by this, the framework can be automatically loaded in.

Sometimes our business may be more complex and involve less than one business form, and our workflow components fully take this into account. So we are associating the task nodes with the main form, which can contain multiple sub-forms. For example: When we launch a request for leave, we will need to fill out the absence form, but also upload some attachments (attachment form we can make a common form), the configuration is as follows:

When the form is defined in the framework, we then bind the form on the leave request each task node, it should be explained that we are bound on the basis of the main form, which means that a task node can have multiple forms, which is very useful for complex business. The following is a list of the form bindings as shown by the department manager in the leave process, the button "..." after "Table sole name" toopen the main form that we have defined as a list of the current task nodes.

v. Leave application demo

Leave requests are business processes that should be available to everyone who logs on to the system, so we designate the handler for the start node of the "Leave request" as "everyone", which means that the "leave application" process can be used as long as the system can be logged on. As shown in the following:

Open the "Daily business" function module to see the business processes that the current user can use, as shown in:

In "Available Business", select "Administrative department", the right side list of the selected node the current user has permission to start all the business processes, we select "Employee Leave Process", click "Start Task", open the main task interface, as shown in. Assuming 5 days of leave, it should be approved by the current user's department manager and also need to be approved by the branch manager.

After clicking Submit, the process is submitted to the department manager "Wikstone" to wikstone the user login, and in the unclaimed task interface, you can see that the leave request has been presented to the department manager, as shown in:

The Rdiframework.net Workflow component contracts All tasks submitted to the other party's unclaimed task list, and the benefit is that if you want to go back after the current commit, you can withdraw the task if you don't claim it. After selecting "Claim Task", proceed to the To do task form as shown in:

After selecting a to-do task, we can "process the task", discard the current task's claim, view the current task's execution flowchart, the current task's "Processing records" and so on. We select the Process Task button to process the current task as shown in:

In the "Processing Task" main interface, we can do a lot of operations, specifically can refer to the Rdiframework.net workflow component of the relevant instructions, here is not elaborated.

Once you have filled out the approval comments, click the Submit button to submit to the "Branch general manager" for approval based on the process definition (the current number of days of absence is greater than 3 days). Below our Branch general manager "CHENP" User Login system, you can see the request for leave has been submitted to the general manager of the branch office. As shown in the following:

In the same way, the task is processed, then submitted, the process can go back to the process to start the user. We take a look at the process initiator login to see the next approval list, as shown in:

At the same time we can look at the process execution, as shown in:

Again, we can view the processing records for the process, as shown in.

In the task interface I am participating in, I can see the situation of all the tasks I am involved in, as shown in:

At this point, the entire leave application business process completed, the current process in the flow of a lot of operations, such as: The Return of the task, authorization, assignment, recall, etc. can be easily achieved.

example demonstrates the definition of a business process using the workflow component of the Rdiframework.net framework-leave application process-web

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.