Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC javascript dojo

Hi,
I have a RTC javascript code that set Timestamp Custome attributes. What is the dojo.require("com.ibm.team.workitem.shared.common.BigDecimal"); 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.
 *******************************************************************************/
dojo.provide("com.ibm.example.workitems.providers.setDate");

dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp");
dojo.require("com.ibm.team.workitem.shared.common.BigDecimal");

(function() {
    var doDebug = false;
    var scriptname = "setDate";
   
    var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
    dojo.declare("com.ibm.example.workitems.providers.setDate", 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 == "com.ibm.team.custom.acg.L3closingdateD")
            {
              // Processing L3_ClosingDate
              debug("Processing L3_ClosingDate...");             

              var L3_ClosingDate=dojo.date.stamp.fromISOString(workItem.getValue('com.ibm.team.custom.acg.L3closingdateD'));
              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 dojo.date.stamp.toISOString(currentDate, {milliseconds:true, zulu:true});
              }
                           
      .............
 .........................................
.....

Many thanks!
             
  
             
             
             
   

0 votes


Accepted answer

Permanent link
"dojo.require" means loading modules before using them. It's similar to importing packages in Java.
http://dojotoolkit.org/reference-guide/1.7/dojo/require.html

The line
dojo.require("com.ibm.team.workitem.shared.common.BigDecimal");
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

1 vote

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: May 20 '14, 11:30 a.m.

Question was seen: 3,994 times

Last updated: May 20 '14, 10:16 p.m.

Confirmation Cancel Confirm