if (nodeInstance instanceof TimerNodeInstance) { TimerNodeInstance tni = (TimerNodeInstance) nodeInstance; if (tni.getTimerId() == timerId || (tni.getNodeName() != null && tni.getNodeName().equals(timerName))) { TimerInstance timer = tm.getTimerMap().get(tni.getTimerId());
@Override public Map<Long, List<TimerInstance>> execute(Context context) { Map<Long, List<TimerInstance>> result = new LinkedHashMap<>(); KieSession kieSession = ((RegistryContext) context).lookup(KieSession.class); TimerManager timerManager = getTimerManager(kieSession); WorkflowProcessInstanceImpl processInstance = (WorkflowProcessInstanceImpl) kieSession.getProcessInstance(migrationSpec.getProcessInstanceId()); Collection<org.jbpm.workflow.instance.NodeInstance> activeInstances = processInstance.getNodeInstances(true); for (org.jbpm.workflow.instance.NodeInstance active : activeInstances) { if (active instanceof TimerNodeInstance) { TimerInstance timerInstance = timerManager.getTimerMap().get(((TimerNodeInstance) active).getTimerId()); timerManager.cancelTimer(timerInstance.getId()); result.put(active.getId(), Arrays.asList(timerInstance)); } else if (active instanceof StateBasedNodeInstance) { List<Long> timers = ((StateBasedNodeInstance) active).getTimerInstances(); if (timers != null && !timers.isEmpty()) { List<TimerInstance> collected = new ArrayList<>(); for (Long timerId : timers) { TimerInstance timerInstance = timerManager.getTimerMap().get(timerId); timerManager.cancelTimer(timerInstance.getId()); collected.add(timerInstance); } result.put(active.getId(), collected); } } } return result; } });
} else if (nodeInstance instanceof TimerNodeInstance) { stream.writeShort(PersisterEnums.TIMER_NODE_INSTANCE); stream.writeLong(((TimerNodeInstance) nodeInstance).getTimerId()); } else if (nodeInstance instanceof JoinInstance) { stream.writeShort(PersisterEnums.JOIN_NODE_INSTANCE);
.setType( NodeInstanceType.TIMER_NODE ) .setTimer( JBPMMessages.ProcessInstance.NodeInstanceContent.TimerNode.newBuilder() .setTimerId( ((TimerNodeInstance) nodeInstance).getTimerId() ) .build() ); } else if ( nodeInstance instanceof JoinInstance ) {
@Override public Map<Long, List<TimerInstance>> execute(Context context) { Map<Long, List<TimerInstance>> result = new LinkedHashMap<>(); KieSession kieSession = ((RegistryContext) context).lookup(KieSession.class); TimerManager timerManager = getTimerManager(kieSession); WorkflowProcessInstanceImpl processInstance = (WorkflowProcessInstanceImpl) kieSession.getProcessInstance(migrationSpec.getProcessInstanceId()); Collection<org.jbpm.workflow.instance.NodeInstance> activeInstances = processInstance.getNodeInstances(true); for (org.jbpm.workflow.instance.NodeInstance active : activeInstances) { if (active instanceof TimerNodeInstance) { TimerInstance timerInstance = timerManager.getTimerMap().get(((TimerNodeInstance) active).getTimerId()); timerManager.cancelTimer(timerInstance.getId()); result.put(active.getId(), Arrays.asList(timerInstance)); } else if (active instanceof StateBasedNodeInstance) { List<Long> timers = ((StateBasedNodeInstance) active).getTimerInstances(); if (timers != null && !timers.isEmpty()) { List<TimerInstance> collected = new ArrayList<>(); for (Long timerId : timers) { TimerInstance timerInstance = timerManager.getTimerMap().get(timerId); timerManager.cancelTimer(timerInstance.getId()); collected.add(timerInstance); } result.put(active.getId(), collected); } } } return result; } });
if (nodeInstance instanceof TimerNodeInstance) { TimerNodeInstance tni = (TimerNodeInstance) nodeInstance; if (tni.getTimerId() == timerId || (tni.getNodeName() != null && tni.getNodeName().equals(timerName))) { TimerInstance timer = tm.getTimerMap().get(tni.getTimerId());
} else if (nodeInstance instanceof TimerNodeInstance) { stream.writeShort(PersisterEnums.TIMER_NODE_INSTANCE); stream.writeLong(((TimerNodeInstance) nodeInstance).getTimerId()); } else if (nodeInstance instanceof JoinInstance) { stream.writeShort(PersisterEnums.JOIN_NODE_INSTANCE);
.setType( NodeInstanceType.TIMER_NODE ) .setTimer( JBPMMessages.ProcessInstance.NodeInstanceContent.TimerNode.newBuilder() .setTimerId( ((TimerNodeInstance) nodeInstance).getTimerId() ) .build() ); } else if ( nodeInstance instanceof JoinInstance ) {