Download Blaze Trial
Follow FICO
LinkedIn   Twitter   Youtube
Close To access this section, please choose the Community Neighborhood in which you have the most interest.

» Business Rules Management
» Collections & Recovery
» Fraud Management
» Risk Management
» Scoring
Close To access this section, please choose the Community Neighborhood in which you have the most interest.

» Business Rules Management
» Collections & Recovery
» Fraud Management
» Risk Management
» Scoring
Reply
Visitor
ssah
Posts: 1
Registered: ‎03-13-2012
0
Accepted Solution

Error: An external class following 'a/an' must have an accessible default constructor.

I am using Blaze Advisor 7.0. I am trying to create an object and declare values in it so that I can test my rules. This is the code that I have:

 


recAccountData = a RecAccountData initially { accountData = a AccountData initially {
  creditScore = 100.
  originalTransactionAmount =100 as a BigDecimal.
  }}

 

 

The AccountData class above is declared as an abstract class in the Object model. I am getting the following error when I compile.

 

Error: An external class following 'a/an' must have an accessible default constructor.

 

 

 

 

 

 

Kindly advise.

 

Thanks,

Shubham 

DM-Forums Moderator
Posts: 472
Registered: ‎10-02-2008
0

Re: Error: An external class following 'a/an' must have an accessible default constructor.

The error message tells you what the problem is; The class you try to instantiate must have an accessible constructor. If you are unable to instantiate the class in Java, say in a unit test, you will not be able to instantiate it in SRL either.

 

Make sure you have a public no-argument constructor if you want to use the "initially a ClassName" syntax. If you have constructors that take arguments, they are exposed as static methods on the form ClassName.newClassName(args...) in SRL.

 

Also, if your class is abstract, you can not instantiate it. Not in Java, and not in SRL. Rules are great, but there really is no magic :-)

 

Regards,

Jostein