Franklin Antony [
http://community.jboss.org/people/frankee787] created the discussion
"Notify on completion of Escalation"
To view the discussion, visit:
http://community.jboss.org/message/610119#610119
--------------------------------------------------------------
I have a task which has a deadline defined as follows. The escalation and notification
works fine as expected
log.info("ADDING ESCALTIONS for total of :
"+domainTask.getEscalations().size());
List<Escalation> escalations = new ArrayList<Escalation>();
//Deadline
Deadline endDeadline = new Deadline();
endDeadline.setDate(domainTask.getDueDate());
endDeadline.setEscalated(false);
Escalation escalation = new Escalation();
escalation.setName("escalatedtask");
//Reassignments
List<Reassignment> reassignments = new ArrayList<Reassignment>();
List<OrganizationalEntity> reassignmentPotentialOwners = new
ArrayList<OrganizationalEntity>();
//Notifications
List<Notification> notifications = new ArrayList<Notification>();
List<OrganizationalEntity> recipients = new
ArrayList<OrganizationalEntity>();
com.my.User domainUser = (com.my.User) (taskAssignment.getAssigned());
reassignmentPotentialOwners.add(new
User(Constants.jBPM_USER_ID_PREFIX+domainUser.getId().toString()));
recipients.add(new User(Constants.jBPM_USER_ID_PREFIX+domainUser.getId().toString()));
log.debug("Task is being RE-ASSIGNED to a USER with ID :
"+Constants.jBPM_USER_ID_PREFIX+domainUser.getId().toString() +" and name:
"+domainUser.getNameEn());
Reassignment reassignment = new Reassignment();
reassignment.setPotentialOwners(reassignmentPotentialOwners );
reassignments.add(reassignment);
escalation.setReassignments(reassignments);
EmailNotification emailNotification = new EmailNotification();
emailNotification.setRecipients(recipients);
//Email Header
Map<String,EmailNotificationHeader> emailHeaders = new HashMap<String,
EmailNotificationHeader>();
EmailNotificationHeader emailHeader = new EmailNotificationHeader();
emailHeader.setLanguage("en-UK");
emailHeader.setFrom(" mailto:my@mydomain.com my(a)mydomain.com");
emailHeader.setSubject("TASK ID : "+domainTask.getId()+" :
"+domainTask.getTitle());
emailHeader.setBody(domainTask.getDescription()+" \n reaches its deadline. \n Now it
is your responsability!");
emailHeaders.put("en-UK", emailHeader);
emailNotification.setEmailHeaders(emailHeaders);
notifications.add(emailNotification );
escalation.setNotifications(notifications);
escalations.add(escalation);
endDeadline.setEscalations(escalations );
Deadlines deadlines= new Deadlines();
List<Deadline> endDeadlines = new ArrayList<Deadline>();
endDeadlines.add(endDeadline);
deadlines.setEndDeadlines(endDeadlines);
task.setDeadlines(deadlines);
This works fine as expected and that is good. PHEW!!
Now, I would like to update in my database when this escalation is fired. Rather , I would
like to be notified when such an escalation event is fired.
Is there anyway to achieve this ?
Regards,
Franklin
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/610119#610119]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]