08-22-2013 05:47 AM
// 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/");
sb.append(sdf.format(expirationDate));
sb.append("/PT15M");
final JobEntity j = (JobEntity) processEngine.getManagementService()
.createJobQuery()
.processInstanceId(processInstanceId)
.singleResult();
final TimerEntity timer = (TimerEntity) j;
timer.setDuedate(d);
timer.setRepeat(sb.toString());
Context.getCommandContext().getJobEntityManager().schedule(timer);
final Command<String> c = new Command<String>() {
@Override
public String execute(CommandContext cc) {
MessageEntity message = new MessageEntity();
cc.getJobEntityManager().send(message);
return message.getId();
}
};
final CommandContext cc = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration()
.getCommandContextFactory()
.createCommandContext©;
cc.getDbSqlSession().update(timer);
08-22-2013 09:36 AM
08-22-2013 10:36 AM
08-23-2013 05:09 AM
08-23-2013 10:05 AM
08-27-2013 05:48 AM
09-04-2013 04:35 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.