It's all about the answers!

Ask a question

dynamic required attribute does not work - RTC

Martina Riedel (20323341) | asked Mar 13 '13, 1:59 p.m.
edited Apr 02 '13, 4:39 a.m. by Ralph Schoon (62.7k33643)
I am following - Dynamic Required Attribute about half way down.
Whatever I do, I get errors in the ccm log (see below) and the work item just saves.
This is RTC, no patches on win 2003 server, my "play" vm.
I found several posts where users posted working dojo scripts and I also tried to just stick in the sample in the Attribute Customization - Condition. It shows the Class Name, so I am thinking that it reads the dojo just fine.
I tried it in JKE banking and a pretty vanilla scrum project.
Any ideas what I need to tweak to make it work?

2013-03-13 11:48:31,283 [        http-9443-Processor345] ERROR                        - Error invoking work item filter ''
org.mozilla.javascript.JavaScriptException: [object Error] ({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"}#414)
    at org.mozilla.javascript.gen.c2._c18({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"}:413)
    at{"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"})
    at org.mozilla.javascript.ContextFactory.doTopCall(
    at org.mozilla.javascript.ScriptRuntime.doTopCall(
    at{"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"})
    at org.mozilla.javascript.ScriptableObject.callMethod(
...... (lots more, I can post if needed)

Accepted answer

permanent link
Ralph Schoon (62.7k33643) | answered Mar 14 '13, 7:21 a.m.
Hi, this error points to some syntax error in your JavaScript condition that is so severe that it prevents the script engine from even loading the script.

I had something similar a few days ago and thought the server was wrong. Nope, I just had messed up the syntax in a way that the loader failed.

Brackets? Statements outside of the scope they are supposed to be? Semicolon missing? Hard to tell. We tried to provide some guidance in this workshop Lab 5.

I would suggest to check the script syntax. In my case I lazy bone did copy paste and missed that it had put an odd string outside of my inner brackets.
Martina Riedel selected this answer as the correct answer

Martina Riedel commented Mar 14 '13, 10:08 p.m.

Hmm. There is a "download sample" URL right there and I gave it the exact file that it saved. I can do it again. The sample file that gets downloaded should work as is, right? 

Ralph Schoon commented Mar 15 '13, 4:36 a.m. | edited Mar 15 '13, 4:45 a.m.


provided the Script Attachments are enabled, the sample scripts should at least load an be processed. You should also be able to debug them as described in the process enactment workshop.

Martina Riedel commented Mar 18 '13, 10:19 a.m.

I still get the same error. I deleted everything and did it again with new filenames, I didn't edit the content. I saved the sample-condition.js and gave that to it unedited. I originally saved it in My Documents, but I also saved it in C:\rtc_js and in both Unix and win line endings.
Same error all the time.

You say "provided Script Attachments are enabled". How do I check that? (and how do I enable it if it isn't obvious from the check location)

Martina Riedel commented Mar 18 '13, 10:28 a.m.

Ralph Schoon commented Mar 18 '13, 10:48 a.m. | edited Mar 18 '13, 10:48 a.m.

I don't know when that feature came in.

Go to your CCM application https://<host>[:<Port>]/ccm/admin
Go to the Advanced Properties section
Use your browser search to search for "Enable Process Attachment Scripts"
The default is false, you have to change it to true and save, to enable them.

See the workshop I mentioned above.

Martina Riedel commented Mar 18 '13, 12:26 p.m.

it came in in 3.0.1 according to the Library article I started out from.

SUCCESS. The Enable Process Attachment Scripts was the piece I was missing. I needed to make sure to look in ccm/admin

Thanks for all your help

Ralph Schoon commented Mar 18 '13, 12:40 p.m.

That was long Martina.We could have saved a lot of time if you had looked into the workshop 8-p. Glad you have it working now. PS, I tend to forget it is switched off in my test repositories too....

showing 5 of 7 show 2 more comments

Your answer

Register or to post your answer.