I've created a webservice that passes the received data from my api to a "Collection of Objects with attributes" parameter inside my business process.

I would like to know how can i convert that business process parameter to a JArray.



JArray jarray = Get("ProcessSchemaCadastros");

This is the line i have in my script task to get my data from business process parameter.

Like 0

Like

2 comments
Best reply

I found a way to pass my problem, instead of trying to convert into a JArray i used:

var entities = Get<ICompositeObjectList<ICompositeObject>>("WebService1.UsrWBCadastros_Out");

then i just worked with the data from 'entities'.

 

It's much easier to transfer a JSON from the web service to a text variable in a business process. Then parse the JSON in the business process.

I found a way to pass my problem, instead of trying to convert into a JArray i used:

var entities = Get<ICompositeObjectList<ICompositeObject>>("WebService1.UsrWBCadastros_Out");

then i just worked with the data from 'entities'.

 

Show all comments

Hi,

 

Do you have any working example how to consume Azure Machine Learning web service on BPMOnline BusinessProcess and Web Service function ?

 

thanks

Antonius 

Like 0

Like

6 comments

Hello,

First, you need to set up an integration with  Azure Machine Learning web service in the bpmonline. Please, see the documentation - https://academy.bpmonline.com/documents/administration/7-12/integration…

Then you can call the web service via [Call Web Service] process element in your business process - https://academy.bpmonline.com/documents/technic-bpms/7-12/call-web-serv…

 

Tetiana Markova,

 

thanks for your reply.

I tried to consume it using as per documentation but have no luck so far.

(1) tried the webservice using Postmand (works)

 

 

 

 

 

 

 

 

(2) try using BMOnline with same parameters

2 headers parameters

Key : Authorization

Authorization : Content-Type

 

1 body parameters

 Json path : $

Data Type : text

is Array : No

Value : <copy from Postman raw body>

 

 

 

but it keep replying response 400

{"error":{"code":"BadArgument","message":"Invalid argument provided.","details":[{"code":"InputMismatchError","target":"input1","message":"Input data does not match input port schema."}]}}

 

how to fixed this ? am I missing something ?

 

thanks

 

 

Dear Antonius,

I don't see where you call the webservice. Perhaps, you didn't set a value to input1 parameter

Peter Vdovukhin,

Hi Peter,

thank you for your comments.

 

I called the web service in Business Process 

I'm not sure whether I set the input parameter correctly. the value and format is exactly same from what I used  Postman.

thanks

 

Hi Antonius,

You should deploy an application on-site, create a web service call and test network via fiddler to see what request is sent to web service. The message you've got means that bpm'online sends a request in a format that differs from that you are expecting. Then you can set up parameters in a such way that will fit to Azure learning standard.

The other option will be creating a script task with calling that webservice from c# code. If you are a developer this is the best way because allows you to do more than built-in web service call.

Peter Vdovukhin,

Hi Peter,

thank you for your comment.

I follow your suggestion by creating a script task.

(1) [in process methods setting menu] add RestSharp name space 

(2) [in script task] construct Json to be put in body parameter:

string json = JsonConvert.SerializeObject(data);

 

(3) [in script task] use RestClient to call web service and adding the necessary parameters    

var client = new RestClient("https://xxxxx.xx.azureml.net/workspaces/xxxx/services/xxx/execute?api-version=2.0&amp;format=swagger");
	var request = new RestRequest(Method.POST);
	request.AddHeader("Cache-Control", "no-cache");
	request.AddHeader("Content-Type", "application/json");
	request.AddHeader("Authorization", "Bearer FpIlxxxxxxxxxxxx");
	request.AddParameter("undefined",  json , ParameterType.RequestBody);
	IRestResponse response = client.Execute(request);

it works for me.

thanks !

 

Show all comments