jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
696 stars 125 forks source link

NPE when adding task listener to a UserTask #716

Closed gorbunkov closed 2 years ago

gorbunkov commented 2 years ago

Jmix Version: 1.2.2

Create any TaskListener in the project, e.g.:

import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;

public class SomeTaskListener implements TaskListener {

    @Override
    public void notify(DelegateTask delegateTask) {
        //..
    }

Open the modeler Add a UserTask Add a task listener to the UserTask

After the task listener editor is closed, an NPE occurs:

java.lang.NullPointerException
    at io.jmix.bpmui.screen.modeler.properties.usertask.UserTaskPropertiesFragment.updateTaskListenersInModeler(UserTaskPropertiesFragment.java:225)
    at io.jmix.bpmui.screen.modeler.properties.usertask.UserTaskPropertiesFragment.onTaskListenersDcCollectionChange(UserTaskPropertiesFragment.java:259)
    at io.jmix.core.common.event.EventHub.publish(EventHub.java:170)
    at io.jmix.ui.model.impl.CollectionContainerImpl.fireCollectionChanged(CollectionContainerImpl.java:241)
    at io.jmix.ui.model.impl.CollectionPropertyContainerImpl.lambda$getMutableItems$0(CollectionPropertyContainerImpl.java:67)
    at io.jmix.ui.model.impl.ObservableList.fireCollectionChanged(ObservableList.java:69)
    at io.jmix.ui.model.impl.ObservableList.add(ObservableList.java:105)
    at io.jmix.ui.builder.EditorBuilderProcessor.lambda$buildEditor$0(EditorBuilderProcessor.java:119)
    at io.jmix.core.common.event.EventHub.publish(EventHub.java:170)
    at io.jmix.ui.screen.Screen.fireEvent(Screen.java:124)
    at io.jmix.ui.screen.Screen.close(Screen.java:330)
    at io.jmix.ui.screen.StandardEditor.lambda$closeWithCommit$11(StandardEditor.java:617)
    at io.jmix.ui.util.SuccessOperationResult.compose(SuccessOperationResult.java:35)
    at io.jmix.ui.screen.StandardEditor.closeWithCommit(StandardEditor.java:617)
    at io.jmix.ui.screen.StandardEditor.commitAndClose(StandardEditor.java:570)
artemy63 commented 2 years ago

QA notes: Prerequisites:

Next cases should be checked:

  1. User Notification add-on is not included in the project

    • open the BPM modeler, add simple process definition, startEvent -> userTask -> serviceTask -> endEvent
    • for userTask add some taskListener ER: taskListener successfully added
    • for serviceTask add some executionListener ER: executionListener susseccfully added
    • process definition successfully deployed
  2. User Notification add-on included in the project and property jmix.bpm.notification-sending-enabled=true set in application.properties file

    • open the BPM modeler, add simple process definition, startEvent -> userTask -> serviceTask -> endEvent
    • configure for userTask send notification element ER: successfully configured
    • for userTask add some taskListener ER: taskListener successfully added, nothing changed in send notification element definition
    • configure for serviceTask send notification element ER: successfully configured
    • for serviceTask add some executionListener ER: executionListener susseccfully added, nothing changed in send notification element definition
    • process definition successfully deployed
konyashkina commented 2 years ago

Tested on Jmix version: 1.2.999-SNAPSHOT Jmix Studio plugin version: 1.2.2-213 IntelliJ version: IntelliJ IDEA 2021.3 (Community Edition)