Question

I have been struggling very much with handling collection type response parameters in web services.

When response parameters are or normal type they are very easy to handle in the business processes. Here we are able to handle them as parameters on the Call web service process element. And use these in the process right away.

When there is a Collection which is returned, this is very different. Now the Call web service element parameter is of type Collection of Objects with attributes.

It seems to me that this parameter-type is very difficult to handle in the business process. I can't seem to find documentation in the Academy about how to extract and loop through the contents of the Collection of Objects with attributes.

What I have found in the academy is this article about setting up the Web service.
https://academy.bpmonline.com/documents/administration/7-14/adding-resp…

What I need to learn is how to handle them in bpm'online business processes.
Is there something about this in the Academy?
Is writing source code the only option? It's difficult to debug.

Like

3 comments

Dear Julius,

Unfortunately, it is impossible to handle parameters that have the “collection of object” type without using the source code.

Therefore, in this case we recommend using “ScriptTask” element for both calling the web-service and processing the results of call.

For more detailed assistance, please contact technical support.

Best regards,

Norton

Norton Lingard, Thank you. Is there anything like this in the academy? Because there is a special bpm'online syntax to go by in the source-code.

Dear Julius,

The service call in a "Script task” business process element can be implemented via native C#. Please find a lot of examples on how to do that in Google. For example, several links below:

https://stackoverflow.com/questions/9620278/how-do-i-make-calls-to-a-rest-api-using-c

https://code-maze.com/different-ways-consume-restful-api-csharp/

Please note that it is possible to use the native C# collections instead of working with the the special bpmonline collections.

Best regards,

Norton

Log in or register to comment
Question

Hi

We have a use case whereby the data we need to show in a detail needs to be fetched from a 3rd party API. We intend to do the following steps for this - 

1. Create a virtual object (Transient data. Not to be persisted in the database)
2. Call the the 3rd party API and populate the virtual object with the returned data.
3. Bind the virtual object to the Detail. 

The API is still under construction and we would like to mock / populate / hard code dummy data in the virtual object so that we can proceed with developing the detail. Let me know if there is a way to do this. 

Thanks
Shrikanth

Like

1 comments

Dear Shrikanth,

Please see the following article on how to implement virtual detail on page with calling API to populate data:

https://community.bpmonline.com/articles/add-virtual-detail-page

 

Hope you find it helpful,

Anastasia

Log in or register to comment
Question

Hi,

 

Can someone please direct me to any documentation around how to add data to bpmonline when receiving the data through an API?

 

Does the JSON.NET work for bpmonline or do I have to use JavaScriptSerializer class?

Like

1 comments

Hi aaykay

Please refer to the below link:

https://academy.bpmonline.com/documents/technic-sdk/7-13/integration-bpmonline-and-public-api

The above link will have all information related to API integration and the management of data recieved through them.

In the below link, you will specifically find how to do CRUD operations in BPMOnline objects like Contacts etc.

https://academy.bpmonline.com/documents/technic-sdk/7-13/working-bpmonline-objects-over-odata-protocol-wcf-client

Thanks

Abinaya

 

 

Log in or register to comment
Question

Hi,

If I have to build a web service from bpmonline through an api which requires the method signature to be generated by taking the query string, and creating a HMAC-SHA256 signature using your API key as the secret key.

Is there a way to do that?

There is available a sample c# code, if that helps.

Generating the method signature

    <span>private</span> <span>static</span> <span>string</span> <span>GetSignature</span><span>(</span><span>string</span> <span>args</span><span>,</span> <span>string</span> <span>privatekey</span><span>)</span> 
    <span>{</span> 
        <span>var</span> <span>encoding</span> <span>=</span> <span>new</span> <span>System</span><span>.</span><span>Text</span><span>.</span><span>UTF8Encoding</span><span>();</span> 
        <span>byte</span><span>[]</span> <span>key</span> <span>=</span> <span>encoding</span><span>.</span><span>GetBytes</span><span>(</span><span>privatekey</span><span>);</span> 
        <span>var</span> <span>myhmacsha256</span> <span>=</span> <span>new</span> <span>HMACSHA256</span><span>(</span><span>key</span><span>);</span> 
        <span>byte</span><span>[]</span> <span>hashValue</span> <span>=</span> <span>myhmacsha256</span><span>.</span><span>ComputeHash</span><span>(</span><span>encoding</span><span>.</span><span>GetBytes</span><span>(</span><span>args</span><span>));</span> 
        <span>string</span> <span>hmac64</span> <span>=</span> <span>Convert</span><span>.</span><span>ToBase64String</span><span>(</span><span>hashValue</span><span>);</span> 
        <span>myhmacsha256</span><span>.</span><span>Clear</span><span>();</span> 
        <span>return</span> <span>hmac64</span><span>;</span> 
    <span>}</span>

<span>I am trying to integrate with </span>https://apidocs.unleashedsoftware.com/AuthenticationHelp

 

Like

1 comments

It's hard to understand what is "from bpmonline through an api". Will the service be in bpm'online or somewhere else? Should bpm'online call an external web service? 

Anyway. Please find more information about calling web services in the article by the link below.

https://academy.bpmonline.com/documents/technic-sdk/7-13/executing-odata-queries-using-fiddler

Log in or register to comment
Question

Hi!

Guided by   https://academy.bpmonline.com/documents/technic-sdk/7-11/authservicesvc…

I am trying to authenticate using fiddler as  client, but I get an error, please tell me what am I doing wrong.

user have access to OData.

what i receive:

HTTP/1.1 401 Unauthorized
Cache-Control: private
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/8.5
jsonerror: true
X-Powered-By: ASP.NET
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Date: Sat, 23 Feb 2019 08:02:33 GMT
Content-Length: 91

{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}


 

 

Like

1 comments

Dear Bellil,

Please see the article below on how to proceed with the authentication with bpm'online using OData protocol and Fiddler application 

https://academy.bpmonline.com/documents/technic-sdk/7-13/executing-odat…

Also, I would like to share the approach I use: I open the Fiddler --> start tracing all requests --> open login page and enter the credentials --> hit login and looking for this request in Fiddler --> drag the caught request into Fiddler Composer window. There I can see all the headers, and body sent to the system. This helps to understand what is needed, run same request with modified data (if needed for any testing).

Hope you will find it helpful,

Anastasia

Log in or register to comment
Question

When trying to call a web service from the BPM'Online platform, the process throws the following error: 

we assume that the error is due to the immense size of the JSON that we try to read from the external web service, so that the response would exceed the processing capacity limits of the webservice module of the bpm'online tool.
Our consulate is, if there is a way to increase the data processing limit of the bpm'online web service module in terms of reading the JSON delivered by the external web service.
We estimate that approximately 6 GB of RAM is needed to process the desired volume of data.

Like

2 comments

It doesn't seem to be a memory issue. Bpm'online provides up to around 8 GB RAM in critical moments and 4 GB by default. Anyway, If the application consumes more than around 8 GB RAM, IIS restarts it automatically. If you need more resources, please contact your account manager and the limits will be increased. 

It seems like the issue is related to a wrong JSON format. However, since the JSON is huge you'll not be able to debug it. In this case I recommend to create your own web service according to the article by the link below. 

https://academy.bpmonline.com/documents/technic-sdk/7-13/how-create-cus…

This way in case of the exception message you'll be able to create your own logging or debug the service on a local copy of the application. 

Please be aware of the fact that during the integration process that consumes almost all available RAM users might face performance issues. 

Thank you very much for the reply; it was indeed an error of the JSON that was being called, since it contained Null fields that did not correspond.

Log in or register to comment
Question

Hi community!

How are you?

Any example for call a API Rest from c# script in a businessProcess?

 

I have a list of processes to call from a detail, one of them must call an API and process the response but I can not use the "Call Web service" element because the request needs a json structure with many nests and I can not complete it in any other way that is not a script, any suggestions?

King Regards,

 

Ezequiel

Like

1 comments

Dear Ezequiel,

Configuring the method for "Call web service" business process parameter please use quick setup:

In this case, for example, if you provide the JSON with a nested element or even with a nested array:

The system will automatically configure correct JSON paths:

Afterward, choosing this method in "Call web service" business process parameter, you will be able to fill in any nested parameter:

The only thing that may be uncomfortable for now is that for the nested array you can fill only the first element.

In case you need to fill a bunch of the array elements please try to use any synchronous C# methods in scrip-task instead, for example, the first answer in this topic may work for you: https://stackoverflow.com/questions/9145667/how-to-post-json-to-a-server-using-c

Regards,

Anastasia

Log in or register to comment
Question

Hi,

I've configured Azure AD to my BPM. Other external application (web app) uses same Azure AD. I am trying to figure it out, how to do this:

1) Logged (via Azure AD) user on external web app, clicks button which will send request to BPM (to execute some process)

2) BPM should receive request and somehow assign executing process to currently logged user on external web app

Do you know the way to do this? Maybe I should do something like this:

1) Create technical user on BPM

2) Use this technical user credentials to login via BPM AuthService 

3) Send request to BPM (one of sent parameters will be username or email of currently logged user on web app)

4) BPM can somehow assign this username/email to executed process (how to do this?)

Maybe there is some better way to make it work? I saw that on BPM 7.13 there is some OAuth 2.0 integration -> https://academy.bpmonline.com/documents/technic-bpms/7-13/setting-oauth-20-application

Best regards,

Tomasz

Like

1 comments

Hello Tomasz,

The idea is to authorize your external web app to bpmonline using user`s credentials. More about authentication by the link: 

https://academy.bpmonline.com/documents/technic-sdk/7-13/choosing-metho…

Afterwards, business processes will run under this user. Other way to run process under certain user are not available due to security reasons.

One more way to implement this is to log in as technical user e.g. Supervisor and include information about target user in request, After that it`s up to you how to process it in business process.

Regards,
Alex

Log in or register to comment
Question

Hello community

I am working with a business process using the process element [Call Web Service].
The web service configuration and the call are working correctly.
The JSON response is similar to:
{
"$ totalResults": 2,
"$ startIndex": 1,
"$ itemsPerPage": 100,
"$ resources": [
     {
      "$ clave": "t6UJ9A000001",
      "$ Static_state": 200,
      "$ etag": "Yi4EmiUg3xw =",
       "Account": {
             "$ clave": "A6UJ9A0001RU",
             "$ uuid": "00000000-0000-0000-0000-000000000000",
           }
      },
      {
      "$ clave": "t6UJ9A00000B",
      "$ Static_state": 200,
"$ etag": "wMpPUtrfgdA =",
"Account": {
"$ clave": "A6UJ9A0001RX",
"$ uuid": "00000000-0000-0000-0000-000000000000",
}
}
]
}

My goal is to iterate the JSON and finally create tickets in BPM with the source information.
Using a pre-configured page I was able to determine that the parameter where the information is returned is [#WS Step.Response body #]
How can I take this value in a Script Task and process the JSON? or what is the correct procedure to do this?
Previously I should be able to take the value of the parameter [#WS Setp.Success #] to determine if the execution was successful

Thank you!
Good weekend

Like

1 comments

get/set a parameter value in a business process script task
var parameter1 = Get<Guid>("Parameter1");
Set("Parameter2", parameter1.ToString());
var parameter2 = Get<string>("Parameter2");

get object of type UserConnection
var userConnection = Get<UserConnection>("UserConnection");

Log in or register to comment