History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: NXP-1380
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Julien Anguenot
Reporter: Florent Guillaume
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Nuxeo Enterprise Platform

WAPI needs a method to get all workitems

Created: 24/07/07 14:02   Updated: 10/06/08 02:22
Component/s: Workflow
Affects Version/s: 5.1 M3
Fix Version/s: 5.1.RC

Time Tracking:
Not Specified

Resolution Date: 26/07/07 15:00
Require Callback: No
Participants: Florent Guillaume and Julien Anguenot
Date of First Response: 26/07/07 15:00
Tags:


 Description  « Hide
WAPI needs one or several methods to answer the following use case:
- every night, we need to find all current workflow tasks who have the property "expiration date" earlier than the current date.

To do that, we need to iterate on all tasks instances, but there's currently no method to do that.




 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Julien Anguenot - 26/07/07 15:00
fixed

See WAPISample for an example of how to use it. Only work item due date filter are implemented right now.

http://svn.nuxeo.org/trac/nuxeo/browser/sandbox/nuxeo-api-sample/trunk/src/main/java/org/nuxeo/ecm/sample/workflow/WAPISample.java

>>>

   WAPI wapi = WAPIBusinessDelegate.getWAPI();
    
                Date deadline = new Date();
                WMFilter filter = new WMFilterImpl(
                        WorkflowConstants.WORKFLOW_TASK_PROP_DUE_DATE, WMFilter.LT,
                        deadline);
    
                WMWorkItemIterator it = wapi.listWorkItems(filter);
                System.out.println("Number of items where due date is strictly before now :"
                        + it.size());
                
                filter = new WMFilterImpl(
                        WorkflowConstants.WORKFLOW_TASK_PROP_DUE_DATE, WMFilter.GT,
                        deadline);
                it = wapi.listWorkItems(filter);
                System.out.println("Number of items where due date is strictly after now :"
                        + it.size());