how to control order of calculated value scripts?
![]() Hi, we are using RTC 4.0.6 and we are using calculated value scripts to set a default owned by value per state, and then users can change it. We need the script to run only once in each state. As inside the scripts we can't know if it was fired due to a state change, and we are not able to get previous status then we have created another script that will save the old state and the script that sets the owner previously checks if the status is different to the old status in order to set the owner. It was working fine in the development environment, the script that sets the owner runs first and then the other one that saves the status. But when we copied the process configuration to the Production PA (inside the same server) looks like the order of the scripts is not the same, looks like it is saving the old status first and then when the script that sets the owner runs it detects that the status is the same so it does not set the owner. I'm not able to find the logs in the server to verify the execution order or to see if any other error appears, where can I find the script log in a WAS based installation? I tried on the C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\logs directory, but the scripts are not logged there.
How can I force the order of the scripts? How are the scripts being run? Is there a way I can be sure the script that saves the status runs at the end after the other has ran?
Here are the scripts used:
dojo.provide("com.example.common.GetOldState");
(function() {
dojo.declare("com.example.common.GetOldState", null, { getValue: function(attributeId, workItem, configuration) { console.log("GetOldState Begin " + attributeId);
var oldState = workItem.getValue("oldStatus");
console.log("oldState:" + oldState);
dojo.provide("com.example.common.GetOwnedBy");
(function() {
dojo.declare("com.example.common.GetOwnedBy", null, {
getValue: function(attribute, workItem, configuration) {
}
console.log("GetOwnedBy End - ownedBy:" + ownedBy);
__sentinel: null });
})();
Please Help! Thanks and Regards,
|
4 answers
![]()
Hi Sam,
thanks for answering. In the attachments section they are in alphabetical order. I've even tried renaming the attachment name and the class so that it appears at the end of the list, but it didn't make any difference. Do you know where to find the logs in the server in a WAS installation? Regards, |
![]()
Some updates, i was finally able to find the scripts logs in the server, they are in C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\temp\SRV-RTCFE\RTC\ccm_war\ccm.war\eclipse\workspace\.metadata\ .log
I created a new attribute zoldstate to run the script and looks like now it is running this script after the others, so looks like the order of creation of the attribute affects on the order the calculated value script is executed. |
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.