Author |
Message
|
mike_mq |
Posted: Sun Apr 10, 2005 10:02 am Post subject: Query Work Item IDs |
|
|
Centurion
Joined: 17 Oct 2003 Posts: 123
|
I have a requirement to query all the work item ids which are currently in Ready state. I was able to query upto certain limit (but not all) using workflow api
code:
service.queryWorkItems("STATE IN ( READY )","RECEIVED_TIME DESC",new Integer(1000));
When I increase my threshold to 10000, I am getting this error
Error Message :
FMC00817E The result of the query is larger than allowed.
Is there any other way to query work item IDs for my filter ? |
|
Back to top |
|
 |
jmac |
Posted: Sun Apr 10, 2005 11:32 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Mike:
You may be able to increase the number of items returned by playing with the maximum message size, however, this is something I was warned about changing very early in the life of MQWF, so I have always tried to find other ways to do this type of query.
If you are running V3.5 consider doing the query on ActivityInsances instead of workitems. Unless all of your activities are assigned to only 1 user, this should cut the number of ready items down a bit.
Other than that you would have to play with filtering by maybe name or create date, to get the number down.
GOOD LUCK _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
mike_mq |
Posted: Sun Apr 10, 2005 12:01 pm Post subject: |
|
|
Centurion
Joined: 17 Oct 2003 Posts: 123
|
Thanks for the response Jmac,
I did some manipulations on my threshold, I am able to retrieve upto 1700 and when I try with 1750 I am getting the same error (ie, unable to query large number).
I was able to retrieve all the work item ids directly using db2 work_item table, but looks like those are hashed. I got about 4000 IDs back using that query.
The formats are like this:
with API: work item ID is: VwAAAAEBmEYtAAAAAAAAAABX = (1)
with DB2 query from db2 console, the work item ID is: x'000000010193C0150000000000000000' = (2)
Is there any way that I can convert the format from (2) to (1) ? I mean, any APIs available or any other procedures ?
I am using wf 3.4 and DB2 8.1
Thanks, |
|
Back to top |
|
 |
jmac |
Posted: Sun Apr 10, 2005 1:09 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
There is a Java class that is part of the Native Java API that allows you to do some conversions with the Internal ID (i.e DB2 id) to the External ID (i.e MQWF OID). Possibly not what you want, since I don't recall if you can go the other way which, if I am reading your note correctly is what you want to do. However, its all moot, since this is only available with V3.5.
I have found the limit to be in the same neighborhood as you, however, be aware that it is not based on the number of workitems, it is based on the size of the message. Actually, I don't think I have ever gotten over 1700, usually I can get 1500, but in one instance I was only able to get 1250. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
hos |
Posted: Sun Apr 10, 2005 10:50 pm Post subject: |
|
|
Chevalier
Joined: 03 Feb 2002 Posts: 470
|
Mike,
as John already mentioned, there is a limitation of the maximum message size that can be passed between MQWF client and server. Also there is a maximum amount of memory that is allocated for DB queries. Both values can be increased but still this limitation exists. There is a technical newsletter how to use the native Java API to convert an internal ID to an external OID. Have a look at
http://www-1.ibm.com/support/docview.wss?rs=795&context=SSVLA5&dc=DB520&uid=swg21190603
John,
maybe you want to add this link to your collection as this problem seems to be a common one?
Volker: Done Thanks |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Apr 11, 2005 3:27 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi,
I had the same problem a few weeks back and remember posting it here.
As jmac stated, I was a bit apprehensive about touching the Network settings and so set a dummy activity and created a filter to divide the workItems into two activities, based on a filter.
For Example,
User "A" is the single user of both the activities. But i have 10 users in the WAS logging in as "A".
I had to show certain workItems to certain users(WAS) based on a field in the container.
So give a dummy activity "DUMMY" "and that has two output control connectors to two activities "ACT_1" and "ACT_2".
DUMMY --------------FIELD = "1"---------> ACT_1
--------------FIELD = "2"---------> ACT_2
when the field is "1" it will go to that activity (ACT_1) and hence search only that for ur workItems with the same user "A", and the same goes for "2".
This reduces the number of workItems to search and makes the application faster.
It worked for me,hope it works for u too.
NOTE: when ur limit is 1700 it does not get the first 1700 matching workItems, instead, it browses the first 1700 and might return only one matching  |
|
Back to top |
|
 |
mike_mq |
Posted: Mon Apr 11, 2005 4:31 am Post subject: |
|
|
Centurion
Joined: 17 Oct 2003 Posts: 123
|
Thanks guys.
elvis_gn - I wanted to query all workitems in Ready state irrespective of assigned user IDs. So, it may not be possible to change the filter and we have too many users in our mq staff.
hos & Jhon - I will try to implement native java api to convert the work item id format.
I will update you once I resolve this.
Thanks again,
Mike. |
|
Back to top |
|
 |
mike_mq |
Posted: Mon Apr 11, 2005 4:49 am Post subject: |
|
|
Centurion
Joined: 17 Oct 2003 Posts: 123
|
It may not be possible to use native java api with workflow version3.4. Am I right ?
Thanks, |
|
Back to top |
|
 |
hos |
Posted: Tue Apr 12, 2005 12:52 am Post subject: |
|
|
Chevalier
Joined: 03 Feb 2002 Posts: 470
|
If your Java program does nothing else but converting IDs, it should also work for MQWF 3.4 (although not officially supported). |
|
Back to top |
|
 |
jmac |
Posted: Tue Apr 12, 2005 5:42 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Mike:
I just learned something new....
I have some code that I have been using on 3.5 that I will move to my 3.4 system and test later this morning.... I will let you know how it goes. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
jmac |
Posted: Tue Apr 12, 2005 8:34 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Mike:
As Volker indicated the OIDGenerator class from the Native API works just fine with V3.4. The only problem I had with my simple test was that I was using the WorkItem view, which was also new w/V3.5. The ProcessTemplate and ProcessInstance views worked fine. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
mike_mq |
Posted: Wed Apr 13, 2005 7:29 am Post subject: [SOLVED]Query Work Item IDs |
|
|
Centurion
Joined: 17 Oct 2003 Posts: 123
|
Yes John.
It is working with v3.4 with replacing table name from WORK_ITEM_VIEW to WORK_ITEM.
Thanks guys. |
|
Back to top |
|
 |
jmac |
Posted: Wed Apr 13, 2005 7:35 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Mike:
Just FYI... the "views" to the database are docuemented in Chapter 14 of the Programming Guide and in Chapter 8 of the Administration Guide. The benefit of using the published views, is we have docuemented what the columns are used for, whereas, using the table you are working with requires you to "dope out" what the data is. I am not saying I never do what you suggest I just want to ensure that you are aware of the published "views". BTW, the Work Item View was introduced with V3.5.
GOOD LUCK _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
|