0

I have to extract data from a config file which is in XML format using BP. I have about 25 tags from where attributes are to be extracted.

The current process I am using is to process the tags in a serial order and this takes probably a minute to extract the contents of the tag of the XML file and store it in variables. The tags pertain to extracting email data, file paths, and ServiceNow work notes and closure logs.

I would like ok if to know if actions can be executed in parallel rather than in serial order to fasten the process.

Any help in this regard would be grateful.

Regards.

NottyHead
  • 181
  • 4
  • 18

2 Answers2

-1

As of this writing, Blue Prism (now v6.5) doesn't support parallel execution in a Process or Object.

You could, hypothetically, design a brand new XML parsing VBO that leverages System.Threading to parse through multiple lines concurrently, but this SO answer lays out exactly why that won't net you any significant performance benefit, and actually may negatively affect total processing time:

[To accomplish this], you need to fully parse the XML, which means you're doing the same amount of work as before on the main thread. The only difference is that you're doing some additional work on the background threads.

esqew
  • 42,425
  • 27
  • 92
  • 132
-1

If your xml has embedded schema, simply doing this in C# code stage might work, in: filepath(text), out: dt(collection):

dt = new DataTable();
dt.ReadXml(filepath);

If it has no schema, then read it into a string and do this, in: xmlstring(text), tableIndex(number)/tableName(text), out:dt (collection):

Dataset ds = new DataSet();
ds.ReadXml(new StringReader(xmlstring));
// read specific DataTable by index
dt = ds.Tables[(int)tableIndex];
// or by name
dt = ds.Tables[tableName];

ds contains Dataset with multiple tables(most likely), so you need to pick one you want to read. Or create a top level dt with name and collection fields and load all this datatables inside it at once.

References are: System.dll, System.Data.dll, System.Xml.dll, System.Data.DataSetExtensions.dll Namespaces: System, System.IO, System.Xml, System.Data, System.Text

Elhana
  • 309
  • 3
  • 9
  • How exactly does this accomplish what the OP is asking for? This doesn't implement any sort of parallel processing of the data. – esqew Sep 27 '19 at 20:58
  • OP is asking to speed things up, my bet is that this will be faster in most cases with a minimum amount of code, unless his xml is huge. Also I assume microsoft dll, which is doing the work is optimized. Using Threading will be much more complicated imo. – Elhana Sep 29 '19 at 00:32