Hi there,

 

I have a requirement to trigger a business process with a parameter value from an anonymous web service and get errors while publishing the code in the Creatio environment. Below I have mentioned the complete code of the web service and the error screenshot of the error.

 

Note: I have pre-created the business process with the parameter and written the web service.

I referred other community articles such as 

https://community.creatio.com/articles/web-service-without-authorizatio…

https://community.creatio.com/questions/calling-business-process-parame…

These codes currently seem to be outdated and not working in the Atlas version of creatio. Please give me suggestions to resolve this issue.

 

Code :

 

/* The custom namespace. */
namespace Terrasoft.Configuration.WSO2WSConfirmationServiceNamespace
{
    using System;
    using System.ServiceModel;
    using System.ServiceModel.Web;
    using System.ServiceModel.Activation;
    using Terrasoft.Core;
    using Terrasoft.Web.Common;
    using Terrasoft.Core.Entities;
    using Terrasoft.Core.Process;
    using Terrasoft.Core.Process.Configuration;

    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class WSO2WSConfirmationService : BaseService
    {
        /* The link to the UserConnection instance required to access the database. */
        private SystemUserConnection _systemUserConnection;
        private SystemUserConnection SystemUserConnection
        {
            get
            {
                return _systemUserConnection ?? (_systemUserConnection = (SystemUserConnection)AppConnection.SystemUserConnection);
            }
        }

        /* The method that returns the confirmation of buttons. */
        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
        ResponseFormat = WebMessageFormat.Json)]
        public string ConfirmationService(string guid, bool status)
        {
            new Guid(guid);
            string result = "Guid is missing";
            if (!string.IsNullOrEmpty(guid)) {
                if (status == false)
                {
                    var manager = UserConnection.ProcessSchemaManager;
                    var processSchema = manager.GetInstanceByName("WSO2Process_3c0d24a");
                    var moduleProcess = processSchema.CreateProcess(UserConnection);

                    if (processSchema.Parameters.ExistsByName("ProcessSchemaConfirmationId"))
                    {
                        moduleProcess.SetPropertyValue("ProcessSchemaConfirmationId", guid);
                    }
                    moduleProcess.Execute(UserConnection);

                    /*ProcessSchema schema = UserConnection.ProcessSchemaManager.GetInstanceByName("WSO2Process_3c0d24a");
                    //schema = UserConnection.ProcessSchemaManager.GetInstanceByUId(leadManagementProcessUId);

                    //different engines for interpretable and compiled BP
                    bool canUseFlowEngine = ProcessSchemaManager.GetCanUseFlowEngine(UserConnection, schema);
                    if (canUseFlowEngine)
                    {
                        var flowEngine = new FlowEngine(UserConnection);
                        var param = new Dictionary<string, string>();
                        param["ProcessSchemaConfirmationId"] = guid.Id.ToString();
                        flowEngine.RunProcess(schema, param);
                        
                    }
                    else
                    {
                        Process process = schema.CreateProcess(UserConnection);
                        process.SetPropertyValue("ProcessSchemaConfirmationId", guid.Id);
                        process.Execute(UserConnection);
                    }*/
                    result = "Response posting is cancelled, You can close this tab";

                }

                else {
                    result = "WSO2 endpoint intergration is pending";
                
                }
            }

            

            return result;
        }
    }
}

File attachments
Like 0

Like

1 comments

Found the answer for this mentioned issue, Please refer to the code below. Using IProcessExecutor, this can be simply achieved in the 8.0 version.

/* The custom namespace. */
namespace Terrasoft.Configuration.WSO2WSConfirmationServiceNamespace
{
    using System;
    using System.ServiceModel;
    using System.Collections.Generic;
    using System.ServiceModel.Web;
    using System.ServiceModel.Activation;
    using Terrasoft.Core;
    using Terrasoft.Web.Common;
    using Terrasoft.Core.Entities;
    using Terrasoft.Core.Entities.Events;
    using Terrasoft.Core.Process;
    using Terrasoft.Core.Process.Configuration;

    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class WSO2WSConfirmationService : BaseService
    {
        /* The link to the UserConnection instance required to access the database. */
        private SystemUserConnection _systemUserConnection;
        private SystemUserConnection SystemUserConnection
        {
            get
            {
                return _systemUserConnection ?? (_systemUserConnection = (SystemUserConnection)AppConnection.SystemUserConnection);
            }
        }

        /* The method that returns the confirmation of buttons. */
        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
        ResponseFormat = WebMessageFormat.Json)]
        public string ConfirmationService(string guid, bool status)
        {
            try
            {
                new Guid(guid);
                string result = "Guid is missing";
                if (!string.IsNullOrEmpty(guid))
                {
                    if (status == false)
                    {

                        {
                            // getting  IProcessExecutor
                            IProcessExecutor processExecutor = SystemUserConnection.ProcessEngine.ProcessExecutor;
                            // List of input parameters
                            var inputParameters = new Dictionary<string, string>
                            {
                                ["ConfirmationId"] = guid.ToString(),
                            };
                            //code of the process
                            string processSchemaName = "WSO2Process_3c0d24aCustom1";
                            //execute the process
                            ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaName, inputParameters);
                            //return processDescriptor;
                        }
                        
                        result = "Response posting is cancelled, You can close this tab";

                    }

                    else
                    {
                        result = "WSO2 endpoint intergration is pending";

                    }
                }
                return result;

            }
            catch (Exception ex)
            {
                return "GUID error - " + ex.Message; 

            }

            
        }
    }
}

 

 

Thanks

Show all comments

Hi community,

For an integration, I have the following JSON request parameter :

{
  "externalID": "57",
  "nomDuClient": "Simple text example",
  "nomDelOpportunite": "Simple text example",
  "calculateurs": [
    "57",
    "61"
  ]

}

Let's have a further look to the "calculateurs" field. When setting the WebService into Creatio with the automatic request paramters, I get something like this :

image.png
I have "Text" data which is an Array. Everything's fine. 

Now, if I use the "WebService" element in the business process, it automatically sets something like this :

image.png

This structure will give a parameter that will look at something like :

"calculateurs": [

{ "name of the element": "value of the first element" }, { "name of the element": "value of the second element" } 

]

Which will be an array of structure of strings and not just an array of string.

Furthermore, when trying to get a collection through looping into a subprocess, the collection of parameters given by the subprocess will look at something like this :

image.png

They will be an array of structure of strings. 

It has been hours that I am trying to populate my WebService parameter as just an array of strings.
How can I achieve that ?

Many thanks,
Jonathan

Like 0

Like

5 comments

Dear Jonathan,

 

Unfortunately, there is no OOB functionality for transferring data sets (IsArray type) to web service parameters by not the 'Read data" element.

 

 We have already registered the idea for our R&D team to implement this functionality in further releases. I will assign your case to this project in order to increase its priority.  

 

Best regards,

Bogdan

Bogdan,

 

I have this situation when setting up the Web Service :

 

When i call the WebService process element, the field automatically fills like this :

 

And with this element, it is impossible to send an array of strings like set in the webservice request parameter isn't it ?

 

If we have a JSON like :

 

"Assistant": [

{

"string": "hello world"

}

]

 

Where the "string" value is set in "Sélectionner la valeur" on the screenshot above. So there is really no way of sending an array of strings, really ?

 

When I test the request directly from the WebService section, I can just add lines to the array and manually setting values into it. Isn't there a way to do it automatically ?

 

Let me ask the question in a different way, how could I send an array of strings via the "Read data" element of the business process ?

 

Many thanks,

Jonathan

Jonathan Quendoz,

 

If the request parameter is a collection (the “Is array” checkbox is selected in the properties of the parameter at the web service record), the nested collection parameters will be displayed under the collection name in the process element parameters (Fig. 3). For example, Creatio “batch query” service can insert several records (e.g. contacts) to Creatio. To do this, the service would require information to write into the fields of each inserted record (e.g. contact names and types). In this case, you can pass the values as a request parameter of an array type, where “Name” and “Type” will be nested parameters and each instance of the collection would represent data for a separate contact record.

 

 

The values of collection parameters of one [ 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.

 

 

 

The parameters of the collection of process elements can be mapped to the process parameter of the “Collection of values” data type.

 

Please refer to the article here.

 

Best regards,

Bogdan

 

Jonathan Quendoz,

Hi! How are you? I'm running on the same problem. Did you find a solution? Appreciate it.

Regards

Uriel Nusenbaum,

 

Hi Uriel ! 

 

Unfortunately, I did not found a solution to this problem. 

I asked to the WebService supplier to adjust their webservice to have an array of structure of strings as json paramater instead of just an array of strings.

 

At the moment, I think that besides calling a WebService via C# in back-end, it is not possible to send an array of strings as parameter. It should really be reworked from Creatio.

 

You can only send an array of a structure of strings via a sequentiel sub-process.

 

Please, if you have any questions about this, do not hesitate.

 

Best regards,

Jonathan

Show all comments

Hi community,

 

I have a time column typed named Duration. In the execution of a business process I want to change the value of this attribute with the difference of two datetime parameters: enddate - startdate. Is there any way to perform this action or should I change the type of this column to type number.

Like 0

Like

0 comments
Show all comments

Hi,

I tried adding System.Net in Business Process Using property and it is throwing me error "A namespace cannot directly contain members such as fields or methods".

Is there any workaround?

Best regards,
Solem A.

Like 0

Like

0 comments
Show all comments

Hi,

Business process successfully running  in Dev environment.

But giving the error in Production environment.

 

Error message:

"An error occurred while applying the value of the parameter "GlbPopupWindowText" of the business process element:
    Unable to compute expression "[#[IsOwnerSchema:false].[IsSchema:false].[Parameter:{35efc48b-729e-4060-93e1-c263b244e32c}]#]", error: Formula value error: Expression expected (at index 0)."

 

but in business process there is no expression like above.

 

Any help on this.

 

Thanks

Like 0

Like

1 comments
Best reply

Hello, 

 

I would like to suggest you to double-check the business process parameters and re-add the mentioned parameter anew on the prod instance. If the issue still persist, please contact our support team via email: support@creatio.com so we could proceed with investigation.

 

Best regards,
Anastasiia

Hello, 

 

I would like to suggest you to double-check the business process parameters and re-add the mentioned parameter anew on the prod instance. If the issue still persist, please contact our support team via email: support@creatio.com so we could proceed with investigation.

 

Best regards,
Anastasiia

Show all comments

Hi community,

 

The situation is the following :

 

 

To have some context, after importing some data from an Excel file in the "Calculateur" detail it does some calculations in the "Informations Prix" detail.

 

However, now when trying to implement a business process needed to recalculate the values in the “Informations Prix” detail when we delete some records, I encounter some problems.

I have tried to put a start signal as “When a ‘Calculateur’ is deleted” it starts the process. However, the problem is that I can’t obviously get the Id of the opportunity and the Id of the other calculator records related to it because the record is deleted and only AFTERWARDS it starts the process. So, the business process doesn’t find the Id of the “Calculateur” or the Opportunity related to the deleted record.

 

A good thing to note is that every record of the “Calculateur” has its own Id.

 

Furthermore, I have tried to start the process on an Event like this :

 

 Here, right next to the checkbox, it says : “Before deleting a record”

 

And to start the business process with a “Message signal” with “CSLCalculateurDeleting” as message. However, I don’t really understand how this works because I can’t get the Id of the opportunity anyway.

 

In addition to all this stuff, my idea, according to this article that tried to answer the same need as mine :

 

 

So, my idea was to implement a “Delete” button next to the “Calculateur” detail that will delete the selected record, get the Id of the Opportunity and start a process which now could have all the parameters that I need for my further recalculations. However, how can I get, in the JavaScript Client Side part of code, the Id of the selected record to delete ? See this example :

 

 

I want the Id of the record highlighted in blue.

 

What is the best way to implement this according to the different possibilities above ? Do you have any idea ?

 

Many thanks for the attention paid to this long question. Hopefully you can help me figure this out.

 

Best regards,

Jonathan

Like 0

Like

2 comments

Stop using the normal Delete of a record by rights and instead force users to Delete with a business process.
The business process then runs the logic and then Deletes record in the end. So far so good.

It's simpler to maybe run the Business process from the record page. (Double-click row to open). If you wanna use a button on the row, check this out: https://community.creatio.com/articles/add-button-active-row-detail

Hi Julius,

 

Thanks for your answer. I have found the answer to my questions and it was really simpler that I thought.

 

In fact, on the start signal of the process it is necessary to unthick the checkbox :

 

 

So that it is possible to get the Id of the opportunity related to the deleted record.

 

Best regards,

Jonathan

Show all comments

HI, 

 

I'm working with a business process, I have added a "Perfom Task" element, but I need to be able to set a custom parameter to it. The field already exists in the activity, but I'm not able to set it from them "Perfom Task" element.

 

Is there a way to do this?

Like 0

Like

2 comments

Hello Javier,

Could you please specify which custom parameter do you mean?

Thanks in advance!

Best regards,
Bogdan

Hi Bodgan, I have figured it out. 

 

I added this code in "Advace settings" -> "After save" of "Perfom Task" element:
 

 activity.SetColumnValue("[FieldName]", [FieldValue]));

  activity.Save();
 

 

 

Thank you!

Show all comments

Hi community,

 

I have the following situation :

 

 

From the "ENCOWAY SESSION" button, I want to override the onClick() method from it to automatically start a business process from there. How can I do this ?

 

 

Furthermore, my business process should take the object id (e.g. opportunity id) corresponding to the id of the record where the button is and set it as a request parameter of a webservice.

 

Then, I want to open the response paramter, which is an URL, in a new window. The Script Task is in C#, so I want to have a similar method as window.open("URL") in Javascript. The "URL" should be the response parameter of the API.

 

Do you have any idea on how to achieve this ?

 

Here is a business process model summary of what I want :

 

 

Many thanks,

Jonathan

Like 0

Like

2 comments
Best reply

Hi Jonathan,

I have an article on that topic with the code you'll need to start the process and pass the current record Id into a process parameter here: https://customerfx.com/article/programmatically-starting-a-process-from…

However, as far as opening a new window, you can't do that from a server-side process. Instead, you can send a value, such as a URL string, from the server-side process to the client-side code, then the client-side code could open the window. I have an article on that topic here https://customerfx.com/article/sending-a-message-from-server-side-c-to-…

Ryan

Hi Jonathan,

I have an article on that topic with the code you'll need to start the process and pass the current record Id into a process parameter here: https://customerfx.com/article/programmatically-starting-a-process-from…

However, as far as opening a new window, you can't do that from a server-side process. Instead, you can send a value, such as a URL string, from the server-side process to the client-side code, then the client-side code could open the window. I have an article on that topic here https://customerfx.com/article/sending-a-message-from-server-side-c-to-…

Ryan

Dear Ryan Farley,

 

Your answer was really perfect. I managed to implement the whole process. Your articles are very pertinent. 

 

Many many thanks,

Jonathan

Show all comments

Hi All,

 

How to get the Page parameter value defined in a Pre-Configured page. I have tried to get that value(lookupfield value) using the usual way of get method but it returned undefined though there was value to it.

this.get(param).value;

 

Is there any other way to retrieve the page parameter value?

 

Thanks

Anupama

Like 0

Like

2 comments

Hi Anupama,

 

I've created a simple page where the value for the lookup column is filled in by the process before opening this pre-configured page:

After that the code of the pre-configured page should be modified a little:

methods: {
			onEntityInitialized: function(){
				this.callParent(arguments);
				var resultString = this.get("UsrTestStringField");
				var resultLookup = this.get("UsrTestLookupField");
			}
		},

As a result once the page is opened the onEntityInitialized is triggered and values from the fields displayed on the pre-configured page are read:

and

So you can use the following approach on your end.

 

Best regards,

Oscar

Thanks Oscar Dylan for the details. 

Show all comments

Hi Team,

We have explored the age calculation functionality on ContactSectionV2 base schema.
we would like to know the same functionality in previous versions (7.15) and how does that calculation process is happening.

In 7.18,

I have the below items explored

System Setting Value
1.RunAgeActualizationDaily
2.ActualizeAge

Business Process
1.ContactActualizeAgeProcess
2.ContactAgeActualizationRunnerProcess

3.ContactAgeActualizationJobRestartProcess

Methods in ContactSectionV2 Schema

1.runRescheduleAgeActualization

2.runActualizeAgeProcess

But in the earlier version (7.15) I don't have any of the items mentioned above and would like to know how does the functionality works (When a "Date Of Birth" field is filled or modified "Age" field is calculated).

Thanks in advance!

Regards,

Bhoobalan P.

Like 0

Like

5 comments

Hello

 

This functionality remains in 7.18. The processes are there  with system settings as well as methods in ContactSectionV2 of the UIv2 package

If these all are missing in your environment - please contact the support via support@creatio.com to investigate it since this functionality should be avaiable.

 

Regards,

Dean

dean parrett,

Thanks for the response!

Yes, I can see this functionality in 7.18.
But in 7.15 version I could not see any of these functionalities, BP and system setting also.

I would like to know how this is executed in 7.15 version?

Regards,

Bhoobalan P.

Hello!

My apologies for confusion. It depends on your 7.15 subversion. The age calculations feature is available starting from 7.15.3.1649. There were no age field with automatic calculations before that version. All items that numerated above are there starting from 7.15.3.1649

 

Regards,
Dean

dean parrett,

Thanks much for the clarification!

Also, I have 7.15.0.634 version, but I can see the "age calculation" happening whenever I changed the Birth Date field value. Can we have any control over it?

dean parrett,

Also, I have 7.15.0.634 version, but I can see the "age calculation" happening whenever I changed the Birth Date field value. Can we have any control over it?

Any idea / suggestion on this?

Thanks in advance!

Show all comments