Issue (View Online)

Key: NXP-649
Issue Type: Improvement Improvement
Status: Resolved Resolved
Priority: Minor Minor
Resolution: Fixed
Assignee: Julien Anguenot
Reporter: Olivier Grisel

Operations

View all
View comments
View history
[PERF] Make the DocumentWorkflowActionsBean a lazy event observer 
Updated: 28/05/07 15:53   Created: 21/02/07 12:15  

The following issue has been resolved as FIXED.

Project: Nuxeo Enterprise Platform 5
Components: Web UI, Workflow
Affects Versions: 5.1 M1
Fix Versions: 5.1 M3

 Description   
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.

This message was automatically generated by Atlassian JIRA Enterprise Edition, Version: 3.7.2-186 - Bug/feature request.
If you think it was sent incorrectly, contact one of this server's administrators.

_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets

Reply via email to