Class WorkItemLifecycleEventUtil


  • public class WorkItemLifecycleEventUtil
    extends Object
    A class for common utility methods related to work item lifecycle events.
    • Constructor Detail

      • WorkItemLifecycleEventUtil

        public WorkItemLifecycleEventUtil()
    • Method Detail

      • publish

        public static void publish​(String workItemUid,
                                   Map<String,​Serializable> details,
                                   WorkItemLifecyclePhase workItemLifecyclePhase,
                                   String lifecycleDetails,
                                   Date sourceTimestamp)
        A convenience method for publishing changes to the work item's lifecycles that creates an instance of WorkItemLifecycleEvent and calls the publish(IWorkItemLifecycleEvent) method
        Parameters:
        workItemUid - a String containing unique identifier for the IWorkItemLifecycleEvent
        details - an Map containing details of the IWorkItemLifecycleEvent
        workItemLifecyclePhase - a WorkItemLifecyclePhase representing the lifecycle event
        lifecycleDetails - a String containing any additional details about the lifecycle event, such as pertinent failure messages
        sourceTimestamp - a Date representing the time the lifecycle change occurred.
      • createEvent

        protected static org.pentaho.platform.api.workitem.IWorkItemLifecycleEvent createEvent​(String workItemUid,
                                                                                               String workItemDetails,
                                                                                               WorkItemLifecyclePhase workItemLifecyclePhase,
                                                                                               String lifecycleDetails,
                                                                                               Date sourceTimestamp)
      • publish

        public static void publish​(org.pentaho.platform.api.workitem.IWorkItemLifecycleEvent workItemLifecycleEvent)
        A convenience method for publishing changes to the work item's lifecycles. Fetches the IWorkItemLifecycleEventPublisher bean, and if available, calls its post method. Otherwise does nothing, as the IWorkItemLifecycleEventPublisher bean may not be available, which is a perfectly valid scenario, if we do not care about publishing IWorkItemLifecycleEvent's.
        Parameters:
        workItemLifecycleEvent - the IWorkItemLifecycleEvent