Skip to Content
0

isssue using SAP BRM rules edit API

Apr 27 at 11:05 AM

40

avatar image

Hi all,

I am trying to use BRM rules edit API added all the dependencies to DC component .Followed the link

https://help.sap.com/saphelp_nw73ehp1/helpdata/en/e2/3620cef55842cca4632664212f31b1/frameset.htm

but after adding the code in one of the class

package test;
import com.sap.brms.rulesedit.IProject; 
import com.sap.brms.rulesedit.RulesEditAPI;
import com.sap.brms.rulesedit.std.DefaultRulesEditAPIFactory;
public class GetBRMInstance {
DefaultRulesEditAPIFactory apiInstance = DefaultRulesEditAPIFactory.getInstance();
RulesEditAPI  api = apiInstance.getAPI();
}

i get below error

Default constructor cannot handle exception type RulesEditAPIException thrown by implicit super constructor. Must define an explicit constructor

How to handle this exception for RulesEditAPI

Regards

Prasad

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Evgeniy Kolmakov Apr 27 at 01:00 PM
0

Hi Prasad!

I guess it's not the good idea to use Instance Initializer blocks in your class body. Your class definition should look like:

public class GetBRMInstance {
public RulesEditAPI getREAPI() throws RulesEditAPIException {
return DefaultRulesEditAPIFactory.getInstance().getAPI();
}

public static void main(String[] args) {
try {
GetBRMInstance instance = new GetBRMInstance();
RulesEditAPI api = instance.getREAPI();
}
catch (Exception e) {
e.printStackTrace();
}
}
}

Share
10 |10000 characters needed characters left characters exceeded