Example demonstrates how to define a business process using the workflow component of the Rdiframework.net framework-leave application process

Source: Internet
Author: User

example demonstrates how to use the rdiframework.net Framework's Workflow component

make business process definition - Leave application Process

  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

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:

The table is defined, and now we are going to develop the business form, open VS, develop the leave application form, 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 (Frmbasebizeform) 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.workflow{using Rdiframework.bizlogic;    Using Rdiframework.utilities;    Using RDIFramework.WinForm.Utilities; <summary>///Leave application///</summary> public partial class Frmqingjia:frmbasebizeform {p        Ublic Frmqingjia () {InitializeComponent (); private void Frmqingjia_load (object sender, EventArgs e) {base.            Form_Load (); This.            Setcontrolstate (); This.        Showentity (); public override void Setcontrolstate () {if (!string. IsNullOrEmpty (this. Pagestate)) {this.pnlTool.Enabled = this.            Pagestate! = Workconst.state_view; } if (!string. IsNullOrEmpty (this. Ctrlstate)) {gbmain.enabled = btnsave.enabled = this.            Ctrlstate! = "View"; } else {gbmain.enabled = btnsave.enabled =False }} public override void Showentity () {String sql = ' SELECT * from Testqingjia where [EMA            Il 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 {txtuserid.text = dt. rows[0]["userid"].                ToString (); txtUsername.Text = dt. rows[0]["UserName"].                ToString (); Txtduty.text = dt. rows[0]["Dutycaption"].                ToString (); Txtdepartment.text = dt. rows[0]["Archcaption"].                ToString (); Dtbegintime.text = dt. rows[0]["BeginTime"].                ToString (); Dtendtime.text = dt. rows[0]["EndTime"].                ToString (); Txtdays.text = dt. Rows[0]["Days"].                ToString (); Txtqingjia.text = dt. Rows[0] ["Qingjia"].                ToString (); Cboqingjiatype.text = dt. rows[0]["Qingjiatype"].            ToString ();                } else//If there is no data, initialize the default value {Txtuserid.text = UserId;                txtUsername.Text = UserName;                Txtduty.text = dutycaption;                Txtdepartment.text = archcaption;                Dtbegintime.text = DateTime.Now.ToShortDateString ();            Dtendtime.text = DateTime.Now.ToShortDateString (); }} public override void Saveformdata (bool isdraft) {base.            Saveformdata (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", Txtuserid.text);            Sqlbuilder.setvalue ("UserName", txtUsername.Text);            Sqlbuilder.setvalue ("Dutycaption", Txtduty.text);            Sqlbuilder.setvalue ("Archcaption", Txtdepartment.text); if (this. Workflowdbprovider.currentdbtype = = currentdbtype.oracle) {sqlbuilder.setvalue ("BeginTime",!st Ring. IsNullOrEmpty (dtbegintime.text)? Businesslogic.getoracledateformat (Datetimehelper.todate (Dtbegintime.text)): businesslogic.converttodatetostring                (Dtbegintime.text)); Sqlbuilder.setvalue ("EndTime",!string. IsNullOrEmpty (dtendtime.text)? Businesslogic.getoracledateformat (Datetimehelper.todate (Dtendtime.text)): Businesslogic.converttodAtetostring (Dtendtime.text)); } else {sqlbuilder.setvalue ("BeginTime", Businesslogic.converttodatetostring (Dtbegin                Time.Text));            Sqlbuilder.setvalue ("EndTime", Businesslogic.converttodatetostring (Dtendtime.text));            } sqlbuilder.setvalue ("Days", Txtdays.text);            Sqlbuilder.setvalue ("Qingjiatype", Businesslogic.converttostring (Cboqingjiatype.selecteditem));            Sqlbuilder.setvalue ("Qingjia", Txtqingjia.text);        Sqlbuilder.endinsert (); private bool Checkinput () {if (string. IsNullOrEmpty (businesslogic.converttostring (Cboqingjiatype.selecteditem))) {messageboxhelper.sh Owwarningmsg ("Please select the type of Leave!")                ");                Cboqingjiatype.focus ();            return false; } if (string. IsNullOrEmpty (Txtdays.text)) {messageboxhelper.showwarningmsg ("The number of days to leave cannot be empty!")                "); Txtdays.focus();            return false; } if (! Mathhelper.isdecimal (Txtdays.text)) {messageboxhelper.showwarningmsg ("The number of days to leave must be numeric!                ");                Txtdays.focus ();            return false; } if (string. IsNullOrEmpty (Txtqingjia.text)) {messageboxhelper.showwarningmsg ("Leave reason cannot be empty!")                ");                Txtqingjia.focus ();            return false;        } return true; } private void Btnsave_click (object sender, EventArgs e) {if (!            Checkinput ()) {return; } this.            Saveformdata (FALSE); Messageboxhelper.showsuccessmsg ("Saved successfully!        "); }    }}
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. 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

A leave application is a business process that should be available to everyone who logs on to the system, so we specify the processing of 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 4 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 "lsx" 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:

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 how to define a business process using the workflow component of the Rdiframework.net framework-leave application process

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.