Conditional Event not Triggering

Hi Guys,

I need some help in my current process, the current challenge at hand is that my Conditional Non-Interrupting Boundary Event is not being triggered. Here’s my setting:

Though I have my variables set and is != to ’ ’ , my service task after the boundary event is not kicking in.

image

And I think my problem might be in my boundary condition. Hopefully someone with fresh eyes can see what I’ve configured incorrectly.

Thanks!

to add more info, I’m running a java class on my service task…
image

Hey @edcapulong

could you show how you set your variable? Can it be that the java delegate runs so quick that you dont see it in the runtime view?

Greets
Chris

2 Likes

Hi @Zelldon

I’m setting the variable via a Task Listener

image

Here’s my expression: ${task.execution.setVariable(‘l1_assignee’, task.assignee)}

Thanks!

While for the Java Delegate I’m running on the service task, it’s actually a class that sends a notification email to the assignee’s email address.

I first did it by incorporating my class as task listener and it works fine, however I noticed that on the UI when I claim a task, there is a certain amount of lag around 5-7 secs before the task gets assigned since it waits for the email to be sent first. So I was thinking of using a conditional non-interrupting event to remove that “lag” on the UI when claiming.

Let me know if I’m thinking about it correctly.

Thanks

Hi @edcapulong,

The below post might be of help to you

3 Likes

Hi @hassang

Thank you for the link! this made it clear, in conclusion unfortunately for now we are limited to using execution listeners when we want to trigger a conditional event using a variable update.

Now for my use case, since I want to send a notification email each time the assignee is updated for a task, Task Listener on Assignment event might be my best bet for now (w/ a bit of lag). Since if I’m going with the execution listener route I can only send notification email twice, start and end events. Correct?

But I just wanted to check maybe you have any other ideas for my use case? wherein I want to send a notification email each time the assignee is updated for a task.

Thanks!

Hi @edcapulong,

You can start a separate java thread from within your task listener in which you can put your send notification logic.

Hi @hassang

Sorry I’m new to this topic of threading. By any chance, do you have any references or guides on how to do this?

Thank you!

1 Like

Hi @edcapulong,

Below is an example of a runnable implementation class to be used to create a thread from within the task listener implementation.

package org.example.new_thread_process;

public class MailNotificationRunnable implements Runnable {

	private String param;
	
	public MailNotificationRunnable(String param) {
		this.param = param;
	}
	
	@Override
	public void run() {
		
		// You implementation goes here
		// param is a sample parameter
		System.out.println("param: " + param);
	}

}

and below is the task listener implementation

package org.example.new_thread_process;

import org.camunda.bpm.engine.delegate.DelegateTask;
import org.camunda.bpm.engine.delegate.TaskListener;

public class TestTaskListener implements TaskListener {

	@Override
	public void notify(DelegateTask delegateTask) {
	
		MailNotificationRunnable mailNotificationRunnable;
		
		mailNotificationRunnable = new MailNotificationRunnable(delegateTask.getAssignee());
		mailNotificationRunnable.run();
	}

}
1 Like

Thank you @hassang this worked for me!