It's all about the answers!

Ask a question

RTC javascript dojo

marina delunas (711316) | asked May 20 '14, 11:30 a.m.
I have a RTC javascript code that set Timestamp Custome attributes. What is the dojo.require(""); istruction that I have on the script (other people wrote the script and I'm analyzing the script.
thanks in advance for help !

here an extract of the code :

 * Licensed Materials - Property of IBM
 * (c) Copyright IBM Corporation 2011. All Rights Reserved.
 * Note to U.S. Government Users Restricted Rights: 
 * Use, duplication or disclosure restricted by GSA ADP Schedule
 * Contract with IBM Corp.


(function() {
    var doDebug = false;
    var scriptname = "setDate";
    var WorkItemAttributes=;
    dojo.declare("", null, {

        getValue: function(attributeId, workItem, configuration) {
        var wiType = workItem.getValue(WorkItemAttributes.TYPE);
        if ((wiType=="defect")||(wiType=="enhancement"))
            debug("This is a defect...");
            debug("Processing attributes for automatic values changes...");
            var currentState = workItem.getValue(WorkItemAttributes.STATE);
            var currentAttributeValue = workItem.getValue(attributeId);
            var currentDate = new Date();
            if (attributeId == "")
              // Processing L3_ClosingDate
              debug("Processing L3_ClosingDate...");             

              var L3_SpecialistLabel=workItem.getLabel("l3");
              var resolution=workItem.getValue(WorkItemAttributes.RESOLUTION);
              // if ((state= Fixed) && (L3Specialist!=Unassigned) && (L3_Close_date==null)
              // then L3_Close_date=date
              if ((currentState == "acg.ticketWorkflow.state.s10") && ((L3_SpecialistLabel!="") && (L3_SpecialistLabel!="Unassigned")) && (L3_ClosingDate==null))
                debug("State=Fixed, L3Specialist=Assigned, L3_ClosingDate=Unassigned ---> Setting L3_ClosingDate to current date");
                return, {milliseconds:true, zulu:true});

Many thanks!

Accepted answer

permanent link
Donald Nong (14.5k314) | answered May 20 '14, 10:16 p.m.
"dojo.require" means loading modules before using them. It's similar to importing packages in Java.

The line
means the code loads the named module, but I cannot see it being used in the code that you posted.

marina delunas selected this answer as the correct answer

Your answer

Register or to post your answer.