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

Key: NXP-649
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Julien Anguenot
Reporter: Olivier Grisel
Votes: 0
Watchers: 0
Operations

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

[PERF] Make the DocumentWorkflowActionsBean a lazy event observer

Created: 21/02/07 12:15   Updated: 28/05/07 15:53
Component/s: Web UI, Workflow
Affects Version/s: 5.1 M1
Fix Version/s: 5.1 M3

Time Tracking:
Not Specified

Issue Links:
Dependency
 

Resolution Date: 28/05/07 15:53
Require Callback: No
Participants: Florent Guillaume, Julien Anguenot and Olivier Grisel
Date of First Response: 23/02/07 22:37
Tags:


 Description  « Hide
Currently the DocumentWorkflowActionsBean has a bunch of methods that are both factory and event observers to eagerly recompute fields whose values might get obsolete on document selection changed and other events.

For instance:

    @Factory("workflowDocumentFormerReviewCurrentLevel")
    @Observer( { EventNames.DOCUMENT_SELECTION_CHANGED,
            EventNames.WORKFLOW_ENDED, EventNames.WORKFLOW_NEW_STARTED,
            EventNames.WORKFLOW_TASK_STOP, EventNames.WORKFLOW_TASK_REJECTED })
    public void computeWorkflowDocumentFormerReviewCurrentLevel()
            throws WMWorkflowException {
        if (currentItemProcessInstanceId == null) {
            return;
        }
        WAPI wapi = workflowBeansDelegate.getWAPIBean();
        Map<String, Serializable> props = wapi
                .listProcessInstanceAttributes(currentItemProcessInstanceId);
        workflowDocumentFormerReviewCurrentLevel = (Integer) props
                .get(WorkflowConstants.WORKFLOW_FORMER_REVIEW_LEVEL);
    }

This is really costly since those methods are called each time the user navigates to a document even when not looking at the Review tab.

A lazy recomputation strategy should be adopted instead by making the getters recompute obsolete fields (and make them carry the @Factory annotation) when necessary and add new reset* methods that obsolete value on events by nullifying the obsolete field (and make them carry the @Observer annotation).

This can me tricky for fields that are of base-type 'int' that cannot be assigned the null value. Maybe they should be Integer instead. Otherwise a boolean flag can be used to mark obsolation of those fields.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Florent Guillaume - 23/02/07 22:37
Yes int should be replaced with Integer.