It's all about the answers!

Ask a question

dynamic required attribute does not work RTC 4.0.1


marina delunas (711216) | asked Jun 28 '13, 5:09 p.m.
Hi,
I'm new on writing javascript...  I write a script for attribute customization, I define a condition to use on dynamic required attribute. I have this errore on .log

Someone can help me?
many thanks!!!!!!!!!!!!!!!!!!!!!!

marina

The script is :

/*******************************************************************************
 * 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.providers.script.ReportCondition");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
    var doDebug = true;
    var scriptname = "ReportCondition";
    var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
  
   dojo.declare("com.ibm.providers.script.ReportCondition", null, {

        matches: function(workItem, configuration) {
            debug("- Start");
           
           
            var repmod = workItem.getLabel("com.ibm.team.custom.acg.reportmodified);
            debug("repmod : " + repmod );
            if(state!="Yes"){
                return false; // Nothing to do
            }
           
           
            debug("Report Modified");
            return true;
           
            function debug(display){               
                if(doDebug){
                    console.log(scriptname + " " + display);
                }
            }           
        }
    });
})();



The log is

!ENTRY com.ibm.team.rtc.common.scriptengine 4 0 2013-06-28 22:59:57.101
!MESSAGE Failed to execute script
!STACK 0
org.mozilla.javascript.JavaScriptException: Error: Could not load 'com.ibm.providers.script.ReportCondition'; last tried '../com/ibm/providers/script/ReportCondition.js' ({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"}#428)
    at org.mozilla.javascript.gen.c2._c18({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"}:427)
    at org.mozilla.javascript.gen.c2.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"})
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003)
    at org.mozilla.javascript.gen.c2.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"})
    at com.ibm.team.rtc.common.scriptengine.environment.dojo.DojoFeature$3.call(DojoFeature.java:188)
    at org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:1862)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation$4.run(ScriptingHelperImplementation.java:141)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation$4.run(ScriptingHelperImplementation.java:1)
    at com.ibm.team.rtc.common.scriptengine.environment.AbstractScriptEnvironment.execute(AbstractScriptEnvironment.java:74)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation.dojoRequire(ScriptingHelperImplementation.java:138)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation.getConstructor(ScriptingHelperImplementation.java:151)
    at com.ibm.team.rtc.common.scriptengine.ScriptUtilities$1.run(ScriptUtilities.java:30)
    at com.ibm.team.rtc.common.scriptengine.environment.AbstractScriptEnvironment.execute(AbstractScriptEnvironment.java:74)
    at com.ibm.team.rtc.common.scriptengine.ScriptUtilities.newInstance(ScriptUtilities.java:27)
    at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider$ProviderCall.getProvider(ScriptAttributeValueProvider.java:198)
    at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider$ProviderCall.<init>(ScriptAttributeValueProvider.java:183)
    at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider.matches(ScriptAttributeValueProvider.java:151)
    at com.ibm.team.workitem.common.internal.attributeValueProviders.AttributeValueProviderRegistry$SafeWorkItemFilter.matches(AttributeValueProviderRegistry.java:133)
    at com.ibm.team.workitem.common.internal.RequiredAttributesByConditionAdvisor.getRequiredAttributes(RequiredAttributesByConditionAdvisor.java:96)
    at com.ibm.team.workitem.common.internal.PropertiesManager.findRequiredAttributes(PropertiesManager.java:101)
    at com.ibm.team.workitem.common.internal.WorkItemCommon.findRequiredAttributes(WorkItemCommon.java:554)
    at com.ibm.team.workitem.ide.ui.internal.editor.presentations.presentationhandler.RequiredPropertiesHandler$RequiredUpdaterJob.runInBackground(RequiredPropertiesHandler.java:74)
    at com.ibm.team.jface.internal.util.UIUpdateManager$BackgroundJob.runProtected(UIUpdateManager.java:58)
    at com.ibm.team.foundation.client.util.FoundationJob.run(FoundationJob.java:68)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

!ENTRY com.ibm.team.rtc.common.scriptengine 4 0 2013-06-28 22:59:57.105
!MESSAGE Failed to execute script
!STACK 0
org.mozilla.javascript.JavaScriptException: Error: Could not load 'com.ibm.providers.script.ReportCondition'; last tried '../com/ibm/providers/script/ReportCondition.js' ({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"}#428)
    at org.mozilla.javascript.gen.c2._c18({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"}:427)
    at org.mozilla.javascript.gen.c2.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"})
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003)
    at org.mozilla.javascript.gen.c2.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"})
    at com.ibm.team.rtc.common.scriptengine.environment.dojo.DojoFeature$3.call(DojoFeature.java:188)
    at org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:1862)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation$4.run(ScriptingHelperImplementation.java:141)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation$4.run(ScriptingHelperImplementation.java:1)
    at com.ibm.team.rtc.common.scriptengine.environment.AbstractScriptEnvironment.execute(AbstractScriptEnvironment.java:74)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation.dojoRequire(ScriptingHelperImplementation.java:138)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation.getConstructor(ScriptingHelperImplementation.java:151)
    at com.ibm.team.rtc.common.scriptengine.ScriptUtilities$1.run(ScriptUtilities.java:30)
    at com.ibm.team.rtc.common.scriptengine.environment.AbstractScriptEnvironment.execute(AbstractScriptEnvironment.java:74)
    at com.ibm.team.rtc.common.scriptengine.ScriptUtilities.newInstance(ScriptUtilities.java:27)
    at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider$ProviderCall.getProvider(ScriptAttributeValueProvider.java:198)
    at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider$ProviderCall.<init>(ScriptAttributeValueProvider.java:183)
    at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider.matches(ScriptAttributeValueProvider.java:151)
    at com.ibm.team.workitem.common.internal.attributeValueProviders.AttributeValueProviderRegistry$SafeWorkItemFilter.matches(AttributeValueProviderRegistry.java:133)
    at com.ibm.team.workitem.common.internal.RequiredAttributesByConditionAdvisor.getRequiredAttributes(RequiredAttributesByConditionAdvisor.java:96)
    at com.ibm.team.workitem.common.internal.PropertiesManager.findRequiredAttributes(PropertiesManager.java:101)
    at com.ibm.team.workitem.common.internal.WorkItemCommon.findRequiredAttributes(WorkItemCommon.java:554)
    at com.ibm.team.workitem.ide.ui.internal.editor.presentations.presentationhandler.RequiredPropertiesHandler$RequiredUpdaterJob.runInBackground(RequiredPropertiesHandler.java:74)
    at com.ibm.team.jface.internal.util.UIUpdateManager$BackgroundJob.runProtected(UIUpdateManager.java:58)
    at com.ibm.team.foundation.client.util.FoundationJob.run(FoundationJob.java:68)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

!ENTRY com.ibm.team.workitem.common 4 0 2013-06-28 22:59:57.109
!MESSAGE Error invoking work item filter 'com.ibm.team.workitem.valueproviders.CONDITION._5GWx0N9vEeKqtNcCx1HsXA'
!STACK 0
org.mozilla.javascript.JavaScriptException: [object Error] ({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"}#428)
    at org.mozilla.javascript.gen.c2._c18({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"}:427)
    at org.mozilla.javascript.gen.c2.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"})
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003)
    at org.mozilla.javascript.gen.c2.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"})
    at com.ibm.team.rtc.common.scriptengine.environment.dojo.DojoFeature$3.call(DojoFeature.java:188)
    at org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:1862)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation$4.run(ScriptingHelperImplementation.java:141)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation$4.run(ScriptingHelperImplementation.java:1)
    at com.ibm.team.rtc.common.scriptengine.environment.AbstractScriptEnvironment.execute(AbstractScriptEnvironment.java:74)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation.dojoRequire(ScriptingHelperImplementation.java:138)
    at com.ibm.team.rtc.common.scriptengine.environment.ScriptingHelperImplementation.getConstructor(ScriptingHelperImplementation.java:151)
    at com.ibm.team.rtc.common.scriptengine.ScriptUtilities$1.run(ScriptUtilities.java:30)
    at com.ibm.team.rtc.common.scriptengine.environment.AbstractScriptEnvironment.execute(AbstractScriptEnvironment.java:74)
    at com.ibm.team.rtc.common.scriptengine.ScriptUtilities.newInstance(ScriptUtilities.java:27)
    at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider$ProviderCall.getProvider(ScriptAttributeValueProvider.java:198)
    at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider$ProviderCall.<init>(ScriptAttributeValueProvider.java:183)
    at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider.matches(ScriptAttributeValueProvider.java:151)
    at com.ibm.team.workitem.common.internal.attributeValueProviders.AttributeValueProviderRegistry$SafeWorkItemFilter.matches(AttributeValueProviderRegistry.java:133)
    at com.ibm.team.workitem.common.internal.RequiredAttributesByConditionAdvisor.getRequiredAttributes(RequiredAttributesByConditionAdvisor.java:96)
    at com.ibm.team.workitem.common.internal.PropertiesManager.findRequiredAttributes(PropertiesManager.java:101)
    at com.ibm.team.workitem.common.internal.WorkItemCommon.findRequiredAttributes(WorkItemCommon.java:554)
    at com.ibm.team.workitem.ide.ui.internal.editor.presentations.presentationhandler.RequiredPropertiesHandler$RequiredUpdaterJob.runInBackground(RequiredPropertiesHandler.java:74)
    at com.ibm.team.jface.internal.util.UIUpdateManager$BackgroundJob.runProtected(UIUpdateManager.java:58)
    at com.ibm.team.foundation.client.util.FoundationJob.run(FoundationJob.java:68)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)






One answer



permanent link
Ralph Schoon (57.7k23642) | answered Jun 29 '13, 1:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 Did you enable attachment scripts in the advanced attributes section of the CCM server as described in the Process Enactment Workshop?

Comments
Daniel Schleider commented Oct 14 '13, 5:23 a.m. | edited Oct 14 '13, 8:37 a.m.

 Hi,

at our site, we have this option enabled but the error still occurs and logs at a very high rate. 
Means we create 11MB of log files in 2-4hours.

Any other advise or idea or is this simply broken in 4.0.3?


Ralph Schoon commented Oct 14 '13, 5:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Is there customization that someone did and that is not working, because of syntax errors or something else? You should not get that many errors if there weren't customizations running that fail.


Daniel Schleider commented Oct 14 '13, 6:53 a.m. | edited Oct 14 '13, 8:37 a.m.

 Hi, 


with 400+ project areas and a fully open system, I have no way to find custom java script that is failing.
We have two VALUE_PROVIDER_<uuid> that cause flooding of our logs. I need to map that ID to a meanigful object somehow.

Was the Java script engine changed from 4.0.2 to 4.0.3? We did not encounter these issues with 4.0.2!


Ralph Schoon commented Oct 14 '13, 10:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Daniel, you have definitely a point here. It should be easier to locate in which project area the script runs and fails. I don't know if there is an easy way to find it in your configuration. I suppose you could write a tool to search all project areas for the script path, but I think that it should be easier for you to narrow down that problem. I would suggest to open an enhancement request with support or here.

Your answer


Register or to post your answer.