Guest User

Untitled

a guest
Jun 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. if (!unitOfWorkBoundaryReached) {
  2. String flowName = context.flowParameters['_flowName'];
  3. String envr = context.flowParameters['_agentName'];
  4. String host = context.flowParameters['_host'];
  5. subject = host + " - agent: " + envr + " - SymmetricDS Outgoing Batch in Error";
  6. email_to = context.flowParameters['email_to'];
  7. String batchErrorSystem = "";
  8.  
  9. if (!(inputMessage instanceof ControlMessage)) {
  10. ArrayList<EntityData> outputRecs = inputMessage.getPayload();
  11. for (EntityData outputRec : outputRecs) {
  12. Row row = context.getFlowStep().getComponent().toRow(outputRec, false, true);
  13. String system_name = row.getString("system_name");
  14. batchErrorSystem += "Batch in Error on:<t> " + system_name + "<br/>";
  15. }
  16. }
  17.  
  18. body = '''\
  19. <br/>
  20. SymmetricDS currently has an outgoing batch in Error!
  21. <br/>
  22. Identified by Metl Flow: $(_flowName)
  23. <br/>
  24. Host: $(_host)
  25. <br/>
  26. Agent: $(_agentName)
  27. <br/><br/>
  28. <u>System(s) with Error:</u>
  29. <br/> ''' + batchErrorSystem + '''\
  30. <br/>
  31. ''';
  32. body = FormatUtils.replaceTokens(body, context.getFlowParameters(), true);
  33.  
  34. info("Email to: " + email_to);
  35. info("Email subject: " + subject);
  36. info("Email body: " + body);
  37.  
  38. }
  39.  
  40. params = [email_subject:subject, email_body:body, email_to:email_to];
  41. forwardMessageWithParameters(params);
Add Comment
Please, Sign In to add comment