TypeError: ProcessModuleUtilities.executeProcess is not a function

Recently, in Creatio version 7.14.3.1686, we are encountering the error "TypeError: ProcessModuleUtilities.executeProcess is not a function". The code implementation regarding  "Cancel" button for Activity related tasks was done a month ago and was working perfectly fine, now I happen to see this error at the code "UsrActivityDashboardModel" attached here as text file. Though this was working fine until yesterday, I am getting the type error today. Kindly help me debug the same. We have implemented the same in our client environments and some of the env started throwing this error.

 

DB: oracle 12.1.0

Creatio : 7.14.3.1686

Like 0

Like

3 comments

Hello Dharini, 

 

First of all I have another error when I switched to not debug mode, and the cause of this error also could be a reason of your error (in debug mode all works properly).

Apart from that, you have some wrong dependencies in schema UsrActivityDashboardModel, you should replace EntityDashboardItemViewModel with ActivityDashboardItemViewModel 
Also you can replace
ProcessModuleUtilities.executeProcess(args);
with
ProcessModuleUtilities.runProcess("UsrCancelButtonBP",

{ RecordId: IdParameter } ,callback, scope);
Where callback - is a function which will execute after a process completion (you can specify Terrasoft.emptyFn), scope parameter is the scope in which callback will execute (usually this).

Kind regards,
Roman

Roman Brown,

I require help regarding the implementation of callback,scope. My code is as follows,

OnRejectButtonClick: function() {
                 this.console.log("Reject Button..");
                this.console.log(this.get("Id"));
                var IdParameter = this.get("Id");
                var args = {
                    sysProcessName: "UsrCancelButtonBP",
                    parameters: {
                        RecordId: IdParameter
                    }
                };
                ProcessModuleUtilities.executeProcess(args);
            },

Also I would like to know why ProcessModuleUtilities.executeProcess(args) is not working though I have added the dependencies related to ProcessModuleUtilities. Could you please provide an insight on this? 

 

define("UsrActivityDashboardModel",["ActivityDashboardItemViewModel", "ActivityDashboardItemViewModelResources", "ProcessModuleUtilities",
        "ConfigurationConstants", "MiniPageUtilities"],
    function(resources, ProcessModuleUtilities, ConfigurationConstants) {
        Ext.define("Terrasoft.configuration.UsrActivityDashboardModel", {
            extend: "Terrasoft.ActivityDashboardItemViewModel",
            alternateClassName: "Terrasoft.UsrActivityDashboardModel",
            entitySchemaName : "Activity",
 
            Ext: null,
            sandbox: null,
            Terrasoft: null,
 
 
 
            columns: {
                /**
                 * Process element identifier.
                 */
                "ProcessElementId": {
                    type: Terrasoft.ViewModelColumnType.ENTITY_COLUMN,
                    dataValueType: Terrasoft.DataValueType.STRING
                },
                /**
                 * Indicates if button "Execute" was clicked.
                 */
                "ExecuteButtonClick": {
                    type: Terrasoft.ViewModelColumnType.ENTITY_COLUMN,
                    dataValueType: Terrasoft.DataValueType.BOOLEAN
                },
                "RejectButtonClick": {
                    type: Terrasoft.ViewModelColumnType.ENTITY_COLUMN,
                    dataValueType: Terrasoft.DataValueType.BOOLEAN
                }
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#initIconSrc
             * @overridden
             */
            initIconSrc: function() {
                var iconSrc = resources.localizableImages.IconImage;
                this.set("IconSrc", iconSrc);
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.EntityDashboardItemViewModel#addQueryColumns
             * @overridden
             */
            addQueryColumns: function(esq) {
                this.callParent(arguments);
                esq.addColumn("Title", "Caption");
                esq.addColumn("Type");
                esq.addColumn("StartDate", "Date");
                esq.addColumn("Owner.Name", "Owner");
                esq.addColumn("ProcessElementId");
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#getProcessElementUId
             * @overridden
             */
            getProcessElementUId: function() {
                return this.get("ProcessElementId");
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#execute
             * @overridden
             */
            execute: function(options) {
                var elementUId = this.get("ProcessElementId");
                var recordId = this.get("Id");
                var schemaName = this.get("EntitySchemaName");
                if (!this._isEmailActivity() && this.isActivity() && this.hasMiniPage(schemaName)) {
                    this.showMiniPage(options);
                    return;
                }
                var config = {
                    procElUId: elementUId,
                    recordId: recordId,
                    scope: this,
                    parentMethodArguments: arguments,
                    parentMethod: this.getParentMethod()
                };
                if (ProcessModuleUtilities.tryShowProcessCard.call(this, config)) {
                    return;
                }
                this.callParent(arguments);
            },
 
 
 
            /**
             * Returns true if it is task activity entity.
             * @private
             * @return {Boolean} True if it is task activity entity.
             */
            isActivity: function() {
                var executionData = this.get("ExecutionData");
                var schemaName = this.get("EntitySchemaName");
                return this.Ext.isEmpty(executionData) ||
                    (executionData && schemaName === executionData.entitySchemaName);
            },
 
            ////TODO #CRM-33987
            /**
             * Returns if current activity is email.
             * @returns {Boolean} Returns if current activity is email.
             */
            _isEmailActivity: function() {
                var activityTypes = ConfigurationConstants.Activity.Type;
                var typeLookup = this.get("Type");
                return typeLookup.value === activityTypes.Email;
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#onExecuteButtonClick
             * @overridden
             */
            onExecuteButtonClick: function() {
                this.set("ExecuteButtonClick", true);
                this.callParent(arguments);
            },
 
            OnRejectButtonClick: function() {
            	 this.console.log("Reject Button..");
				this.console.log(this.get("Id"));
				var IdParameter = this.get("Id");
				var args = {
                    sysProcessName: "UsrCancelButtonBP",
                    parameters: {
                        RecordId: IdParameter
                    }
                };
                ProcessModuleUtilities.executeProcess(args);
			},
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#onCaptionClick
             * @overridden
             */
            onCaptionClick: function() {
                this.set("ExecuteButtonClick", false);
                this.callParent(arguments);
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.MiniPageUtilities#openMiniPage
             * @overridden
             */
            openMiniPage: function(config) {
                if (this.get("ExecuteButtonClick")) {
                    var status = {
                        name: "ActivityMiniPageStatus",
                        value: "Done"
                    };
                    if (config && this.Ext.isArray(config.valuePairs)) {
                        config.valuePairs.push(status);
                    } else {
                        config.valuePairs = [status];
                    }
                }
                this.callParent(arguments);
            }
        });
    });

 

Show all comments