Script conditions and parameters
I have a work item that has 5 field-groups which consist of a yes/no attribute and a text field. If "yes" is selected, I need to have the text field required.
I can do this via a script-based condition, which i have wrote and tested for one of them. My question is: can I use the same script for all 5 of these? I can define my condition with the script and then in the process configuration source, can update to add a <parameters> tag to indicate which yes/no field to check. However, I basically have to hard-code it for the script in general, instead of being able to specify which yes/no attribute to check when I set the script-based condition in the Operational Behaviors section.
Can this be done (did I explain it okay)?
If not, would the best way to do this be:
1) creating 5 copies of the java-script, hardcoding the attribute IDs to check
2) create 1 copy of the javascript, but 5 different Conditions using the same Local File Path but a different Attachment Path (can I even do this?)
Thanks
Susan
I can do this via a script-based condition, which i have wrote and tested for one of them. My question is: can I use the same script for all 5 of these? I can define my condition with the script and then in the process configuration source, can update to add a <parameters> tag to indicate which yes/no field to check. However, I basically have to hard-code it for the script in general, instead of being able to specify which yes/no attribute to check when I set the script-based condition in the Operational Behaviors section.
Can this be done (did I explain it okay)?
If not, would the best way to do this be:
1) creating 5 copies of the java-script, hardcoding the attribute IDs to check
2) create 1 copy of the javascript, but 5 different Conditions using the same Local File Path but a different Attachment Path (can I even do this?)
Thanks
Susan
One answer
Hi Susan,
I gave it a quick look. The issue is, as far as I can tell, that the condition runs in a precondition and you don't seem to have an indicator which attribute it is running for. Apparently the idea is, the condition checks whatever needs checking and returns yes or no. all attributes that have this condition configured get that value.
Since you, as far as I can see, don't know which work item attribute the condition runs for, I think you would have to create 5 copies. In 4.0.3 and higher, the UI will detect if you try to use the same attachment path, so I think you will have to maintain 5 copies. I am not sure if this would be any easier with a Java extension.
I gave it a quick look. The issue is, as far as I can tell, that the condition runs in a precondition and you don't seem to have an indicator which attribute it is running for. Apparently the idea is, the condition checks whatever needs checking and returns yes or no. all attributes that have this condition configured get that value.
Since you, as far as I can see, don't know which work item attribute the condition runs for, I think you would have to create 5 copies. In 4.0.3 and higher, the UI will detect if you try to use the same attachment path, so I think you will have to maintain 5 copies. I am not sure if this would be any easier with a Java extension.