In any action heretofore or hereafter brought to obtain a judgment or other consequential relief, whether such judgment or relief is granted or not, the court may make a binding determination as provided in this chapter upon application of any party made in his pleadings.
Mass. Gen. Laws ch. 231A, § 6