Class BpmProcessStepContentProvider

All Implemented Interfaces:
IPageFlowScopeAdapter, IContentProvider, IRefreshable, IRefreshableContentProvider, EventListener, HttpSessionBindingListener

public class BpmProcessStepContentProvider extends BaseFacesSessionBean implements IRefreshableContentProvider
Content provider which implements access to ad-hoc process instance step (read-only)
  • Field Details

  • Constructor Details

    • BpmProcessStepContentProvider

      public BpmProcessStepContentProvider()
      Default constructor
  • Method Details

    • getPropertyKeys

      public Object[] getPropertyKeys()
      Description copied from interface: IContentProvider
      Returns list of properties supported by this content provider. Can return Object[0], never null.
      Specified by:
      getPropertyKeys in interface IContentProvider
      Returns:
      array of property keys which is typically of type String or Integer
    • getType

      public Class<?> getType(Object propertyKey) throws PropertyNotFoundException
      Description copied from interface: IContentProvider
      Returns java type of the given property
      Specified by:
      getType in interface IContentProvider
      Parameters:
      propertyKey - the property key of type String or Integer
      Returns:
      property java Class
      Throws:
      PropertyNotFoundException - if property is not supported
    • getValue

      public Object getValue(Object propertyKey) throws ELException, PropertyNotFoundException
      Description copied from interface: IContentProvider
      Returns value of the given property
      Specified by:
      getValue in interface IContentProvider
      Parameters:
      propertyKey - the property key of type String or Integer
      Returns:
      value of the property, can be null
      Throws:
      PropertyNotFoundException - if property is not supported
      ELException
    • hasProperty

      public boolean hasProperty(Object propertyKey)
      Description copied from interface: IContentProvider
      Checks if the given property is supported by this content provider
      Specified by:
      hasProperty in interface IContentProvider
      Parameters:
      propertyKey - property key of type String or Integer
      Returns:
      true if property is supported
    • getNeedRefresh

      public boolean getNeedRefresh()
      Description copied from interface: IRefreshable

      Returns true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from the data source by executing IRefreshable.refresh() method.

      Implementations may return an accurate value from this method if they can track the changes to the input parameter properties or they may require the clients to call IRefreshable.setNeedRefresh(boolean) explicitely.

      Specified by:
      getNeedRefresh in interface IRefreshable
      Returns:
      true when the output properties are not up-to-date with the current input parameters, i.e. IRefreshable.refresh() needs to be executed manually or automatically.
    • isAutoRefresh

      public boolean isAutoRefresh()
      Description copied from interface: IRefreshable
      Returns true if the provider is currenlty in auto-refresh mode
      Specified by:
      isAutoRefresh in interface IRefreshable
      Returns:
      false if auto-refresh mode is off or not supported
    • setAutoRefresh

      public void setAutoRefresh(boolean autorefresh) throws ContentProviderException
      Description copied from interface: IRefreshable

      Sets auto refresh mode on. When auto refresh mode is on, the provider calls IRefreshable.getNeedRefresh() to determine whether the refresh needs to be done before returning any result properties. If it returns true, the provider calls IRefreshable.refresh() method to updated the result properties.

      Specified by:
      setAutoRefresh in interface IRefreshable
      Parameters:
      autorefresh - true to turn it on
      Throws:
      ContentProviderException - if auto refresh mode is not supported
      See Also:
    • setNeedRefresh

      public void setNeedRefresh(boolean needRefresh)
      Description copied from interface: IRefreshable
      Tells the provider that the input parameters have changed and the output results need to be refreshed the next time any output property is requested via IContentProvider.getValue(Object).
      Specified by:
      setNeedRefresh in interface IRefreshable
      Parameters:
      needRefresh - true if the input parameters have changed
    • supportsAutoRefresh

      public boolean supportsAutoRefresh()
      Description copied from interface: IRefreshable
      Returns true if this content provider supports auto refresh feature.
      Specified by:
      supportsAutoRefresh in interface IRefreshable
      Returns:
      true when auto refresh is supported
      See Also:
    • refresh

      public void refresh() throws ContentProviderException
      Description copied from interface: IRefreshable
      (Re)loads data from the data source. Implementation specific meaning can be executing a SQL query or a web service call. All current data will be lost and updated with the new results if successful.
      Specified by:
      refresh in interface IRefreshable
      Throws:
      ContentProviderException - if error loading data from the data source
    • getProcessID

      public String getProcessID()
      Returns process instance ID
    • setProcessID

      public void setProcessID(String processID)
      Sets process instance ID
    • getProcessManager

      protected IBpmProcessManager getProcessManager()
    • getProcess

      public IBpmProcess getProcess() throws ContentProviderException
      Returns data for process instance owning this step
      Throws:
      ContentProviderException
    • getStep

      public IBpmProcessStep getStep() throws ContentProviderException
      Returns step data
      Throws:
      ContentProviderException
    • setStepID

      public void setStepID(String stepID)
      Sets step ID in the process instance
    • getStepID

      public String getStepID()
      Returns step ID
    • getName

      public String getName()
      Convenient method to return a step name or "Unknown" if name is not set
    • getStatus

      public int getStatus()
      Convenience method to return step status value or -1 if step can not be found
    • getStatusDisplayName

      public String getStatusDisplayName()
      Convenience method to return step status display (friendly) name according to the current user locale
    • getErrors

      public List<IBpmProcessError> getErrors()
      Convenience method to return list of step errors
    • getHasErrors

      public boolean getHasErrors()
      Convenience method which determines if step has errors
    • getStepStatusItems

      public SelectItem[] getStepStatusItems()
      Convenience method which returns step statuses as array of SelectItems to be used in dropdown controls
    • getStepStatusMap

      public Map<Integer,String> getStepStatusMap()
      Convenience method which returns step statuses and their display names using current user locale as Map
    • getResource

      protected static String getResource(String key)
    • getResource

      protected static String getResource(String key, Object[] args)
    • release

      protected void release()
      Description copied from class: BaseFacesSessionBean
      Override this method to release any resources associated with this session. Please note, the FacesContext is not valid for this function
      Specified by:
      release in class BaseFacesSessionBean