cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy error for SCP business rule service

sankar_bhatta
Participant
0 Kudos

HI Experts,

I have just built a business rule project in my trail account in SAP cloud platform. Everything went well. When I click on Deploy button from Rule services tab, system asks me to select the system . I select SAP cloud platform and i get a deployment error screen. Screen shot attached. i am not sure where to check the details of the error or what is the error about. before deploying i clicked validate and there are no errors.

View Entire Topic
Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

yes, the rule has executed but it seems your body (request variable) is not set correctly. Please see in the blogs how I have constructed the input payload when it is passed as request variable in service task. You can test rule service from API Business Hub (api.sap.com) or via any rest client. For workflow, you need to use Monitor App (as you have been using) to see any errors. There is no way to debug. You need to use the tools to find the errors. Error messages are self explanatory and the workflow can be corrected. Hope that helps.

sankar_bhatta
Participant
0 Kudos

Hi Archana,

Thanks for the reply. Is there any blog which explaing in details how to test the ruleservice using API at api.sap.com

sankar_bhatta
Participant
0 Kudos

Hi Archana,

I have now made some progress and trying to learn few tricks by reading several blogs. I added postman addon to my chrome and trying to test my ruleservvice from there. First I have used below URL to get the xsrf-token. the call was successful and I got the token guid

https://bpmrulesruntimebpm-p1942918606trial.hanatrial.ondemand.com/rules-service/v1/rules/xsrf-token

then I tried a post request with the below URL by passing xsrf-token from above step and also content-type as application/json. In the body I placed the json as below

[ { "__type__" : "ImportDO", "price" : "7", "product" : "AAA" } ]

https://bpmrulesruntimebpm-p1942918606trial.hanatrial.ondemand.com/rest/v1/rule-services/java/MyAppr...

I get response code as "404 not found". is there something wrong with the URL above?

Archana
Product and Topic Expert
Product and Topic Expert
sankar_bhatta
Participant
0 Kudos

Update:

I have changed the URL to below and now i get status code 500. looks like the call is working now.

https://bpmrulesruntimebpm-p1942918606trial.hanatrial.ondemand.com/rules-service/rest/v1/rule-servic...

the response is

{ "error": "Index: 0, Size: 0" }

I feel there is something wrong in the way I defined the rule

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes you have. As seen from the screenshot you have given the condition value expression in the condition header itself. When you click to open the Table Settings dialog (as seen in your screenshot) you just need to enter product of the ImportDO. Then in the decision table condition value you say is equal to 'AAA'. You can create another condition header with expression price of the ImportDO and then give the value as is equal to 7. Your decision table should look like this:

Please follow these blogs carefully and you would know the answers:
https://blogs.sap.com/2017/05/02/overview-of-business-rules-in-cloud-platform/

https://blogs.sap.com/2018/01/18/use-sap-cloud-platform-business-rules-in-your-custom-applications/

There are sample decision table that you can import and see how the rules are modelled.

Hope that helps.



sankar_bhatta
Participant
0 Kudos

Hurray.

Hurray!!.. Finally after struggling for 2 days I am able to execute my workflow without any error along with business rules. Thank you so much for your patience. I would like to move another step.

I have three steps in my workflow Purcahser, Functional and Manager steps.

In my ruleservice, I have output strucure containing below fields

I would like to skip steps based on the values of individual fields in the above strucuture. I believe exclusive gateways help here to achive that. is it the right way to do it?

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos