I am trying to process a collection of objects. But I am unsure how to pass the collection from a read data element in a business process to a user task. I am also unsure what parameter type I should use on the user task. Can someone tell me the name of a process/user task in creatio I can look at for an example? Or tell me how I can do this?

Like 0

Like

2 comments

Hello, Josh.

I think you can find an example here 

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

Check the example with CompositeObjectList

Hello, Josh.

Check this article 

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

 

Example you need is CompositeObjectList

Show all comments

Hi Community. 

 

I'm working with a user task and after I map all the fields in the process, adding a new paramenter in the user task it will not refresh the list in the parameters for the element in the bussines process. I'm wondering if there is some way to force the refresh/update parameters for the element? Normally for others elements (sub-process or webservice) is just click on it again.

 

Thanks, 

 

Like 0

Like

1 comments
Best reply

After add the new parameter and publish the user task is needed to compile to regenerate the cs code.

After add the new parameter and publish the user task is needed to compile to regenerate the cs code.

Show all comments

Hi Community,

I need to skip the mini-page which comes when we click "complete" on any user task in a DCM.As soon as the complete button is clicked the user task should be marked complete. Is there any way or examples to do so.

Thanks 

Like 0

Like

8 comments

Hello,

 

The method that is being called when clicking the complete button in the user-task is "execute" from the "ActivityDashboardItemViewModel" module. It checks if the item that needs to be completed has the mini-page or if it's an email activity or a process activity and then executes its logic. If none of the conditions are met the "execute" method from the "EntityDashboardItemViewModel" is called (parentMethod for the "execute" method in the "ActivityDashboardItemViewModel"). So in case you need to autocomplete the task you need to override the logic of this "execute" method (and unfortunately we don't have a specific example on this matter).

 

Best regards,

Oscar

Oleg Drobina,

 

It seems we can not create the replacing schema for EntityDashboardItemViewModel or ActivityDashboardItemViewModel. Is there any suggestion where we can override the 'execute' method to add the custom logic?

 

Regards,

Sourav

Sourav Kumar Samal,

 

Actually there is a possibility to override this logic:

 

1) Create the module with UsrActivityDashboardItemViewModel name and the following code (copied the original code from the ActivityDashboardItemViewModel):

define("UsrActivityDashboardItemViewModel", ["UsrActivityDashboardItemViewModelResources", "ProcessModuleUtilities",
		"ConfigurationConstants", "EntityDashboardItemViewModel", "MiniPageUtilities"],
	function(resources, ProcessModuleUtilities, ConfigurationConstants) {
		Ext.define("Terrasoft.configuration.UsrActivityDashboardItemViewModel", {
			extend: "Terrasoft.EntityDashboardItemViewModel",
			alternateClassName: "Terrasoft.UsrActivityDashboardItemViewModel",
 
			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
				}
			},
 
			/**
			 * @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) {
				console.log("test");
				var schemaName = this.get("EntitySchemaName");
				var hasMiniPage;
				const parentMethodArguments = arguments;
				const parentMethod = this.getParentMethod();
				Terrasoft.chain(
					function(next) {
						this.showBodyMask();
						if (Terrasoft.Features.getIsEnabled("OpenEditPageInDcm")) {
							this.hasMiniPageForMode(schemaName, Terrasoft.ConfigurationEnums.CardOperation.VIEW, next, this);
							return;
						}
						hasMiniPage = this.hasMiniPage(schemaName);
						next(hasMiniPage);
					},
					function(next, hasMiniPage) {
						this.hideBodyMask();
						if (!this._isEmailActivity() && this.isActivity() && hasMiniPage) {
							this.showMiniPage(options);
							return;
						}
						var elementUId = this.get("ProcessElementId");
						var recordId = this.get("Id");
						var config = {
							procElUId: elementUId,
							recordId: recordId,
							scope: this,
							parentMethodArguments: parentMethodArguments,
							parentMethod: parentMethod
						};
						if (ProcessModuleUtilities.tryShowProcessCard.call(this, config)) {
							return;
						}
						parentMethod.call(this, parentMethodArguments);
					},
					this
				);
 
 
			},
 
			/**
			 * 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);
			},
 
			/**
			 * @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);
			}
		});
	});

the only modification was console.log("test") to check the override.

 

2) Create a replacing view module for the SectionActionsDashboard with the following code:

 define("SectionActionsDashboard", ["UsrActivityDashboardItemViewModel"],
	function() {
		return {
			mixins: {},
			methods: {
				initDashboardConfig: function() {
					this.callParent(arguments);
					const dashboardConfig = this.$DashboardConfig;
					const activityItemsConfig = {
						"Activity": {
							viewModelClassName: "Terrasoft.UsrActivityDashboardItemViewModel"
						}
					};
					Ext.merge(dashboardConfig, activityItemsConfig);
					this.$DashboardConfig = dashboardConfig;
				},
			},
			diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
		};
	}
);
 

3) Refresh the page after saving these two modules.

 

As a result you can modify the "execute" method logic in the UsrActivityDashboardItemViewModel module.

Oleg Drobina,

 

I have tried the exact same steps, but getting the below error,

 

 

 

Is there anything I missed?

 

Regards,

Sourav Kumar Samal

Sourav Kumar Samal,

 

the same approach on my side doesn't return an error. You need to double-check all the code and that it has the same content as mine shared above.

Oleg Drobina,

 

I tried in a different instance, the error didn't come. But when I click on "Complete", it refers to the ActivityDashboardItemViewModel in stead of SKSActivityDashboardItemViewModel.

 

 

Also, I can see initDashboardConfig referencing to the correct schema, but still execute method is not,

 

 

Regards,

Sourav

Sourav Kumar Samal,

 

Hi, did you mange to solve this issue? 

Thanks in advance for your reply.

Kind regards,

Marijana

Oleg Drobina,

How can I do this in FreedomUI?

Show all comments

Hi Team,

 

Im trying to use the user task Generate ordinal number for generate a new number for a entity and use that number in the business process. But I dont know how to send the paramenter EntitySchema I tried with: 

UserConnection.EntitySchemaManager.FindInstanceByName("Project")

but dint work. Any ideas?

 

 

 

Like 0

Like

0 comments
Show all comments

In the previous versions of Creatio, In the User Task element there was the Script where you could implement the task logic, as shown in the image below

In which part of the User Task Source code , in the 7.18 Version of Creatio, should I implement the same logic ? 

 

Like 0

Like

3 comments

Hello Petrika,

 

Thank you for your question!

 

You can read more on this here:

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

 

Kind regards,

Anastasiia

Anastasiia Lazurenko,

Thank you Anastasia for your quick reply. But this is a different approach. I am not asking about the Script Task, but about the User Task.Because i want to use my logic in different bussiness processes.

Dear Petrika,

 

This logic is still the same. Please refer to the screenshots below:

 

 

Kind regards,

Anastasiia

Show all comments

I have the add-in loaded, Calculation of working days in business processes.

Trying to use the "Add Business Days" user task.

Calendar is set, number of days is set, start date is set, end date is empty.  When processing, it throws an error:

 

Npgsql.PostgresException (0x80004005): 42883: operator does not exist: boolean = integer

   at Npgsql.NpgsqlConnector.d__157.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Npgsql.NpgsqlConnector.d__156.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Npgsql.NpgsqlConnector.d__156.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Npgsql.NpgsqlConnector.d__163`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Npgsql.NpgsqlDataReader.d__32.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Npgsql.NpgsqlDataReader.NextResult()

   at Npgsql.NpgsqlCommand.d__71.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Npgsql.NpgsqlCommand.d__92.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

   at Polly.Policy.<>c__DisplayClass119_0`1.b__0(Context ctx, CancellationToken ct)

   at Polly.Policy.<>c__DisplayClass129_0`1.b__0(Context ctx, CancellationToken ct)

   at Polly.Policy.<>c__DisplayClass103_0.b__1(Context ctx, CancellationToken ct)

   at Polly.NoOp.NoOpEngine.Implementation[TResult](Func`3 action, Context context, CancellationToken cancellationToken)

   at Polly.Policy.<>c.b__103_0(Action`2 action, Context context, CancellationToken cancellationToken)

   at Polly.Policy.ExecuteInternal[TResult](Func`3 action, Context context, CancellationToken cancellationToken)

   at Polly.Policy.Execute[TResult](Func`3 action, Context context, CancellationToken cancellationToken)

   at Polly.Policy.Execute[TResult](Func`1 action)

   at Terrasoft.Core.DB.DBExecutor.FailoverExecuteReader(DbCommand command, Func`1 func)

   at Terrasoft.Core.DB.DBExecutor.d__88`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Terrasoft.Core.DB.DBExecutor.ExecuteCommand[TResult](Func`2 commandExecutionCallback, String sqlText, QueryParameterCollection queryParameters, CancellationToken cancellationToken)

   at Terrasoft.Core.DB.DBExecutor.InternalExecuteReader(String sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior, CancellationToken cancellationToken)

   at Terrasoft.DB.PostgreSql.PostgreSqlExecutor.<>c__DisplayClass41_0.b__0()

   at Terrasoft.DB.PostgreSql.PostgreSqlExecutor.ExecuteInLockIfInTransaction[TResult](Func`1 action)

   at Terrasoft.DB.PostgreSql.PostgreSqlExecutor.InternalExecuteReader(String sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior, CancellationToken cancellationToken)

   at Terrasoft.Core.DB.DBExecutor.InternalExecuteReader(String sqlText, QueryParameterCollection queryParameters)

   at Terrasoft.Core.DB.Select.d__54.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Terrasoft.Core.DB.Select.ExecuteReader(DBExecutor dbExecutor)

   at Terrasoft.Configuration.GlbCalendarServiceUtils.GetWeekEnds()

   at Terrasoft.Configuration.GlbCalendarServiceUtils.AddWorkingDays(DateTime date, Int32 days, Guid incomingCalendarId)

   at Terrasoft.Core.Process.Configuration.GlbAddBusinessDays.InternalExecute(ProcessExecutingContext context)

   at Terrasoft.Core.Process.ProcessActivity.ExecuteElement(ProcessExecutingContext context)

   at Terrasoft.Core.Process.ProcessActivity.ExecuteItem(ProcessExecutingContext context)

   at Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)

Like 0

Like

2 comments

Hello Chris,

 

Could you please double-check if you executed the script from the instruction on the Creatio deployment procedure, step 8?

https://academy.creatio.com/docs/user/setup_and_administration/on-site_…

The script name is CreateTypeCastsPostgreSql.sql file

 

Best regards,

Bogdan S.

Bogdan, thanks, but this is a creatio-hosted site.  I can run the script there via the sql console if that will work.

 

Show all comments

Hello Community!

 

I would like to call a web service using a soap request, but in this case I want to use the UserTask "Call Web Service" for that. Anyone have some sample of how to build it?

 

Thanks!

Like 0

Like

3 comments

Hello Federico,

 

You can find detailed instructions on how to call any web services from a business process in the Calling web services from business processes Academy article. Also, you can take a look at the Studying Web service documentation article that describes how to call the web service and what kind of response it will return.

 

Please, let us know in case any further information is required. 

 

Best regards, 

Olga. 

Hello Olga,

In my understand the web service element is not supporting soap request. If that is the case can you please give me a example of that?

 

Hello Federico,

 

Please, refer to the previously created Community post about SOAP Service Call: https://community.creatio.com/questions/soap-service-call

 

Please, inform us in case you require any additional assistance. 

 

Thank you in advance!

Olga. 

Show all comments