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.

Accepted Solutions (1)

Accepted Solutions (1)

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

Answers (7)

Answers (7)

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

There could be many reasons for 500 internal server error. Please raise a ticket in LOB-BPM-RUL component and attach the rules project.

dibyodeo
Explorer
0 Kudos

Can anybody suggest i am getting the

The HTTP request to 'https://bpmruleruntime.cfapps.eu10.hana.ondemand.com/rules-service/rest/v2/workingset-rule-services' failed with status code 500 (Internal Server Error) and response body '{"error":{"code":"bpm.rulesruntime.internalservererror","message":"Error encountered during processing of request","details":[]}}'.

mokgavdilabs
Discoverer
0 Kudos

I am facing so many issues and seeing so many bugs in this product. Is it possible to scedule a call with you archana.shukla?

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Sure Morten, please feel free to setup a call.

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

No there are not. Can you please schedule a call with me and I can help you with that or you can use POSTMAN or any other REST client that you have.

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

The URL is wrong to fetch the XSRF token. Please read the blog carefully and configure your destination and XSRF correctly.

sankar_bhatta
Participant
0 Kudos

HI,

May be i missed something. As I am completely new to this, could you guide me where the mistake is?

thanks in advance

rules-service-destaintion.png

sankar_bhatta
Participant
0 Kudos

Hi,

I have read the comments in your blog and adjusted the URLs and now I am getting below error in workflow log. Does this mean the rule got executed but it encountered an error. How do i actually debug these things. is there any way I can debug?

The HTTP request to 'https://bpmrulesruntimebpm-p1942918606trial.hanatrial.ondemand.com/rules-service/rest/v1/rule-services/java/MyApprovalProject/ApprovalService' failed with status code 500 () and response body '{"error" : "Index: 0, Size: 0"}'.

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Ok I found the issue seeing your rules screenshot. Empty values are not supported.
Fill in the values and then try and deploy

sankar_bhatta
Participant
0 Kudos

Thank you, you saved my day 🙂 I am now able to deploy. Now I have another problem wiht workflow. I have created a service task and used the business rule there by following your blog

https://blogs.sap.com/2018/02/02/using-business-rules-in-sap-cloud-platform-workflow/

I have attached the screen shot of the details section of the service task

When I create a new instance for the workflow in the service task step i see below error

The XSRF token request to URL 'https://bpmrulesruntimebpm-p1942918606trial.hanatrial.ondemand.com/xsrf-token' failed with HTTP status code 404 () and response body

what could be the reason?

sankar_bhatta
Participant
0 Kudos

service screenshot

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Sankara,

This happens when you have missed any Input DO in rule service. Please ensure that you have added all the data objects that you have used in rule modelling added as Input. Additionally, if you have 2-3 DO as Input ensure that there is association between them.

Regards,
Archana

sankar_bhatta
Participant
0 Kudos

Hi,

I do not see any issue with Do usage in Rule service

sankar_bhatta
Participant
0 Kudos

sorry i am not able to attach screen shots

sankar_bhatta
Participant
0 Kudos

DO object screeshot

sankar_bhatta
Participant
0 Kudos

Ruleservice screenshot

sankar_bhatta
Participant
0 Kudos

Rule screeshot

sankar_bhatta
Participant
0 Kudos

Ruleset screenshot