Dear colleagues

 

I have a process that runs when a new record is inserted and ‘does stuff’, it works perfectly, but.

 

When I do a bulk upload from Excel to that object, the process runs in isolation, in parallel, for each row in Excel.

 

Is there any way that the process could ‘detect’ that the inserted record comes from an Excel import and wait for FIleImport process to finish loading and then process row by row of excel?
 

Or some another approach?

 

Thanks in advance,

Julio

Like 4

Like

4 comments

Hello!
 

A quick solution would be to add a timer—say, 10 seconds—after which the process will read the data and proceed with the flow. This would be the fastest approach.

Regards,
Orkhan

Orkhan,

Thanks Orkhan, I tried, but didn't works, so if several records are inserted on the "same" time, the 10 seconds are not a difference so all process instances are waiting the same 10 seconds.. :-(

The best approach I found is to import on temporary table and when done run a process who move records to final one, but I want to found some method to avoid this kind of approach.

 

Some ideas?

 

Regards 

Julio.Falcon_Nodos,

have you seen the following post https://community.creatio.com/questions/run-process-after-excel-import ?

 

Show all comments

Dear colleagues,

 

In Classic UI when ran a process we can get resultParameterValues in Client Code.

 

I need to do the same but in Freedom UI client module,

 

I saw some code like this in Academy, Community and so on, but didn't any who shows us how to get process output paramaters

const handlerChain = sdk.HandlerChainService.instance;
const result = await handlerChain.process({
    type: "crt.RunBusinessProcessRequest",
    processName: "UsrSomeProcess",
    processParameters: {
        AccountId: await request.$context.Id,
        InputParameter1: "Some Value 1",
		InputParameter2: "Some Value 2"
 
    },
    $context: request.$context
});
 
if (result.success) {
    // process was sucessfully executed
}

 

Please help

 

Thanks

Julio Falcón

Like 1

Like

5 comments

I saw in the debugging is there some resultParameterValues in the response, but is null and I have one output parameter?

 

Julio.Falcon_Nodos,

Solved! due the debugging resultParameterNames element I tried and works, here the result

 

// Inicialize Process input parameters
var ClienteObject = await request.$context.NCSDetalleDelPedidoDS_NCSCuenta_kn04jps;
var LugarPobladoObject = await request.$context.NCSDetalleDelPedidoDS_NCSLugarPoblado_g8rmatm;
var ProductoObject = await request.$context.NCSDetalleDelPedidoDS_NCSProducto_cuzrngv;
if ( ClienteObject == null || LugarPobladoObject == null || ProductoObject == null ) {
	await next?.handle(request);
 
}
/// Run process
const handlerChain = sdk.HandlerChainService.instance;
const result = await handlerChain.process({
	type: "crt.RunBusinessProcessRequest",
	processName: "NCSPrecioFinalProductoPedido",
	processParameters: {
		DetallePedidoID: await request.$context.Id,
		ClienteID: ClienteObject.value,
		LugarPobladoID: LugarPobladoObject.value,
		ProductoID: ProductoObject.value
 
	},
	/* Process Output Paramters */
	"resultParameterNames": [
		"PrecioFinal",
		"ProcessesRanOK"
	],
	$context: request.$context
});
 
// Result is OK?
if ( result.success && result.resultParameterValues[ "ProcessesRanOK" ] ) {
	// OK, get price
	request.$context.NCSDetalleDelPedidoDS_NCSPrecio_leqtalu = result.resultParameterValues[ "PrecioFinal" ];
 
} else {
	// Some error msg
	console.log( "Error getting price" )
 
}

Julio.Falcon_Nodos,

Julio, excellent find - I assume the start of the process needs to be marked as "run in background" = false? Can you check if your process is marked that way?

Ryan

.

Ryan Farley,

Hi Ryan, 

 

Yes, I have configured it as you indicate. Happy to help you!

Julio

Show all comments

Dear colleagues,

 

In a Freedom ListPage, I need to process all the records that a user selects AND REPORT THE RESULTS AT THE END.

 

I'm having trouble figuring out how to approach this task. Currently, as I understand it, we call a process with the ID of the record to be processed.

 

Is there a way to know when all the selected records have been processed and know which ones?

 

I'm trying to implement a temporary table to insert the IDs of the selected records, but for this, I need to have a unique ID in that temporary table so that if there are multiple users doing the same thing, the current user's records are not mixed up. To do this, I've edited the code of the page where the service call is made to pass a second parameter to the process, an ID that I need to generate, but the generated ID is always the same "00000000-0000-0000-0000-000000000000":

			"parameterMappings": {
				"NotaCreditoID": "Id",
				"ProcesoID": Terrasoft.utils.generateGUID()
			},

 

What am I doing wrong with this approach?

 

Here is an excerpt of the modified code:

 

define("NdosNotasCredyDeb_ListPage", /**SCHEMA_DEPS*/["@creatio-devkit/common"]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/(sdk)/**SCHEMA_ARGS*/ {

 

"operation": "insert",
"name": "Button_ft2cncy",
"values": {
	"type": "crt.Button",
	"caption": "#ResourceString(Button_ft2cncy_caption)#",
	"color": "default",
	"disabled": false,
	"size": "large",
	"iconPosition": "only-text",
	"visible": true,
	"clicked": {
		"request": "crt.RunBusinessProcessRequest",
		"params": {
			"processName": "NdosLiberaDescartaNC_CC",
			"processRunType": "ForTheSelectedRecords",
			"showNotification": true,
			"dataSourceName": "PDS",
			"parameterMappings": {
				"NotaCreditoID": "Id",
				"ProcesoID": Terrasoft.utils.generateGUID()
			},
			"filters": "$Items | crt.ToCollectionFilters : 'Items' : $DataTable_SelectionState | crt.SkipIfSelectionEmpty : $DataTable_SelectionState",
			"sorting": "$ItemsSorting",
			"selectionStateAttributeName": "DataTable_SelectionState"
		}
	},
	"clickMode": "default"
},

 

On the other hand, has anyone done this in any other way? How?

 

Thank you very much

 

Julio

Like 0

Like

4 comments
Best reply

Hi Julio, 

As of Creatio 8.1.3 you can pass multiple records into a process using a collection parameter. This executes a single process for the collection of selected records. See an example in this article: https://customerfx.com/article/launching-a-process-for-multiple-records-in-a-creatio-list/

Ryan

I'm also tried sdk.generateGuid(), I test it on the console and returns a Guid, but for some reason the parameters is not delivered to the process, what's wrong?

Hi Julio, 

As of Creatio 8.1.3 you can pass multiple records into a process using a collection parameter. This executes a single process for the collection of selected records. See an example in this article: https://customerfx.com/article/launching-a-process-for-multiple-records-in-a-creatio-list/

Ryan

Ryan Farley,

Thanks Ryan,

 

I know and I use them, the problem is the process ran for each record individually and if I need to detect when it processes all selected records, generate a report like "Selected records xxx, processed records yyy" and actually this is not possible 

 

At least I don't know how to do this.

 

Thanks again

 

Julio

Thanks Ryan, your article solves my problem, great job as usual

 

Regards

Julio

Show all comments

Hello!
I have created a business process that must run after changes are made to the "Not allowed" field in the Activity. When I change this field manually and then save the activity, it runs as it should. However, I also wrote a very simple C# code in the saving event that changes this field in the activity when I move the activity in the calendar, but the process does not start despite the changes in the "Not allowed" field.

I am moving the activity in the calendar

Code: _entity.SetColumnValue("CHNotAllowed", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss")); 

Process:


 

Like 0

Like

2 comments

Hello,
If an Entity.Save() call occurs in the embedded process or listener, in this case, the signal to start the BP is not thrown.
Try using the EntitySchemaQuery, if I'm not mistaken, it should trigger the necessary Entity level.

Dmytro Vovchenko writes:

Hello,
If an Entity.Save() call occurs in the embedded process or listener, in this case, the signal to start the BP is not thrown.
Try using the EntitySchemaQuery, if I'm not mistaken, it should trigger the necessary Entity level.

It works everywhere except changes in the calendar

"Try using the EntitySchemaQuery" -what do you mean? plz give an example. 

Show all comments

Hello Everyone,

 

I'm currently exploring security options within creatio, to secure the process with Password. Specifically, My goal is to restrict access to certain process by requiring user to enter password before any modifications.

 

Could anyone share insights or best practice to implement password protection for Process in Creatio? Are there any built-in features or recommended approces to achieve this?

 

Your guidance would be greatly appreciated. Thank You!

Like 0

Like

2 comments
Best reply

Greetings,
 

Unfortunately, we do not have this functionality at the moment. We have registered this request for our R&D team to ensure that the developers consider this request and implement it in future updates.


Thank you for helping us make the product better!

Greetings,
 

Unfortunately, we do not have this functionality at the moment. We have registered this request for our R&D team to ensure that the developers consider this request and implement it in future updates.


Thank you for helping us make the product better!

Orkhan,

Thank you for your kind reply.

Show all comments

Hello, How to automatically run a process as soon as a page is opened

 

Like 2

Like

1 comments

Hello,

To achieve your goal, you will need to apply the development.

You can find basic examples for launching the process from the page from our partners CustomerFX:

1) Starting a Process from Client-Side Code on a Creatio Freedom UI Page

2) Programmatically Starting a Process from Client Code in Creatio

Thank you.

Show all comments

In this Code "CollectionParameter" is Collection of records type.

 

const handlerChain = sdk.HandlerChainService.instance;
const result = await handlerChain.process({
    type: "crt.RunBusinessProcessRequest",
    processName: "UsrSomeProcess1",
    processParameters: {
      CollectionParameter : //How it should be passed ?
      SomeParameter: "Some Value" //ID Paramete
    },
    $context: request.$context
});
 
if (result.success) {
    // process was sucessfully executed
}

 

 

Like 0

Like

1 comments

Hello!

 

You can use the ProcessEngineService in order to run a business process through a web service and send a collection parameter. The Academy has published an article with a detailed example of how to use ProcessEngineService, which you can find at https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/integrations-and-api/business-process-service/examples/run-the-business-process-web-service

Additionally, there's an overview of the web service that explains how to send a key-value collection of incoming parameters, and you can access it at https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/integrations-and-api/business-process-service/overview

Show all comments

Is there a system table that can be queried to find out which section and/or detail run process menu(s) a process is found in?  Or any other way of doing this?

 

*Edit*  A query to find out what section(s) an object is a detail in would be quite helpful.

 

Thanks,

Like 1

Like

3 comments

Hi Gareth,

 

Thank you for reaching out!

 

This is the ProcessInModules table.

 

Also, there is no differentiation in Creatio between section and detail objects. So basically, an object is the same for a detail and a section. You could use the following script:

 

SELECT DISTINCT ss.Name , 
CASE 
WHEN EXISTS (SELECT 1 FROM  SysModule WHERE SysModuleEntityId IN (SELECT Id FROM SysModuleEntity WHERE SysEntitySchemaUId = ss.Uid)) THEN 'Section' 
WHEN EXISTS (SELECT 1 FROM  SysDetail WHERE EntitySchemaUId = ss.Uid) THEN 'Detail' 
else '' 
END AS "Section/Detail"
FROM SysSchema ss 
WHERE EXISTS SELECT 1 FROM  SysModule WHERE SysModuleEntityId IN (SELECT Id FROM SysModuleEntity WHERE SysEntitySchemaUId = ss.Uid) 
OR EXISTS
 (SELECT 1 FROM  SysDetail WHERE EntitySchemaUId = ss.Uid)
AND 
 ss.ManagerName = 'EntitySchemaManager'

 

Best regards,

Anastasiia

*Edit* The below queries return both active and inactive processes., at a glance I am not able see how to select active only.

 

The query we arrived at to list the processes in the run process menu of sections:

SELECT SM.Caption AS [Section Name], SS.Caption AS [Process Name] 
FROM ProcessInModules AS PIM 
JOIN SysModule AS SM ON PIM.SysModuleId = SM.Id 
JOIN SysSchema AS SS ON PIM.SysSchemaUId = SS.UId; 

And the query to list the processes in the run process menu of individual details:

SELECT SD.Caption AS [Detail Name], SS.Caption AS [Process Name] 
FROM ProcessInDetails AS PID 
JOIN SysDetail AS SD ON PID.SysDetailId = SD.Id 
JOIN SysSchema AS SS ON PID.SysSchemaUId = SS.UId; 

I would like to be able to say what sections a detail appears in, but would imagine this information to be buried deep in Creatio system tables.

 

If anyone can check the above queries I would be grateful!

Hi Gareth,

 

The queries you have written are correct. However, it's hard to check which details belong to which sections by a DB query as details are connected to a page in the page's schema. So you need to decode the schema's content and filter in it. Such a query is hard to build and it will take a long time for it to get executed.

 

Best regards,

Anastasiia

Show all comments

Hi Community,

In mobile application I have a button "Terminar" that when I press it I want run a process from my process library in Creatio.

To implement this button I created the following component and a function "onClickMeButtonClick", that is responsable for executing the process after pressing the button. To execute the process I used "Terrasoft.configuration.ProcessModuleUtilities", but I'm not sure if this is the best way to implement this example.

Any idea on how to develop this logic?

 

Thanks an advance.

 

Best Regards,

Daniel Longo

Like 0

Like

2 comments

Hello Daniel,

 

The mobile application UI doesn't support working with business processes and processes are only triggered on the server side in real-time once the record is modified in the mobile application or record is added (and correspondent start signals are present in some process).

 

Our core R&D team already has a task to make it possible to work with business processes from the UI directly and I will also let them know about your post so to prioritize the task for them.

 

Thank you for helping us in making the app better!

 

Best regards,

Oscar

Thank You Oscar.

I think it is a important feature for the application, so that the actions of the buttons can be dynamic and don't just give it "Message Alerts".

 

Best Regards,

Daniel Longo

Show all comments

Hi Community,

 

I have this situation where I need to excute some process through client side. While executing this process I want to pass a collection of ids to one of the process parameters. These ids are the Quotes that I multi-selected in the image bellow.

Pressing the  "Merge Quote" button will execute the following code.

This code will create a new collection with all the ids selected before and send them to my process. The next image shows the collection created.

I want to know which type of data should I use for my parameter in my process for this type of collection, where can I learn more about these types of collections and its methods and how can I access its values with the various process tasks?

 

For tests purposes I want to display one of the ids using a "Open Popup Window". 

 

Thanks in Advance.

 

Best Regards,

Pedro Pinheiro.

Like 1

Like

1 comments

Hello Pedro,

 

Creatio works with collections if it's needed to process such data but not to display it. You can pass items to sub_process or web_service elements or perform some script_task over it. Please refer to https://academy.creatio.com/docs/user/bpm_tools/business_process_setup/process_collections where this process is described.

 

In case if you want to work with the result of your script that returns a collection as described in your example,  you need to write it in a text string with ";" separator for Id's and then - split it on the next step to parse Id's and reflect them where you want.

 

Best regards,

Bogdan

Show all comments