Hi Team, 

 

I have a webservice created with the designer in the web services setup integrations and I would like to call it from a client schema. There is any way to perform that?

Like 0

Like

1 comments

Hi Federico,

As far as I know, there is no direct way to call this type of web service from a client side, however, there is a small trick you can do. You can configure a business-process to run your service and on the client side, you can run this process.

Also, I will registrate your suggestion to our R&D team, thank you for giving us ideas to improve.

Show all comments

Hi Community!!!

I used built in web service configuration to configure an integration with third party app.

The JSON that third party app receives looks like this:

{

  "url": "https://test",

  "events": ["a","b"]

}



The configuration for the events parameter into web service is as shown in the image below:

My issue is when I try to call this Web Service/Method from a Business Process. I cannot send the correct values for the events parameter. I tried several options for example: read a lookup values, create list or collection in a script task, etc. but I couldn't achive the goal.

The image below shows how the parameter is requested on the business process:

 

Below I show the trace with an example of the values I try to pass to the paramter:



"Parameter": "Events",

            "Value": {

                "Before execution": [

                    {

                        "Name": "invitee.created"

                    },

                    {

                        "Name": "invitee.canceled"

                    }

                ],

 

Any recomendation?

Regards.

 

 

 

 

Like 0

Like

3 comments

Hello,

You can send  your values using a collection.

The values of collection parameters of a [ Call web service ] process element can be mapped to the nested parameters of another collection of a [ Read data ] or [ Call web service ] process element .Additionally, each item of the collection can be mapped to an individual subprocess instance in the [ Subprocess ] element.



 

You can find more detailed information on the academy website:

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

Cherednichenko Nikita,

Thank you! I tried it but the result is something like this:

 

[

                    {

                        "Name": "invitee.created"

                    },

                    {

                        "Name": "invitee.canceled"

                    }

                ],

The expected value is 

[invitee.created","invitee.canceled"]

 

How can I achive this?

Regards.

Hello,

The code

[

                    {

                        "Name": "invitee.created"

                    },

                    {

                        "Name": "invitee.canceled"

                    }

],

Is seen like : [{"Name": "invitee.created"}, {"Name": "invitee.canceled"}].

But, in your case, I believe you can use the parameter value "Collection of values"

 

Show all comments

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 0

Like

6 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

Hi Julius,

 

Did you manage to solve this?

 

I'm struggling with the same issue and didn't manage to get it to work.

 

Looking forward to having Your answer.

 

Raz

Norton Lingard,

Hi Norton,

 

Is there another example on how to do it in the script task?

 

I tried implementing it based on the links you posted and I'm getting many error messages when posting the code.

 

Thanks,

Raz

Dear Raz,

 

Please find another example in the article by the link below:

 

https://stackoverflow.com/questions/3900371/how-can-i-call-a-webservice-from-c-sharp-with-http-post

 

If you still can’t resolve the issue please provide us with a source code that you wrote and errors that you got.

 

Best regards,

Norton

Show all comments

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 0

Like

1 comments
Best reply

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

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

Show all comments

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 0

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

 

 

Show all comments



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 0

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

Show all comments

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 0

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

Show all comments

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 0

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.

Show all comments

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 0

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

Show all comments

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 0

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

Show all comments