Use the workflow engine to implement a Work Management Project (shark + JaWE + Tomcat)

Source: Internet
Author: User
Tags ole

After reading this article, you must have used the workflow engine as an example of a pure process, and have the foundation of Java, JSP, and HTML. You also know how to read the related javadoc/CHM to view the APIS required for programming.

 

We use a simple leave process to introduce how to implement a workflow project:

 

The process is very simple. The programmer submits a ticket to the department manager. After receiving the ticket, the department manager determines whether to approve the ticket based on subjective consciousness (dark, haha ...)

 

Since we need to fill out an application form, we must know the path of the application form corresponding to the "Application for leave" activity. In the B/S program, it is the hyperlink of the application form, therefore, we need to add an extended property to the leave application to record hyperlinks, as shown below:

Similarly, the "Manager approval" activity also requires one, and the last two activities are not important, just omitted.

 

Because you need to view the information of the application form during approval, you need to know which application record is. The most direct method is to store the primary key value of the application form in the process, this example assumes that the table is a single primary key, so we add a workflow-related dataset ID in the process definition.

The approval process is determined based on the approval result through/failure. Therefore, we also need a workflow dataset auditresult (Boolean)

 

 

 

Then you need to set the expression to determine the direction.

The other path is not set, and the engine automatically determines.

 

The following describes the functions of each procedure:

Thanks to csdn, this figure is lost and furious...

The following shows the implementation code.

...

...

...

You want to be beautiful. Just sort it yourself ~~

 

 

Postscript:

This article is quite depressing, because I didn't want to draw a process at the beginning, and later I found it difficult to explain the relationship between the engine and the business system.

Then I found that it was not easy to describe what the program should do in each step of the process, so I drew a description diagram, but this figure does not know which one belongs, I also don't know what others can't understand. Workflow activity step program pseudo code diagram? -- Such a long name is good enough.

 

 

That's it. For beginners of workflow, refer to this article.

 

 

 

The combination of the workflow engine and the Business System is to store some other information in one of them. I used the method of storing business information in the engine, and of course it can be reversed, store the process sequence number and activity sequence number in the business table.

 

 

Currently, any open-source workflow engine can be applied to projects. The key is to see which engine is suitable for the technical route and market considerations.

However, it is generally difficult to replace an engine at the beginning, because the engine features are constantly being expanded and the compatibility of historical projects must be ensured, transferring the code to another engine is a huge project.

 

 

 

 

My original documents are copyrighted by myself. If you want to reprint them, please indicate the author and its source.

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.