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();

                        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

I created an Operation Permission that will check if the user has limited access to the section and override the getViewOptions but the problem is getViewOptions was run first before the RightUtilities.checkCanExecuteOperation which checks the access of the user.



How can I able to check the user access and then override the getViewOptions?

getViewOptions: function () {
    var CanManageAccessRight = this.get("CanManageAccessRight");
 
    if (!CanManageAccessRight) {
        return this.Ext.create("Terrasoft.BaseViewModelCollection");
    } else {
        return this.callParent(arguments);
    }
}
checkCanManageAccessRight: function(callback) {
	RightUtilities.checkCanExecuteOperation({ operation: "CanManageAccessRight" }, function (result) {
		this.set("CanManageAccessRight", result);
	}, this);
}

 

Like 0

Like

1 comments

Hello,

 

You need to review which function is called before the getViewOptions method in the call stack in the developer console and use the operation permission in that method and only then call the getViewOptions method or not based on the result of the checkCanExecuteOperation method execution.

Show all comments

Hello,

I am trying to send email for collection of records based on condition. I could do that by looping and adding a flag to the record. Is there any direct method to do this through business process. Also, would be of great help if there is any documentation on how to handle collection of records as a parameter and Read collection of records in Which data read mode to use?

 

Thanks,

Like 0

Like

2 comments
Best reply

 

PRATHYUMNAN M,

 

Refer the following academy article which may help,

[Sub-process] element - Multi-instance mode

 

Regards,

Sourav

 

PRATHYUMNAN M,

 

Refer the following academy article which may help,

[Sub-process] element - Multi-instance mode

 

Regards,

Sourav

Thanks Sourav!

Show all comments

Hi,

I am exploring how to send email to group of contacts without using a flag. Could someone help me out with using Collection of record parameters. Also, How could I use Read Collection of Records in Which read data mode to use?

 

Thanks in advance,

Prathyumnan M

Like 0

Like

1 comments

Hi! 

Is there any possibility to enable or to create a scroll bar that goes horizontally in a detail?

Thank you!

Like 0

Like

4 comments

Dear Ivan,

 

Thanks for reaching out. 

 

Such functionality was added in the 8.0.3 Creatio release. More information about it can be found by the link here.

 

Please let us know if any additional questions arise!

 

Best regards,

Anastasiia

Anastasiia Marushenko,

sorry, but we are currently not working on 8.0.3. We use

8.0.0.5476. May I have the code for implementing it in our version please? And where should I write it.

Thank you,



Rares

Ivan Rares Marian,

 

Can you please provide us with a screenshot of such detail, where the scrollbar should have appeared but it didn't? The horizontal scrollbar should appear in details by default if you add a lot of columns that don't fit on the screen all at the same time. Also, please specify if this is about Freedom UI or if you are referring to details created in Section Wizard.



We would like to have it here, in the products detail. We would like to be able to scroll horizontally because we want to see the whole name of the fields.

 

Best regards, 

Ivan Rareș

Show all comments

Hello,



I would like create multiple buttons that call a business process. Due to the number of buttons in my page, I would like to create a single button click method. This method would receive a parameter that would tell it which button was called. The parameter would then determine which field would be read.



My button method should look something like this:

 onButtonClick: function(clickedButton){
				var recordId = this.get("Id");
                var readField = "Error"; //This value should change later, will show error otherwise
 
                switch(clickedButton){
                    case "Button1":
                        readField = this.get("Field1");
                        break;
                    case "Button2":
                        readField = this.get("Field2");
                        break;
                    /*More Cases
                    .
                    .
                    .
                    */
                   default:
                    console.log(readField);
                    break;
                }
 
                var config = {
                    sysProcessName: "UsrBpToCall",
                	parameters: {
						CurrentRecordId: recordId,
						ReadField: readField,
 
					}
				};
                ProcessModuleUtilities.executeProcess(config);
}

I assume the parameter would appear in the diff section, but I do not know how to implement this functionality.



I appreciate your help!

 

Kind Regards,

Firas



 

Like 1

Like

3 comments
Best reply

Hello Firas,

If you add a tag to each button it will get passed as the fourth parameter to the click handler. 

For example:

{
	"operation": "insert",
	"parentName": "Detail",
	"propertyName": "tools",
	"name": "MyButton1",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": "Send selected invoice",
		"click": {"bindTo": "onMyButtonClick"},
		"tag": "MyButton1"
	}
}

Then you can retrieve the tag in the click function handler like this: 

onMyButtonClick: function(p1, p2, p3, tag) {
    console.log(tag);
}

Ryan

Hello Firas,

If you add a tag to each button it will get passed as the fourth parameter to the click handler. 

For example:

{
	"operation": "insert",
	"parentName": "Detail",
	"propertyName": "tools",
	"name": "MyButton1",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": "Send selected invoice",
		"click": {"bindTo": "onMyButtonClick"},
		"tag": "MyButton1"
	}
}

Then you can retrieve the tag in the click function handler like this: 

onMyButtonClick: function(p1, p2, p3, tag) {
    console.log(tag);
}

Ryan

Ryan Farley,



the solution works perfectly. Thank you.



I have a follow-up question if you do not mind. Does the tag being passed as the fourth argument mean that button click methods can take up to 4 arguments?  If that is the case how can one proceed if they were to pass more than one argument and populate p1 through p3? 



Thank you again, your Community responses and articles have been very helpful.



Firas

Hello,

 

Not sure about passing 4 arguments to the click event, I've been using the tag property only to pass the parameter needed. In your case you can bind the click-handler method to several buttons and specify different tags for it so the click-handler method could understand what to do according to the button tag.

Show all comments

When I compiling system after downloading my package, I get these errors. I cant fix it in any way. Where do I need to look for the trouble? In some database table or what should I look for in objects?



In all code schemas it's trying to get contact name. (The file contains screenshot with AccountSchema.Base.cs err code)

Like 0

Like

4 comments

Hello,

 

We advise registering a Case for our technical support team describing all the needed details, as there's a need to conduct a deeper investigation of the problem in order to resolve it.

 

Kind regards,

Mira

Mira Dmitruk, ok, I'll  write to them. If someone knows answer, please :)

Hi James, Did you manage to solve the problem?

 

Federica,

Hi, yep. I had this trouble two times.

 

I have an assembly package, so for the second time I didn't use replacement schemas of basic objects. I had to delete "Contact", it helps.



The first time I checked the data with SQL (table "SysEntitySchemaReferences") found and deleted broken object "Activity".

 

I think it's much easier to check source code. It says what object it's trying to find.

I hope I could help.

Show all comments

Hi,

 

Is it possible to modify the access rights of a particular tab(Let's call it "TestTab") to be available for reading/writing only for users with a certain role?



Thank you,

Madalin

Like 0

Like

1 comments

Hello Madalin,

Your business task could be achieved only by Object operation permissions.

 

I hope the above is useful to you.

Show all comments

Hi Community,

 

We have enabled record permission for an object and based on some conditions we are adding role wise permissions to the record. We want to filter a contact lookup field based on the roles to whom the record has access, i.e. only those contact will show whose associated user falls under the roles to which the particular record has access.

 

Any suggestions or lead will help a lot.

 

Thanks,

Sourav Kumar Samal

Like 0

Like

2 comments

Hello,

 

To read more information about the permission access and role please refer to these Academy articles: Object operation permissionsFunctional rolesRecord permissions

Kalymbet Anastasia,

 

Thanks for the suggestions.

 

But we are looking to filter a contact lookup based on the roles to which the particular record has access. If there are any suggestion specific to this business task, that will be great.

 

Regards,

Sourav

Show all comments

I have problem about filter. How add filter in list creatio?

So that you understand what I mean, I've included the picture below

and the filter I mean is like this

Like 0

Like

1 comments

Hello Muhamad,

 

Your business task could be achieved by development tools.



Please refer to this article.



Best regards,

Bogdan

Show all comments