protected static Set<String> createTimerDefinitions(ActivityDefinition activity, NodeImpl node) { if (activity.getDeadlines() != null) { Set<String> deadlineHooks = new HashSet<String>(); for (DeadlineDefinition deadline : activity.getDeadlines()) { deadlineHooks.add(deadline.getExceptionName()); createTimerDefinition(node, deadline); } return deadlineHooks; } return null; }
public DeadlineDefinitionImpl(final DeadlineDefinition src) { Misc.checkArgsNotNull(src); this.deadlineCondition = src.getDeadlineCondition(); this.exceptionName = src.getExceptionName(); this.execution = src.getExecution(); }
public DeadlineDefinitionImpl(final DeadlineDefinition src) { Misc.checkArgsNotNull(src); this.deadlineCondition = src.getDeadlineCondition(); this.exceptionName = src.getExceptionName(); this.execution = src.getExecution(); }
protected Set<String> getActivitiesDependencies(Set<ActivityDefinition> activities) { Set<String> dependencies = new HashSet<String>(); if (activities != null) { for (ActivityDefinition activity : activities) { if (activity.getPerformerAssign() != null) { dependencies.add(activity.getPerformerAssign().getClassName()); } if (activity.getHooks() != null) { for (HookDefinition hook : activity.getHooks()) { dependencies.add(hook.getClassName()); } } if (activity.getDeadlines() != null) { for (DeadlineDefinition deadline : activity.getDeadlines()) { dependencies.add(deadline.getExceptionName()); } } if (activity.getMultiInstantiationDefinition() != null) { dependencies.add(activity.getMultiInstantiationDefinition().getClassName()); } } } return dependencies; } protected Set<String> getParticipantsDependencies(Set<ParticipantDefinition> participants) {
protected static void createTimerDefinition(NodeImpl node, DeadlineDefinition deadline) { TimerDefinitionImpl timerDefinition = node.createTimerDefinition(); timerDefinition.setSignalName(deadline.getExceptionName()); String condition = deadline.getDeadlineCondition(); try { long duration = Long.parseLong(condition); timerDefinition.setDueDateDescription(duration + " millis"); } catch (NumberFormatException e1) { try { timerDefinition.setDueDate(DateUtil.parseDate(condition)); } catch (IllegalArgumentException e2) { throw new XpdlParserException("deadline condition '" + deadline.getDeadlineCondition() + "' is neither a Long nor a formatted date", e2); } } }