Hello,
We use flowable for creating some simple workflow within our Spring Boot application. We define few sequential UserTasks with Task Listeners for creating and completing the User Task. The TaskListeners are defined as Spring beans and we inject additional services (beans).
Everything works ok, but there is a Sonar Code Smell reported for the TaskListener classes because the TaskListener interface extends Serializable
Class com.test.CompleteTaskListener defines non-transient non-serializable instance field anotherSpringService
I am wondering if we are using it correctly. I’ll post an example of one of the TaskListeners so that you check if this is the correct usage.
<userTask id="defined-ut" name="someDefinedUT" flowable:formFieldValidation="true">
<extensionElements>
<flowable:taskListener event="complete" delegateExpression="${completeTaskListener}"/>
</extensionElements>
</userTask>
@Slf4j
@Service
@RequiredArgsConstructor
public class CompleteTaskListener implements TaskListener {
private final AnotherSpringService anotherSpringService;
@Override
public void notify(DelegateTask delegateTask) {
// some code logic here...
}
}
Thanks