How to create Activiti Event Listener with Spring Boot Examples
springboot
164
activiti
4
listener
1
spring
76
Male avatar

loveprogramming viết ngày 05/05/2021

https://grokonez.com/java-integration/activiti-event-listener-spring-boot-example

How to create Activiti Event Listener with Spring Boot Example

Activiti provides event mechanism that allows us to get notified when various events occur within the engine. In this tutorial, we're gonna look at an example that uses Activiti Event Listener with Spring Boot.

Related Posts:

I. Activiti Event Listener Overview

1. Implementation

The first thing we have to do is implementing org.activiti.engine.delegate.event.ActivitiEventListener interface. You can find all supported event types at Activiti User Guide.


public class MyEventListener implements ActivitiEventListener {

    @Override
    public void onEvent(ActivitiEvent event) {
        switch (event.getType()) {

        case PROCESS_STARTED:
            // ...
            break;

        case PROCESS_COMPLETED:
            // ...
            break;

        // other EVENT_TYPE...

        default:
            break;
        }
    }

    @Override
    public boolean isFailOnException() {
        
        return false;
    }
}

isFailOnException() method will be called when onEvent() method throws an exception. Returning false means the exception is ignored.

All events dispatched are a subtype of org.activiti.engine.delegate.event.ActivitiEvent.
From the event, we can get (if available) type, executionId, processInstanceId and processDefinitionId.

2. Registering

The second thing we do is to register the ActivitiEventListener implementation above.

https://grokonez.com/java-integration/activiti-event-listener-spring-boot-example

How to create Activiti Event Listener with Spring Boot Example

Bình luận


White
{{ comment.user.name }}
Bỏ hay Hay
{{comment.like_count}}
Male avatar
{{ comment_error }}
Hủy
   

Hiển thị thử

Chỉnh sửa

Male avatar

loveprogramming

545 bài viết.
97 người follow
Kipalog
{{userFollowed ? 'Following' : 'Follow'}}
Cùng một tác giả
Male avatar
1 0
Tutorial Link: (Link) (Ảnh) Django is a Pythonbased free and opensource web framework that follows the modeltemplateview architectural pattern. A...
loveprogramming viết 11 tháng trước
1 0
Male avatar
1 0
https://loizenai.com/angular11nodejspostgresqlcrudexample/ Angular 11 Node.js PostgreSQL Crud Example (Ảnh) Tutorial: “Angular 11 Node.js Postg...
loveprogramming viết 9 tháng trước
1 0
Male avatar
1 0
Angular Spring Boot jwt Authentication Example Github https://loizenai.com/angularspringbootjwt/ (Ảnh) Tutorial: ” Angular Spring Boot jwt Authe...
loveprogramming viết 9 tháng trước
1 0
{{like_count}}

kipalog

{{ comment_count }}

bình luận

{{liked ? "Đã kipalog" : "Kipalog"}}


Male avatar
{{userFollowed ? 'Following' : 'Follow'}}
545 bài viết.
97 người follow

 Đầu mục bài viết

Vẫn còn nữa! x

Kipalog vẫn còn rất nhiều bài viết hay và chủ đề thú vị chờ bạn khám phá!