Java Code Data Policy Examples/Send an Email Notification on an Ownership Change for a Project Code Sample

Java Code Data Policy Examples/Send an Email Notification on an Ownership Change for a Project Code Sample

From LongJump Support Wiki

Java Code Data Policy Examples/Send an Email Notification on an Ownership Change for a Project Code Sample
Jump to: navigation, search

This code is intended for use as part of a Data Policy. It is a complex example of the use of Java code to take a series of actions, each based on the previous code section. For information on the use of this code sample, see: Send an Email Notification on an Ownership Change for a Project.

import com.platform.api.*;

public class DataPolicyExamples {

  public void sendEmailOnOwnershipChange(Parameters requestParams) {
    String attachmentIdList = "";
    String attachmentTemplateIdList = "";
    // Copy template ID from Template object's UI to populate
    // both variables above

    Result result = Functions.sendEmail(
      "PROJECT", requestParams.get("name"), "support@mycompany.com",
      "support@yourcompany.com", "Project has been assigned",
      "Hello" + Functions.getEnv(ENV.USER.ID) + ", Project "
         + requestParams.get("name") + "has been assigned to you",
      attachmentTemplateIdList, attachmentIdList);

    Functions.debug("Project Status and ownership changed! Result of sendEmail : "
                   + result.getMessage());
  } // end method
}// end class
Personal tools