Research on the Application of J2EE technology in E-commerce

Source: Internet
Author: User

Workflow management technology provides a new mechanism to assist enterprises in more effective production and circulation management and decision-making support. This article mainly studies the application of Workflow Management Technology in e-commerce, and proposesJ2EEThe system architecture of the platform's workflow system is designed, and the implementation method of the workflow engine is analyzed.

I. Introduction

The concept of workflow is generated to improve work efficiency. It was initially applied to office automation and production organization fields, by passing documents, information, or tasks among participants according to predefined rules, the goal is to break work into tasks and roles, perform and monitor these tasks according to certain rules and procedures. Workflow management is an important branch in the field of Computer Support Cooperative Work, it has been proved by practice that it can greatly improve the efficiency of the management process, reduce production costs, and improve the level of production management.

In an enterprise's e-commerce activities, a large amount of business work is done by two or more employees, this series of related activities and activities constitute the e-commerce business process according to the change process of certain rules, such as the sales order management process, administrative application process, financial approval process, customer service process, and personnel handling process. In e-commerce, it is an effective way for enterprises to improve their competitiveness to quickly respond to customer needs and adjust business processes in a timely manner when market needs change. Developing a business workflow management system is an effective solution to the above problems.

Ii. Architecture of Workflow System Based on J2EE and Web

J2EE provides an enterprise-level computing model and runtime environment, and uses EJB Server as the deployment environment for commercial components, all services (JTS, JMAPI, JMS, and JNDI) required by components in the distributed computing environment are provided in the EJB Server container ). EJB components that implement business logic can run on application servers more efficiently and support access from multiple clients. J2EE makes enterprise-level applications secure, scalable, and reliable. Using J2EE as a workflow development platform meets the application requirements of E-commerce construction.

The implementation of the workflow system in the e-commerce platform adopts a three-tier architecture. The core service is implemented using EJB Based on the J2EE and WEB workflow systems. The three layers are the customer application layer, business logic layer, and data layer.

1. Application Layer

It is the user application part of the workflow platform. It uses HTML technology, and users participate in business process processing through Web browsers. The client only provides the user's desktop program interface. The client program is responsible for managing all communications with the workflow engine and providing users with a list of tasks customized for the specific business content of the enterprise. After logging on to the workflow website and performing authentication, the customer enters different interfaces for their work. Within an enterprise, users at the customer application layer can be divided into four types: workflow designers, system administrators, senior leaders, and common users who complete specific work through the Web interface.

2. Business logic layer

The implementation of the logic layer mainly uses the EJB technology, which accepts request data sent from the Web layer and carries out corresponding actions accordingly to complete pre-defined tasks, and send the requirements for the next step back to the Web layer. The logic layer includes the workflow engine, Web server, App server, and e-commerce business component. The workflow engine is encapsulated as a component. You can call interfaces in the workflow engine. Web Components run on Web servers and are mainly responsible for interaction with customers. The system collects information and data sent from the client through JSP, HTML, XML, and Applet of the Web server, calls the EJB component of the EJB server through Servlet for processing, and returns the result to the Web page. Application Components and EJB components run on the App server. They are responsible for publishing and managing EJB components, managing component lifecycles, connecting to databases, concurrent operations, and distributed transaction processing.

The workflow execution service component is an important part of the workflow management system and is built on the J2EE application server. The execution service component contains the workflow execution server, which is implemented by the workflow engine. The component also provides a user client application template and a work list query tool to provide APIs for upper-layer MIS calls. Technically, JSP, Servlet, and EJB are used. The B/S and C/S hybrid structures are used as a whole. The client-side workflow-related information query uses B/S, the specific business logic is implemented by calling the EJB component on the server side through the RMI or Soap mechanism.

For the B/S part, the MVC mode is used. In this mode, the Servlet acts as the Controller and Processes requests and page flow. The EJB acts as the Model role and encapsulates the business logic and data, JSP acts as a View, which is a data presentation layer that generates a User display interface. The specific implementation steps are as follows: after the JSP page receives a message from the client, the Servlet controls the service flow as needed and submits the actual processing work to the JavaBean, javaBean can call appropriate components as needed to complete relevant work. Bean can use the RMI mechanism to call local App components, or directly call automatic application components and original enterprise application components, you can also use the SOAP mechanism to call remote service components.

3. Data Layer

It is the data basis of the workflow platform. It consists of a workflow model database, a workflow instance database, and a Workflow Organization database, stores, organizes, and maintains model data, instance data, and organization data in the workflow system. The connection between the logic layer and the data layer DBMS is completed through JDBC, which can support most commercial relational databases.

The function modules of Workflow-based e-commerce systems include sales management, inventory management, procurement management, order management, personnel management, customer management, system management, and user management. Users in the system: system administrators, enterprise employees, customers, and suppliers log on to the corresponding Web pages for relevant work. Workflow management is the core part of the system, and its essence is the workflow engine. It provides services such as process definition, Task Assignment, system operation, and monitoring and execution of the workflow system.

Iii. Workflow Engine Design

1. workflow engine Implementation Method

The workflow engine uses the EJB component technology to implement and encapsulate the corresponding business logic. The workflow engine runs mainly through interaction between objects and interface calls to objects, and the various read/write operations they perform on the database. Based on the functions provided by the engine, the engine consists of four management functions: workflow template management, process instance management, activity instance management, and user role management. Main entity beans include process instance Bean, activity instance Bean, role Bean, Department Bean, staff Bean, rule Bean, Team Bean, and task item Bean.

(1) workflow template management Bean

These methods include template creation, deletion, template instantiation, and storage to the database.

(2) process instance management Bean

The methods include initialization process instance, startup process instance, suspension process instance, termination process instance, deletion process instance, and restart process instance.

(3) Activity instance management Bean

The following methods are available: Start activity instance, suspend activity instance, restart activity instance, terminate activity instance, obtain activity instance list, and cancel activity instance.

(4) User role management Bean

The methods include adding users, setting user roles, deleting users, adding roles, and deleting roles.

2. Manage workflow process instances

The XML language is used to represent the e-commerce process model. The process model consists of these entities: processes, activities, routing rules, and workflow-related applications. For example, in the e-commerce order confirmation process model: first, the enterprise sales department verifies the data on the order, transfers the incorrect order to exit, and processes the correct order; then, based on different payment methods selected by the customer, when using a credit card to pay, send the customer's credit card information to the credit card server for approval to confirm whether the payment amount is recognized. Finally, send order confirmation information to the customer.

When a workflow process instance is started, the workflow engine instantiates the XML definition, parses the XML parser, generates objects such as processes, activities, and flow routes, and then stores them in the corresponding table of the database. Objects in the Process model are encapsulated into objects, including Activity, Process, Rule, and WorkflowApp ). The basic attributes of an object include the ID and name, and they share the same method: (1) ContverttoXML (): Convert the attributes of a model element to data in XML format, (2) SavetoDB (): This method saves the information of elements in the model to a specific table in the database.

The execution of an instance in a workflow process can be seen as a state change. Its statuses include initialization, running, activation, suspension, end, and stop. The workflow engine scheduling center converts a workflow process instance from one State to another based on different conditions, such as the startup process, execution task, end task, and other events.

3. Task Management

Task management mainly completes tasks such as task creation, task status conversion, and related data maintenance according to the instructions of the scheduling center. Each external request to terminate a task triggers the scheduling center to call the task management to create a new instance for subsequent activities (if any). The instance status is "pending". At the same time, other different external requests will also trigger task status switching for task management implementation. The main statuses of a task are: initial, processed, paused, in progress, and completed.

(1) task queue

An activity can have multiple instances. Each instance is called a task. In the E-commerce system, a task corresponds to the specific business steps of the enterprise.

(2) Task Distribution

Task Distribution is only applicable to manual interaction activities. It refers to the criteria for assigning tasks to specific personnel for execution. Task distribution can be specified by role or by personnel.

(3) task Status Control Method

The flow engine controls the task status mainly from the task startup rules and subsequent rules. The START rule is expressed by the direct forward task of the phase task. The start rule includes four rules: sequence, connection, or connection, and user-defined rules. The scheduling center checks the startup rules before switching tasks to the pending status. Only tasks that meet the startup conditions can switch the status. The task successor rule refers to the successor tasks that should be started after the current task ends. The successor rule includes four rules: sequence, or branch, and branch, and user-defined.

Iv. Summary

Workflow management technology the enterprise e-commerce system developed through the core technology of Process Modeling and process management can quickly achieve business restructuring of enterprises, so that e-commerce activities are based on information flow, it can comprehensively improve enterprise collaboration capabilities. Based on the research done in this paper, the author believes that the following aspects can be studied in depth: the research work on flexible workflows with adaptability and how to ensure the correctness of dynamic routing in dynamic modeling methods need to be further enriched and expanded, the fault tolerance capability, data protection, data recovery, and exception handling strategies of workflow systems need further research.

Related Article

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.