How to set a Job Due Date in Activiti 5.22.0?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

How to set a Job Due Date in Activiti 5.22.0?

 

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
Highlighted
Member II

Re: How to set a Job Due Date in Activiti 5.22.0?

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).

Screen Shot 2020-02-04 at 11.44.20.png

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