Class BpmProcessStepContentProvider
java.lang.Object
com.webmethods.caf.faces.bean.BaseFacesBean
com.webmethods.caf.faces.bean.BaseFacesSessionBean
com.webmethods.caf.faces.data.bpm.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 Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected boolean
protected IBpmProcess
protected String
protected IBpmProcessManager
static final String
static final String
static final String
protected IBpmProcessStep
protected String
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
fExpireWithPageFlow
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
DATA_BINDING_CLIENTS, EMPTY_RESOURCES, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConvenience method to return list of step errorsboolean
Convenience method which determines if step has errorsgetName()
Convenient method to return a step name or "Unknown" if name is not setboolean
Returnstrue
whenIRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from the data source by executingIRefreshable.refresh()
method.Returns data for process instance owning this stepReturns process instance IDprotected IBpmProcessManager
Object[]
Returns list of properties supported by this content provider.protected static String
getResource
(String key) protected static String
getResource
(String key, Object[] args) int
Convenience method to return step status value or -1 if step can not be foundConvenience method to return step status display (friendly) name according to the current user localegetStep()
Returns step dataReturns step IDConvenience method which returns step statuses as array of SelectItems to be used in dropdown controlsConvenience method which returns step statuses and their display names using current user locale as MapClass<?>
Returns java type of the given propertyReturns value of the given propertyboolean
hasProperty
(Object propertyKey) Checks if the given property is supported by this content providerboolean
Returnstrue
if the provider is currenlty in auto-refresh modevoid
refresh()
(Re)loads data from the data source.protected void
release()
Override this method to release any resources associated with this session.void
setAutoRefresh
(boolean autorefresh) Sets auto refresh mode on.void
setNeedRefresh
(boolean needRefresh) 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 viaIContentProvider.getValue(Object)
.void
setProcessID
(String processID) Sets process instance IDvoid
Sets step ID in the process instanceboolean
Returns true if this content provider supports auto refresh feature.Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
createMethodBinding, createMethodExpression, createValueBinding, createValueExpression, createValueExpression, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.webmethods.caf.faces.data.IContentProvider
toString
-
Field Details
-
PROPERTY_PROCESS_ID
- See Also:
-
PROPERTY_STEP_ID
- See Also:
-
PROPERTY_STEP
- See Also:
-
processID
-
stepID
-
processManager
-
process
-
step
-
needRefresh
protected boolean needRefresh -
autoRefresh
protected boolean autoRefresh
-
-
Constructor Details
-
BpmProcessStepContentProvider
public BpmProcessStepContentProvider()Default constructor
-
-
Method Details
-
getPropertyKeys
Description copied from interface:IContentProvider
Returns list of properties supported by this content provider. Can returnObject[0]
, never null.- Specified by:
getPropertyKeys
in interfaceIContentProvider
- Returns:
- array of property keys which is typically of type
String
orInteger
-
getType
Description copied from interface:IContentProvider
Returns java type of the given property- Specified by:
getType
in interfaceIContentProvider
- Parameters:
propertyKey
- the property key of typeString
orInteger
- Returns:
- property java
Class
- Throws:
PropertyNotFoundException
- if property is not supported
-
getValue
Description copied from interface:IContentProvider
Returns value of the given property- Specified by:
getValue
in interfaceIContentProvider
- Parameters:
propertyKey
- the property key of typeString
orInteger
- Returns:
- value of the property, can be
null
- Throws:
PropertyNotFoundException
- if property is not supportedELException
-
hasProperty
Description copied from interface:IContentProvider
Checks if the given property is supported by this content provider- Specified by:
hasProperty
in interfaceIContentProvider
- Parameters:
propertyKey
- property key of typeString
orInteger
- Returns:
true
if property is supported
-
getNeedRefresh
public boolean getNeedRefresh()Description copied from interface:IRefreshable
Returns
true
whenIRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from the data source by executingIRefreshable.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 interfaceIRefreshable
- 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
Returnstrue
if the provider is currenlty in auto-refresh mode- Specified by:
isAutoRefresh
in interfaceIRefreshable
- Returns:
- false if auto-refresh mode is off or not supported
-
setAutoRefresh
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 returnstrue
, the provider callsIRefreshable.refresh()
method to updated the result properties.- Specified by:
setAutoRefresh
in interfaceIRefreshable
- 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 viaIContentProvider.getValue(Object)
.- Specified by:
setNeedRefresh
in interfaceIRefreshable
- 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 interfaceIRefreshable
- Returns:
- true when auto refresh is supported
- See Also:
-
refresh
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 interfaceIRefreshable
- Throws:
ContentProviderException
- if error loading data from the data source
-
getProcessID
Returns process instance ID -
setProcessID
Sets process instance ID -
getProcessManager
-
getProcess
Returns data for process instance owning this step- Throws:
ContentProviderException
-
getStep
Returns step data- Throws:
ContentProviderException
-
setStepID
Sets step ID in the process instance -
getStepID
Returns step ID -
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
Convenience method to return step status display (friendly) name according to the current user locale -
getErrors
Convenience method to return list of step errors -
getHasErrors
public boolean getHasErrors()Convenience method which determines if step has errors -
getStepStatusItems
Convenience method which returns step statuses as array of SelectItems to be used in dropdown controls -
getStepStatusMap
Convenience method which returns step statuses and their display names using current user locale as Map -
getResource
-
getResource
-
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 classBaseFacesSessionBean
-