2

A friend of mine with little experience in (Telelogic Doors) DXL was given a problem to search through a document for objects with possible matches of string.

The problem was :

We have 2 attributes: Severity and Likelihood

Please see the table below for their values:

enter image description here

Edit added (Sample):
A sample document looks as follows

enter image description here

2) So now if I have a combination like Severity = Negligible AND Likelihood = Improbable, then I want to parse through the document and then try to find all the objects that have these values and display the total number of objects.

3) Then I move to the next combination ex: Severity = Minor Injury AND Likelihood = Unlikely and then display the total objects for this combination.

4) So now I go through all the 25 combinations and display the total for each combination.

Trouble is I have no experience of DXL . I know how to do it in C/C++ but not in DXL.

Need a DXL based solution to above.

Amitd
  • 4,769
  • 8
  • 56
  • 82
  • added sample document(2nd pic). Need to get count of all possible commbinations in doc. hope its more cleared now. – Amitd Jul 19 '11 at 14:59
  • As Ken points out in his answer, it doesn't really make sense to talk about doing it in DXL to the exclusion of everything else. You can't perform any logical operations with DXL, rather you use DXL to import and export data and design elements into and out of the database. You can also use it as a means to manipulate the data from agents running in the database rather than using other parts of the API. So when you say you need a DXL based solution, what does that mean? – Kerr Jul 19 '11 at 20:32
  • just need to compare values and dispay the counts for each combination using dxl script. – Amitd Jul 22 '11 at 10:53
  • What is DXL 'Script'? DXL is a just a representation of the database design and data in xml. There is no script. – Kerr Jul 25 '11 at 13:11

4 Answers4

1

I know I am a bit late to the party here but what you are looking for is this:

First save your input file as a csv.

Module m = current
Object o
Stream infile = read("PathToYourCsvFile")
string inline = ""
infile >> inline

while(!end(infile))
{
  string Severity = ""
  string Likelihood = ""

  // Here do some code to get the values from the line in the csv
  // If you still are interested I can add this in with an update later.


  for o in m do
  {
    if((o."Severity" "" == Severity) && (o."Likelihood" "" == Likelihood))
    {
      count++;
    }
  }
  infoBox "Severity = " Severity " and Likelihood = " Likelihood " MATCHES: " count ""
}

This will pop up a box after each line is calculated with the number of matches found. You can easily have it just popup one box at the end with all of the matches if you wanted. Again if you are still interested, give me some more info on what you want for inputs and outputs and I can give you more accurate code.

Steve Valliere
  • 1,882
  • 12
  • 31
  • Just a brief note on performance: If your module is large, it saves a lot of time to iterate through the module (`for o in m do`) only once and cache all the Severity and Likelihood values in Skip lists. Then perform the counting by looping over those Skip lists. (It is harder to code, though, because you need to handle two or more Skip lists.) – Malte Aug 30 '16 at 12:06
1

Must you do this in DXL? It may be much easier to do this another way. For example, depending on how the documents are structured, you might be able to create a view categorized by severity and likelihood, and then present totals for each category.

Or you could export the data and calculate the totals easily using a spreadsheet.

UPDATE: DXL is merely a XML format that applies to Domino. So once you have a database in DXL format, you can parse it like any other XML document using C/C++ if you're most comfortable with that. The key to this task, then, is to get the database into a DXL format.

With the Lotus Notes C/C++ API you can create a DXLExport from a NotesSession object, and call into the DXLExporter class to perform the export (excuse me if I'm messing up the object names - I'm used to LotusScript mainly).

Another option that could work for you is to use this DXLExporter Wizard for Domino 8.5. That will take the work out of creating the DXL and you can focus on parsing it instead.

Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63
1

This has nothing to do with Domino DXL, but everything with Telelogic Doors eXtension Language. The documentation: http://publib.boulder.ibm.com/infocenter/rsdp/v1r0m0/index.jsp?topic=/com.ibm.help.download.doors.doc/topics/doors_version9_1.html

Suggestion: remove the lotus-notes tag.

D.Bugger
  • 2,300
  • 15
  • 19
1

Amitd, the most straight-forward path is to create a view with object heading, object text, severity, likelihood, and any other relevant attributes; then perfom the basic export to Excel. Once in Excel, we'll manipulate the data as required.

Open the exported document, and sort by Severity, then Likelihood. Create the aggregate calculations using the Excel built-in functions: COUNTIF, and Data > GROUP and Data > SUBTOTAL options. You may then sort on the aggregate totals, or filter on the attributes for different combinations.

FYI - DXL is DOORS eXtension Language--nothing to do with Domino.

Community
  • 1
  • 1
MAbraham1
  • 1,717
  • 4
  • 28
  • 45