It's all about the answers!

Ask a question

Dynamic required attributes, where are the files


sam detweiler (12.5k6195201) | asked May 03 '12, 9:39 a.m.
so I am creating my first pass at using this function in 3.0.1.1.

I saved the sample, edited it, changed its name..

defined the condition in the process config, there are three fields..

1. the local filesystem for the file.. browse to find
2. the 'attachment path'.. whatever that means
and it defaults to /workitem/scripts/common/js-file-name
3. a Class Name field.. which appears to capture the script
dojo.provide(classname) field..

so.. all looks good.. but when executed, I find an error on the server log
org.mozilla.javascript.JavaScriptException: Error: Could not load 'com.example.Condition'; last tried '../com/example/Condition.js'

the issue is two fold..
1. WHERE is this on the filesystem? /workitem/scripts/common doesn't exist anywhere. am I supposed to make up something? what was this default for?

2. I don't see any doc on the actual filename vs the class specification.. so in this case, under /workitem/scripts/common, do I need to create com /example and the file would have to be named Condition.js?

5 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered May 03 '12, 11:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
In general, any files needed for a process action should be stored as an "attachment" to the project area. Open the project area in the Eclipse editor, and select the "Links" tab. In the bottom right, there is an Attachments section, which has an "Add" button. That is how you can have many clients on many different machines use your process extension, without their having to load special files onto their client machine.

Cheers,
Geoff

so I am creating my first pass at using this function in 3.0.1.1.

I saved the sample, edited it, changed its name..

defined the condition in the process config, there are three fields..

1. the local filesystem for the file.. browse to find
2. the 'attachment path'.. whatever that means
and it defaults to /workitem/scripts/common/js-file-name
3. a Class Name field.. which appears to capture the script
dojo.provide(classname) field..

so.. all looks good.. but when executed, I find an error on the server log
org.mozilla.javascript.JavaScriptException: Error: Could not load 'com.example.Condition'; last tried '../com/example/Condition.js'

the issue is two fold..
1. WHERE is this on the filesystem? /workitem/scripts/common doesn't exist anywhere. am I supposed to make up something? what was this default for?

2. I don't see any doc on the actual filename vs the class specification.. so in this case, under /workitem/scripts/common, do I need to create com /example and the file would have to be named Condition.js?

permanent link
sam detweiler (12.5k6195201) | answered May 03 '12, 2:25 p.m.
thanks.. didn't see that below the fold!!..
I get failed to load however

org.mozilla.javascript.JavaScriptException: Error: Could not load 'Condition'; last tried '../Condition.js' ({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources\\_base\\_loader", "name":"loader.js"}#414)

and the sample script


/*******************************************************************************
* 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("Condition");

(function() {
dojo.declare("Condition", null, {

matches: function(workItem, configuration) {
var featureid= workItem.getValue("com.ca.workitem.type.feature");
console.log(featureid)
return false; // Resolved or Verified state
}
});
})();


in the process attachments is loaded as Condition.js (no path)
(tried all kinds of paths)
the 'condition' definition wants to use path
'/workitem/scripts/common/'
but trying that (in the process attachments) also fails

permanent link
sam detweiler (12.5k6195201) | answered May 04 '12, 11:26 a.m.
net.. don't fiddle with the 'attachments' section of the process config.

just let the condition manager UI do the saving.. it works fine.

thx

permanent link
Geoffrey Clemm (30.1k33035) | answered May 04 '12, 2:28 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Note: I said there was an Add button there, but I didn't suggest you click on it (:-).

Cheers,
Geoff

net.. don't fiddle with the 'attachments' section of the process config.

just let the condition manager UI do the saving.. it works fine.

thx

permanent link
sam detweiler (12.5k6195201) | answered May 05 '12, 8:41 a.m.
Note: I said there was an Add button there, but I didn't suggest you click on it (:-).

Cheers,
Geoff



you point me to a button.. and I cant press it?!.. what kind of fun is that?!.. thanks tho.. never saw that section of the window before..

Sure wish there was more support for Enums and Contributor.

Sam

Your answer


Register or 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.