Author |
Message
|
tbt102 |
Posted: Tue Jun 24, 2003 3:01 am Post subject: Sorting a repeating structure. |
|
|
Apprentice
Joined: 21 Apr 2003 Posts: 28
|
Hi All,
I have a message that has a repeating structure. I need to sort the repeating structure on 4 elements before I can begin processing. Also I'm using the CWF layer.
Does WMQI have a built in sort facility?
Thanks in advance for any help. |
|
Back to top |
|
 |
Craig B |
Posted: Tue Jun 24, 2003 3:18 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Unfortunately the WMQI product does not have any kind of sort facility that is built into the product. You can either write your own recursive ESQL procedure or function to perform a bubble sort etc. Or you can implement a user plugin node that can perform a sort on the message tree objects. _________________ Regards
Craig |
|
Back to top |
|
 |
tbt102 |
Posted: Tue Jun 24, 2003 3:48 am Post subject: |
|
|
Apprentice
Joined: 21 Apr 2003 Posts: 28
|
Thanks Craig.
Does anyone have any experience with writing recursive ESQL procedures or functions to perform a sort of any kind?
If so would you please share your experience and or code?
Thanks in advance for any help. |
|
Back to top |
|
 |
drajib |
Posted: Tue Jun 24, 2003 4:47 am Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
Just sharing my views
Sorting is an activity that databases are inherently good at. I'm not sure whether you would gain any kind of performance benefit implementing this within WMQI via recursive eSQL function calls. (I've a hunch that you would need to use EVALs which are dynamic & slow).
Perhaps - introducing a table, inserting records, and ultimately selecting in an ordered manner (Oracle - ORDER BY clause) would be easier in terms of maintenance (Think about if somebody has to change the order in future by modifying eSQL!)
Others, please share your knowledge. |
|
Back to top |
|
 |
shalabh1976 |
Posted: Tue Jun 24, 2003 4:57 am Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Database calls inherently have a performance issue. Also depending on the size of the database you have tuning issues on the database.
Why add an additional component to your ESQL ?
If the no. of records are less it may not be advisable to use a DB, but for sorting a large no. of records I think that this may be a good option.
Does char comparison work in ESQL ? |
|
Back to top |
|
 |
drajib |
Posted: Tue Jun 24, 2003 5:28 am Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
Yes! 'Character's are evaluated lexically within eSQL. Comparing two Character variables should work. However, writing the eSQL code, makes the solution tied to a particular message structure, whereas introducing database makes sorting generic.
Though I believe ultimately the solution would be driven by client environment
Best regards |
|
Back to top |
|
 |
Craig B |
Posted: Tue Jun 24, 2003 5:28 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
You can use recursive function calls in ESQL without using the EVAL statement. However, as a previous append points out there is no string comparison function that can compare two strings alphabetically. Again, you would need to write your own ESQL function to do this and have to code in such issues and mismatch of lengths and none alphanumeric characters. I do have an example of a tree sort that uses numeric data such as account numbers. However, I would consider how often you are going to use this and would investigate the database sort possibility or writing a basic plugin which implements a programming language sort from C or Java. _________________ Regards
Craig |
|
Back to top |
|
 |
|