XML parse error: not well formatted after calling a business process via button

Hi community,

 

I try to trigger a business process that take one argument when I click on a button. When I click on my button the pop-up (as defined in my code below) shows up but I have an error via the console in chrome dev tools.

 

Here is the error that occurs (XML parse error: not well formatted):

 

Here is my schema :

define("ContactSectionV2", ["ProcessModuleUtilities", "ContactSectionV2Resources"], function(ProcessModuleUtilities, resources) {
	return {
		entitySchemaName: "Contact",
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "BtnCreateCandidat",
				"parentName": "CombinedModeActionButtonsCardLeftContainer",
				"propertyName": "items",
				"values": {
					itemType: Terrasoft.ViewItemType.BUTTON,
					style: Terrasoft.controls.ButtonEnums.style.BLUE,
					classes: {
						"textClass": ["actions-button-margin-right"],
						"wrapperClass": ["actions-button-margin-right"]
					},
					click: { bindTo: "OnClickCreateCandidat" },
					tag: "CombinedModeActionButtonsCardLeftContainer",
					caption: { bindTo: "Resources.Strings.BtnCreateCandidatCaption" },
					hint: { bindTo: "Resources.Strings.BtnCreateCandidatHint" },
					enabled: true,
				},
			},
		]/**SCHEMA_DIFF*/,
		methods: {
			OnClickCreateCandidat: function(){
				var contactId = this.getActiveRow().get("Id");
				var args = {
					parameters: {
                        ProcessSchemaContactStr: contactId
                    },
					sysProcessName: "MTF_CreateCandidatIfNotExists",
					callback: function(){
						this.showInformationDialog(contactId);
						return true;
					},
					// scope: this
				};
				ProcessModuleUtilities.executeProcess(args);
				return true;
			},
		}
	};
});

And here is my business process :

 

It takes one argument as input :

 

"parse contactId" is a simple line to transform a string to a Guid :

Guid.Parse([#ContactStr#])

and I set the value returned to the ContactId argument.

 

then I try to read a candidate with the Contact Guid that I just set (a Candidate has a lookup field to a Contact object).

 

It just check if the candidate was found, if not it will create it. The BP returns the Candidate Guid.

 

The business process runs, the Candidate object is created (empty for some reason, not even with the Contact lookup filled) each it needs but I always have the XML parse error.

 

Do you know how can I debut this and how can I resolve this ?

 

Best regards,

 

Julien G.

Like 0

Like

7 comments

Hello Julien,

 

Please find this request in the network tab of the browser and send the complete response to this request. Also what is being written in the server logs?

 

Best regards,

Oscar 

Oscar Dylan,

 

The button send a POST request.

Request (json) :

{
  "collectExecutionData": true,
  "parameterValues": [
    {
      "name": "ProcessSchemaContactStr",
      "value": "afbdee02-d829-4cd6-aef9-74c719e3d169"
    }
  ],
  "schemaName": "MTF_CreateCandidatIfNotExists",
  "resultParameterNames": []
}

and the response (json) :

{
  "processId": "a78bff89-c553-43bc-9d3a-210302be2c25",
  "processStatus": 2,
  "resultParameterValues": null,
  "executionData": null,
  "success": true,
  "errorInfo": null
}

Here is the IIS log when I click my button :

(I replaced Creatio's IP, Creatio's FQDN and my IP address)

2021-10-27 08:30:42 CreatioFQDN POST /0/ServiceModel/ProcessEngineService.svc/RunProcess - 443 julien.gunther myIPAddress Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64;+rv:93.0)+Gecko/20100101+Firefox/93.0 https://CreatioFQDN/0/Nui/ViewModule.aspx 200 0 0 624

I don't have any other logs..

Julien Gunther,

 

This error somehow prevents the data from saving or something is not working in the system when you receive this error to the client-side? If not, please ignore it.

 

Best regards,

Oscar

Oscar Dylan,

This prevents the data from being saved correctly. The newly created object is saved but it is an empty object. No data is saved in the saved object.

 

Another problem is that when I click on this button, a pop-up window appears with the Guid of the selected contact (as specified in the section diagram), then it loads indefinitely. The only way to get out of this state is to reload the page.

 

Best regards,

 

Julien

Julien Gunther,

 

Issues like this are not possible to be solved in the community. Please share the backup of the app if this is deployed locally and provide steps to reproduce the problem in the email sent to support@creatio.com and I will take a look.

 

Best regards,

Oscar

Julien Gunther,



Could you go to the process library, select your business process and click the property. In the open page, check the "Trace enabled" option. 

 

After that, you can find the trace log in the business process log. From there, you can check what is the parameter value and if the value is correct or not before/after the certain step.

 

According to what you described, it sounds like the contactId parameter is not setup correctly. So it is important to ensure the contactId after your Guid.Parse is correct.

 

On the other hand, have tried to set the contactId directly from button click scripts?

 

regards,

 

Cheng Gong

Cheng Gong,

 

Sorry for my late reply,



I checked the trace, the contactId has been defined successfully. I have no trace for the formulas, only for "Create Candidate" and "Try Read Candidate".

 

Try Read Candidat trace :

{
	"Paramètres de l'élément": [
		{
			"Paramètre": "Sources de données des filtres",
			"Valeur": {
				"Avant exécution": "{\"className\":\"Terrasoft.FilterGroup\",\"serializedFilterEditData\":\"{\\\"className\\\":\\\"Terrasoft.FilterGroup\\\",\\\"items\\\":{\\\"c46e04a9-f961-4607-8585-9eb58c49d628\\\":{\\\"className\\\":\\\"Terrasoft.InFilter\\\",\\\"filterType\\\":4,\\\"comparisonType\\\":3,\\\"isEnabled\\\":true,\\\"trimDateTimeParameterToDate\\\":false,\\\"leftExpression\\\":{\\\"className\\\":\\\"Terrasoft.ColumnExpression\\\",\\\"expressionType\\\":0,\\\"columnPath\\\":\\\"MTFContactCandidat\\\"},\\\"isAggregative\\\":false,\\\"key\\\":\\\"c46e04a9-f961-4607-8585-9eb58c49d628\\\",\\\"dataValueType\\\":10,\\\"leftExpressionCaption\\\":\\\"Candidat\\\",\\\"referenceSchemaName\\\":\\\"Contact\\\",\\\"rightExpressions\\\":[{\\\"className\\\":\\\"Terrasoft.ParameterExpression\\\",\\\"expressionType\\\":2,\\\"parameter\\\":{\\\"className\\\":\\\"Terrasoft.Parameter\\\",\\\"dataValueType\\\":26,\\\"value\\\":{\\\"value\\\":\\\"[IsOwnerSchema:false].[IsSchema:false].[Parameter:{e8e60615-91be-40a0-a225-2922d2a98f23}]\\\",\\\"displayValue\\\":\\\"ContactId\\\",\\\"Id\\\":\\\"e2c00489-34d4-4d18-a703-39f3c30e7543\\\"}}}]}},\\\"logicalOperation\\\":0,\\\"isEnabled\\\":true,\\\"filterType\\\":6,\\\"rootSchemaName\\\":\\\"MTF_Candidat\\\",\\\"key\\\":\\\"\\\"}\",\"dataSourceFilters\":\"{\\\"items\\\":{\\\"c46e04a9-f961-4607-8585-9eb58c49d628\\\":{\\\"filterType\\\":4,\\\"comparisonType\\\":3,\\\"isEnabled\\\":true,\\\"trimDateTimeParameterToDate\\\":false,\\\"leftExpression\\\":{\\\"expressionType\\\":0,\\\"columnPath\\\":\\\"MTFContactCandidat\\\"},\\\"rightExpressions\\\":[{\\\"expressionType\\\":2,\\\"parameter\\\":{\\\"dataValueType\\\":26,\\\"value\\\":{\\\"value\\\":\\\"[IsOwnerSchema:false].[IsSchema:false].[Parameter:{e8e60615-91be-40a0-a225-2922d2a98f23}]\\\",\\\"Id\\\":\\\"e2c00489-34d4-4d18-a703-39f3c30e7543\\\"}}}]}},\\\"logicalOperation\\\":0,\\\"isEnabled\\\":true,\\\"filterType\\\":6,\\\"rootSchemaName\\\":\\\"MTF_Candidat\\\"}\"}",
				"Après exécution": "{\"className\":\"Terrasoft.FilterGroup\",\"serializedFilterEditData\":\"{\\\"className\\\":\\\"Terrasoft.FilterGroup\\\",\\\"items\\\":{\\\"c46e04a9-f961-4607-8585-9eb58c49d628\\\":{\\\"className\\\":\\\"Terrasoft.InFilter\\\",\\\"filterType\\\":4,\\\"comparisonType\\\":3,\\\"isEnabled\\\":true,\\\"trimDateTimeParameterToDate\\\":false,\\\"leftExpression\\\":{\\\"className\\\":\\\"Terrasoft.ColumnExpression\\\",\\\"expressionType\\\":0,\\\"columnPath\\\":\\\"MTFContactCandidat\\\"},\\\"isAggregative\\\":false,\\\"key\\\":\\\"c46e04a9-f961-4607-8585-9eb58c49d628\\\",\\\"dataValueType\\\":10,\\\"leftExpressionCaption\\\":\\\"Candidat\\\",\\\"referenceSchemaName\\\":\\\"Contact\\\",\\\"rightExpressions\\\":[{\\\"className\\\":\\\"Terrasoft.ParameterExpression\\\",\\\"expressionType\\\":2,\\\"parameter\\\":{\\\"className\\\":\\\"Terrasoft.Parameter\\\",\\\"dataValueType\\\":26,\\\"value\\\":{\\\"value\\\":\\\"[IsOwnerSchema:false].[IsSchema:false].[Parameter:{e8e60615-91be-40a0-a225-2922d2a98f23}]\\\",\\\"displayValue\\\":\\\"ContactId\\\",\\\"Id\\\":\\\"e2c00489-34d4-4d18-a703-39f3c30e7543\\\"}}}]}},\\\"logicalOperation\\\":0,\\\"isEnabled\\\":true,\\\"filterType\\\":6,\\\"rootSchemaName\\\":\\\"MTF_Candidat\\\",\\\"key\\\":\\\"\\\"}\",\"dataSourceFilters\":\"{\\\"items\\\":{\\\"c46e04a9-f961-4607-8585-9eb58c49d628\\\":{\\\"filterType\\\":4,\\\"comparisonType\\\":3,\\\"isEnabled\\\":true,\\\"trimDateTimeParameterToDate\\\":false,\\\"leftExpression\\\":{\\\"expressionType\\\":0,\\\"columnPath\\\":\\\"MTFContactCandidat\\\"},\\\"rightExpressions\\\":[{\\\"expressionType\\\":2,\\\"parameter\\\":{\\\"dataValueType\\\":26,\\\"value\\\":{\\\"value\\\":\\\"[IsOwnerSchema:false].[IsSchema:false].[Parameter:{e8e60615-91be-40a0-a225-2922d2a98f23}]\\\",\\\"Id\\\":\\\"e2c00489-34d4-4d18-a703-39f3c30e7543\\\"}}}]}},\\\"logicalOperation\\\":0,\\\"isEnabled\\\":true,\\\"filterType\\\":6,\\\"rootSchemaName\\\":\\\"MTF_Candidat\\\"}\"}"
			}
		},
		{
			"Paramètre": "Lire d'abord",
			"Valeur": {
				"Avant exécution": true,
				"Après exécution": true
			}
		},
		{
			"Paramètre": "Ordre des colonnes",
			"Valeur": {
				"Avant exécution": "Name:1:1",
				"Après exécution": "Name:1:1"
			}
		},
		{
			"Paramètre": "Premier élément de la collection résultante",
			"Valeur": {
				"Avant exécution": {},
				"Après exécution": {}
			}
		},
		{
			"Paramètre": "Lire les données non validées",
			"Valeur": {
				"Avant exécution": true,
				"Après exécution": true
			}
		},
		{
			"Paramètre": "Considérez l'heure dans le filtre",
			"Valeur": {
				"Avant exécution": true,
				"Après exécution": true
			}
		}
	],
	"Paramètres du processus": [
		{
			"Paramètre": "Candidat",
			"Valeur": {
				"Avant exécution": "00000000-0000-0000-0000-000000000000",
				"Après exécution": "00000000-0000-0000-0000-000000000000"
			}
		},
		{
			"Paramètre": "ContactId",
			"Valeur": {
				"Avant exécution": "42a4317d-1712-41b2-994c-11b6fc64b199",
				"Après exécution": "42a4317d-1712-41b2-994c-11b6fc64b199"
			}
		},
		{
			"Paramètre": "ContactStr",
			"Valeur": {
				"Avant exécution": "42a4317d-1712-41b2-994c-11b6fc64b199",
				"Après exécution": "42a4317d-1712-41b2-994c-11b6fc64b199"
			}
		}
	]
}

 

Create Candidat Trace :

{
	"Paramètres de l'élément": [
		{
			"Paramètre": "Objet",
			"Valeur": {
				"Avant exécution": "106e3cde-5534-4cac-a87d-37c23359b9ef",
				"Après exécution": "106e3cde-5534-4cac-a87d-37c23359b9ef"
			}
		},
		{
			"Paramètre": "Filtres des sources de données",
			"Valeur": {
				"Avant exécution": "",
				"Après exécution": ""
			}
		},
		{
			"Paramètre": "Module d'ajout d'enregistrement",
			"Valeur": {
				"Avant exécution": "0",
				"Après exécution": "0"
			}
		},
		{
			"Paramètre": "Objet",
			"Valeur": {
				"Avant exécution": "00000000-0000-0000-0000-000000000000",
				"Après exécution": "00000000-0000-0000-0000-000000000000"
			}
		},
		{
			"Paramètre": "Définir la valeur des colonnes",
			"Valeur": {
				"Avant exécution": {
					"Values": {
						"b8993e82-0840-410a-82a7-386a3295755c": "00000000-0000-0000-0000-000000000000"
					},
					"FetchMetaPathes": {}
				},
				"Après exécution": {
					"Values": {
						"b8993e82-0840-410a-82a7-386a3295755c": "00000000-0000-0000-0000-000000000000"
					},
					"FetchMetaPathes": {}
				}
			}
		},
		{
			"Paramètre": "L'Id de l'enregistrement a été créé",
			"Valeur": {
				"Avant exécution": "00000000-0000-0000-0000-000000000000",
				"Après exécution": "3bb08bf6-abc8-4385-9b99-957c2aaa6d8c"
			}
		},
		{
			"Paramètre": "Considérez l'heure dans le filtre",
			"Valeur": {
				"Avant exécution": true,
				"Après exécution": true
			}
		}
	],
	"Paramètres du processus": [
		{
			"Paramètre": "Candidat",
			"Valeur": {
				"Avant exécution": "00000000-0000-0000-0000-000000000000",
				"Après exécution": "00000000-0000-0000-0000-000000000000"
			}
		},
		{
			"Paramètre": "ContactId",
			"Valeur": {
				"Avant exécution": "42a4317d-1712-41b2-994c-11b6fc64b199",
				"Après exécution": "42a4317d-1712-41b2-994c-11b6fc64b199"
			}
		},
		{
			"Paramètre": "ContactStr",
			"Valeur": {
				"Avant exécution": "42a4317d-1712-41b2-994c-11b6fc64b199",
				"Après exécution": "42a4317d-1712-41b2-994c-11b6fc64b199"
			}
		}
	]
}

 

As you can see, the ContactStr parameter was successfully parsed into a Guid object.



I have no errors and, according to the trace, my Candidate object was created successfully.



When I click on the button, it gives me the contact ID in a string, that's why I had to convert it into a Guid.



Best regards,



Julien

Show all comments