Dear colleagues,

 

I have this extract of piece of code

 const runProcessRequest = Ext.create("Terrasoft.RunProcessRequest", { 
       // El nombre del Proceso
       "schemaName": "NdosGeneracionMasivaNC_PRP", 

When I save a new version of the process, the name changes, in my case from NdosGeneracionMasivaNC_PRP to NdosGeneracionMasivaNC_PRPNCSNdosNotasCredyDeb_011,

 

The question is I must be concerned to those changes, to modify each schema code page where calling those processes?

 

I.e. change the code to:

 const runProcessRequest = Ext.create("Terrasoft.RunProcessRequest", { 
      // El nombre del Proceso
     "schemaName": "NdosGeneracionMasivaNC_PRPNCSNdosNotasCredyDeb_011", 

Thanks for your support

 

Regards

Julio Falcón

Like 0

Like

2 comments

Hello Julio,

 

You can check it by creating the code that uses one version of the process, triggering the code, go to the process log and checking if the process was triggered. Then create another version, set is as an actual process version and trigger the code again.  Once done go to the process log and see which process version is triggered and make a conclusion.

Thanks Oleg, of course I can try it, I do it very often with almost everything...but I would like to know what the documentation says about it, and I haven't found it.

 

Thanks

Show all comments

Dear colleagues,

 

If have a couple of process calls in a client module, very similar, one works and the another ones fails before to call the process getting a "400 (Bad Request)" error

 

Here is the code, the first one fails:

OnGeneraDetalleContratoBtnClick: function() { 
	// Guarda el registro, por si hubo cambios
	this.save();
 
	const RunProcessRequest = Ext.create( "Terrasoft.RunProcessRequest", { 
		// El nombre del Proceso
		"schemaName": "NdosCreaDetalleContrato", 
 
		// Parámetros de entrada
		"parameterValues": { 
			"NdosGrupoEconomicoID": this.get( "NdosGrupoEconomico" ),
			"NdosContratoID": this.get( "Id")
 
		},
 
		// Parámetros de Salida - True => Hay sucursales
		"resultParameterNames": [ 
			"NdosReturn"
 
		]
	} ); 
 
	// Ejecuta el proceso
console.log( RunProcessRequest );
// THIS gets error "400 (Bad Request)" here in the execute	//ERROR ERROR HERE HERE			
	RunProcessRequest.execute(function(response) { 
		// Si OK, actualiza el valor en funcion de la salida
		if (response.isSuccess()) { 
			// Actualiza la cantidad de meses que dura el contrato
			if ( response.resultParameterValues[ "NdosReturn" ] === true ) {
				// Tiene sucursales, inhablitita el boton...
				this.set( "NdosDetalleContratoGenerado", true );		
 
				}
		} 
	}, this ); 
},

 

This another wroks fine and are (as I saw identical!!)

// Jalcon - NoCode-Services - 20240110 - 
// Cambia alguna de las fechas del Contrato, debe ajustar la duración en meses del mismo
updateDuracionContratoMeses: function() { 
	const runProcessRequest = Ext.create("Terrasoft.RunProcessRequest", { 
		// El nombre del Proceso
		"schemaName": "Jfl_MesesEntreDosFechas", 
 
		// Parámetros de entrada
		"parameterValues": { 
			"NdosFechaInicial": this.get( "NdosFechaInicio" ), 
			"NdosFechaFinal": this.get( "NdosFechaFinContrato" )
		},
 
		// Parámetros de Salida
		"resultParameterNames": [ 
			"NdosCantidadDeMeses"
 
		] 
	}); 
 
	// Ejecuta el proceso
	runProcessRequest.execute(function(response) { 
		// Si OK, actualiza el valor en funcion de la salida
		if (response.isSuccess()) { 
			// Actualiza la cantidad de meses que dura el contrato
			this.set( "NdosMesesDuracionContrato", response.resultParameterValues[ "NdosCantidadDeMeses" ] ); 
 
			// Si el contrato ya tiene importe, cctualiza el importe del Contrato
			if( this.get( "NdosImporteMensualContrato" ) > 0 ) {
				this.set( "NdosMontoContrato", this.get( "NdosImporteMensualContrato" ) * this.get( "NdosMesesDuracionContrato" ) );
				}
 
		} 
	}, this); 
} 

 

This is part of the error, console log

 
       POST https://XXXXXX.creatio.com/0/ServiceModel/ProcessEngineService.svc/RunProcess 400 (Bad Request)
 
all-combined.js?v=8.1.1.3635:41 Error al enviar solicitud 
	estado de respuesta: 400 (Bad Request)
	url de solicitud: ../ServiceModel/ProcessEngineService.svc/RunProcess

Some ideas? please help

 

regards,

 

Julio Falcón

Like 0

Like

3 comments
Best reply

Hi Julio,

 

Just guessing, is "NdosGrupoEconomico" a lookup? The parameter is named with an Id, so assuming it is. If that is the case, you need to get it's value, right now it's sending the entire object from the lookup. 

For example (note, the .value at the end): 

"NdosGrupoEconomicoID": this.get("NdosGrupoEconomico").value

However, if it's possible that the lookup can be blank, might be a good idea to check for that as well.

Ryan

Hi Julio,

 

Just guessing, is "NdosGrupoEconomico" a lookup? The parameter is named with an Id, so assuming it is. If that is the case, you need to get it's value, right now it's sending the entire object from the lookup. 

For example (note, the .value at the end): 

"NdosGrupoEconomicoID": this.get("NdosGrupoEconomico").value

However, if it's possible that the lookup can be blank, might be a good idea to check for that as well.

Ryan

Hello Julio,

 

Can you please share the RunProcess request body (from the network tab in the console)? We can compare it to the successful calls and see the difference. Additionally you need to check if both retrieved values (using this.get getters) are strings.

Ryan Farley,

Thanks Ryan, you are right. Fortunately I had already found my mistake... almost a beginner's mistake :-(

Show all comments