Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy a simple attendance replacement function in IDEA

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to deploy a simple attendance replacement function in IDEA, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

1. First create a new bpmn directory under the resource directory.

2. Right-click the bpmn directory-- > new-- > bpmn file, and enter the name of the bpmn file. The following interface appears:

On the left side of the interface is the properties panel, where you can view and modify the attribute values of each bpmn element, with the bpmn flowchart in the middle and the various elements in the flowchart on the far right.

3. Draw the flow chart

1) drag and drop a StartEvent (start event) and an EndEvent (end event) into the flowchart and set the names to "start" and "end", respectively.

2) drag and drop two UserTask and set the name to technical manager approval and personnel specialist confirmation respectively

3) connect the graphics, such as the image above, hint: move the mouse to the center of the graph, the shape of the icon will change, and then drag to the next drawing to complete the connection.

4. Generate flow chart png picture

Deploying an Activiti process requires a bpmn file and a flowchart image (in png format). You can copy the bpmn file and change the suffix to xml. Right-click on the xml file-- > Diagrams-- > Show BPMN2.0 Designer, the following interface appears:

Click the export button at the top left, select the bpmn directory under resources, and it will be saved as a png image.

5. Deployment process

The previous chapter introduced ProcessEngine, the core engine of Activiti, and all services need to be obtained through the process engine.

Deployment process needs to use RepositoryService, warehouse service is to store related services, generally used to deploy process files, obtain process files, query process definition information and other operations, is an important service in the engine.

How to get it:

RepositoryService repositoryService

= engine.getRepositoryService ()

Deployment process:

@ Test

Public void deployAddSigninProcess () {

/ / get the configuration object

ProcessEngineConfiguration config =

ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault ()

/ / create a core engine

ProcessEngine processEngine = config.buildProcessEngine ()

/ / obtain warehouse service

RepositoryService = processEngine.getRepositoryService ()

/ / deployment process, which supports chain programming

RepositoryService

.createDeploxation () / / create deployment object

.key ("addsigninProcess") / / set the key value of the deployment process

.addClasspathResource ("bpmn/proc_addsignin.bpmn") / / add bpmn file

.addClasspathResource ("bpmn/proc_addsignin.png") / / add png file

.name ("replenishment process") / / set the process name

.deploy (); / / deploy

}

After executing the above code, records are inserted into the following three tables:

Act_re_deployment stores the display name and deployment time of the process definition, adding a record for each deployment

Act_re_procdef stores the attribute information of the process definition, and the deployment process definition adds a record to this table.

Act_ge_bytearray stores the relevant deployment information defined by the process. That is, the place where the process definition document is stored.

Following the process of resigning, we can basically complete the process deployment of Activiti. Next, we only need to follow the deployment process to complete the whole process.

Thank you for reading this article carefully. I hope the article "how to deploy a simple attendance replacement function in IDEA" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report