Problems vs REST POST call

Problems vs REST POST call

  

Hi!

I need to integrate Outsystem vs Drools. I have created Consume Rest Api method in Outsystems and I have got correct response in test with static parametrs. Here is screenshot below:

Then I have included this method in my process and assign parameters. But unfortunately Outsystem sends empty request:

I change request body from this:

to this:

 Outsystems send data in body request, but Drools expecting commands:



Can you help me to solve this problem?

Hi,

Did you set "Send default value" to Yes

Do you actually fill the list with some data?


What we see is the test, but not the actual calling the webservice via a screenaction for example

It would help a lot if you can share the oml (without the secret information of course :) )


J. wrote:

Hi,

Did you set "Send default value" to Yes

Do you actually fill the list with some data?


What we see is the test, but not the actual calling the webservice via a screenaction for example

It would help a lot if you can share the oml (without the secret information of course :) )


Hi!

Thank`s for feedback!

I have created a simple app, to give you oml. In this app I have deleted real url to Drools login and password in REST. Also I have changed REST start. It will start after pressed button "SendDataToDrools" on screen "Feed Back From Drools".


1. you do not send default values.

2. you need to listappend the record to the command instead of assigning to the current.

(because there is nothing, there is actually no current)


  1. I have changed option "send default value" in Rest request.
  2. I did not understand about "current". Can you please explain what did you mean? Anyway when I only declare in request body parameters (without commands and array in "[ ]" ) sended request body is not empty. 

declare only parameters (without commands and array in "[ ]" ): 


Here is data from "Some Data To Send In Drools" entity and it  sends in request body. But I need also to send command and array, not only data.

P.S.

I need some kind of hierarchical structure in request, like it was in example (but seems Outsystem doesn`t like it):

Hello Ivan,

Have you tried to set structures (so 'Object' and 'Com_myteam_outsystemnominationvalidate_Nominations') mandatory to 'True'? When the values are empty it does send the parameters in the request with empty values, else the empty part isn't added in the request.

Hope it helps.

Kind regards,
Evert

Evert van der Zalm wrote:

Hello Ivan,

Have you tried to set structures (so 'Object' and 'Com_myteam_outsystemnominationvalidate_Nominations') mandatory to 'True'? When the values are empty it does send the parameters in the request with empty values, else the empty part isn't added in the request.

Hope it helps.

Kind regards,
Evert


Hello Evert,

Yep, I have changed all options in request structure "send default value" to "true" and "Is mandatory" to "Yes".

After that, request body have changed, but not enough:

Solution

No, you are assigning it directly to the current in you code.

you need to have a CommandItem-variable which you fill in the values.

then you do a listappend to the List.

see the comments in your oml attached

Solution

J. wrote:

No, you are assigning it directly to the current in you code.

you need to have a CmmandItem-variable which you fill in the values.

then you do a listappend to the List.

see the comments in your oml attached

Thank`s a lot!

You are right, it`s currently working. I have some mistakes with parsing response, but I think i will handle with it.


Good to hear :)

Good luck on getting the job done

(the names of that json-structure is somewhat interesting to say the least ;) )