AnsweredAssumed Answered

Create or modify Job / Timer by program

Question asked by aeross on Aug 22, 2013
Latest reply on Sep 4, 2013 by frederikheremans1

I want to create or modify a Job / Timer by program. a possible use case is a priority changement that leads dueDate change and necessarily associated Job . I tested like this :

1. I'm looking for a job  that i want to modify and modify it

// get actual Job and modifying it
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
final Date d = sdf.parse((String) processEngine .getRuntimeService().getVariable(processInstanceId, "dueDate"));
final Long expirationTime = d.getTime() - 2700000;
final Date expirationDate = new Date(expirationTime);
final StringBuilder sb = new StringBuilder("R3/");

final JobEntity j = (JobEntity) processEngine.getManagementService()
final TimerEntity timer = (TimerEntity) j;

2. I test to record theses changes


[indent]In this case CommandContext is  null and I don't know why. Can you light me?[/indent]

3. After looking to code "" at line 53 and "" at line 83 it test that

final Command<String> c = new Command<String>() {
                public String execute(CommandContext cc) {
                    MessageEntity message = new MessageEntity();
                    return message.getId();
final CommandContext cc = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration()


[indent]No errors but Job is not updated, I test with flushing and commit DbSqlSession with no more results.[/indent]

What i'm doing wrong? Or what is necessary that i not doing?