cancel
Showing results for 
Search instead for 
Did you mean: 

How to set a Job Due Date in Activiti 5.22.0?

barquero
Champ in-the-making
Champ in-the-making

I got a reference to a Job object like this:

Job timer = managementService.createJobQuery().processInstanceId(execution.getParentId()).singleResult();
 

Could anyone please tell me how can I set the timer due date to an arbitrary date or time period in Activiti 5.22.0?

I could not find a suitable method in ManagementService or Job class.

Best regards.

1 REPLY 1

lasha
Champ in-the-making
Champ in-the-making

Hello

You can set timer configuration to use variable instead of static value (like : "PT20S"), and then start process with this variable(so you can set custom value before start).

image

Pass with variable when starting process :

processVariables.put("timerValue", "PT20S");

RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("processDefinitionKey",processVariables);

For more details look at https://access.redhat.com/solutions/1275113