public class BpmProcessStepContentProvider extends BaseFacesSessionBean implements IRefreshableContentProvider
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoRefresh |
protected boolean |
needRefresh |
protected IBpmProcess |
process |
protected String |
processID |
protected IBpmProcessManager |
processManager |
static String |
PROPERTY_PROCESS_ID |
static String |
PROPERTY_STEP |
static String |
PROPERTY_STEP_ID |
protected IBpmProcessStep |
step |
protected String |
stepID |
fExpireWithPageFlow
DATA_BINDING_CLIENTS, EMPTY_RESOURCES, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
Constructor and Description |
---|
BpmProcessStepContentProvider()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
List<IBpmProcessError> |
getErrors()
Convenience method to return list of step errors
|
boolean |
getHasErrors()
Convenience method which determines if step has errors
|
String |
getName()
Convenient method to return a step name or "Unknown" if name is not set
|
boolean |
getNeedRefresh()
Returns
true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from
the data source by executing IRefreshable.refresh() method. |
IBpmProcess |
getProcess()
Returns data for process instance owning this step
|
String |
getProcessID()
Returns process instance ID
|
protected IBpmProcessManager |
getProcessManager() |
Object[] |
getPropertyKeys()
Returns list of properties supported by this content provider.
|
protected static String |
getResource(String key) |
protected static String |
getResource(String key,
Object[] args) |
int |
getStatus()
Convenience method to return step status value or -1 if step can not be found
|
String |
getStatusDisplayName()
Convenience method to return step status display (friendly) name according to the current user locale
|
IBpmProcessStep |
getStep()
Returns step data
|
String |
getStepID()
Returns step ID
|
SelectItem[] |
getStepStatusItems()
Convenience method which returns step statuses as array of SelectItems to be used in dropdown controls
|
Map<Integer,String> |
getStepStatusMap()
Convenience method which returns step statuses and their display names using current user locale as Map
|
Class<?> |
getType(Object propertyKey)
Returns java type of the given property
|
Object |
getValue(Object propertyKey)
Returns value of the given property
|
boolean |
hasProperty(Object propertyKey)
Checks if the given property is supported by this content provider
|
boolean |
isAutoRefresh()
Returns
true if the provider is currenlty in auto-refresh mode |
void |
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 via
IContentProvider.getValue(Object) . |
void |
setProcessID(String processID)
Sets process instance ID
|
void |
setStepID(String stepID)
Sets step ID in the process instance
|
boolean |
supportsAutoRefresh()
Returns true if this content provider supports auto refresh feature.
|
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
public static final String PROPERTY_PROCESS_ID
public static final String PROPERTY_STEP_ID
public static final String PROPERTY_STEP
protected String processID
protected String stepID
protected IBpmProcessManager processManager
protected IBpmProcess process
protected IBpmProcessStep step
protected boolean needRefresh
protected boolean autoRefresh
public BpmProcessStepContentProvider()
public Object[] getPropertyKeys()
IContentProvider
Object[0]
,
never null.getPropertyKeys
in interface IContentProvider
String
or Integer
public Class<?> getType(Object propertyKey) throws PropertyNotFoundException
IContentProvider
getType
in interface IContentProvider
propertyKey
- the property key of type String
or Integer
Class
PropertyNotFoundException
- if property is not supportedpublic Object getValue(Object propertyKey) throws ELException, PropertyNotFoundException
IContentProvider
getValue
in interface IContentProvider
propertyKey
- the property key of type String
or Integer
null
PropertyNotFoundException
- if property is not supportedELException
public boolean hasProperty(Object propertyKey)
IContentProvider
hasProperty
in interface IContentProvider
propertyKey
- property key of type String
or Integer
true
if property is supportedpublic boolean getNeedRefresh()
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.
getNeedRefresh
in interface IRefreshable
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.public boolean isAutoRefresh()
IRefreshable
true
if the provider is currenlty in auto-refresh modeisAutoRefresh
in interface IRefreshable
public void setAutoRefresh(boolean autorefresh) throws ContentProviderException
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.
setAutoRefresh
in interface IRefreshable
autorefresh
- true to turn it onContentProviderException
- if auto refresh mode is not supportedIRefreshable.supportsAutoRefresh()
,
IRefreshable.getNeedRefresh()
,
IRefreshable.setNeedRefresh(boolean)
public void setNeedRefresh(boolean needRefresh)
IRefreshable
IContentProvider.getValue(Object)
.setNeedRefresh
in interface IRefreshable
needRefresh
- true
if the input parameters have changedpublic boolean supportsAutoRefresh()
IRefreshable
supportsAutoRefresh
in interface IRefreshable
IRefreshable.setAutoRefresh(boolean)
public void refresh() throws ContentProviderException
IRefreshable
refresh
in interface IRefreshable
ContentProviderException
- if error loading data from the data sourcepublic String getProcessID()
public void setProcessID(String processID)
protected IBpmProcessManager getProcessManager()
public IBpmProcess getProcess() throws ContentProviderException
ContentProviderException
public IBpmProcessStep getStep() throws ContentProviderException
ContentProviderException
public void setStepID(String stepID)
public String getStepID()
public String getName()
public int getStatus()
public String getStatusDisplayName()
public List<IBpmProcessError> getErrors()
public boolean getHasErrors()
public SelectItem[] getStepStatusItems()
public Map<Integer,String> getStepStatusMap()
protected void release()
BaseFacesSessionBean
release
in class BaseFacesSessionBean