public class BpmProcessContentProvider extends BaseFacesSessionBean implements IRefreshableContentProvider, ITransactionalContentProvider, IPageFlowScopeAdapter
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 |
static String |
PROPERTY_PROCESS_ID |
fExpireWithPageFlow
DATA_BINDING_CLIENTS, EMPTY_RESOURCES, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
Constructor and Description |
---|
BpmProcessContentProvider()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
applyChanges()
Persists any changes done to this business process instance
|
void |
cancelChanges()
Reverts all changes made since the last
ITransactionalContentProvider.applyChanges() call. |
void |
delete()
Deletes this business process instance and all associated collaboration tasks.
|
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 business process instance data
|
String |
getProcessID()
Returns business process instance ID
|
Object[] |
getPropertyKeys()
Returns list of properties supported by this content provider.
|
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 |
boolean |
isReadOnly(Object propertyKey)
Returns true if the given property is readonly.
|
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 business process instance ID
|
void |
setValue(Object propertyKey,
Object value)
Sets new value of the given property
|
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
getExpireWithPageFlow, setExpireWithPageFlow
public static final String PROPERTY_PROCESS_ID
public static final String PROPERTY_PROCESS
protected String processID
protected boolean needRefresh
protected boolean autoRefresh
protected IBpmProcessManager processManager
protected IBpmProcess process
public 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 refresh() throws ContentProviderException
IRefreshable
refresh
in interface IRefreshable
ContentProviderException
- if error loading data from the data sourcepublic 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 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 void applyChanges() throws ContentProviderException
applyChanges
in interface ITransactionalContentProvider
ContentProviderException
- if error happens during commitpublic void delete() throws ContentProviderException
ContentProviderException
public void cancelChanges() throws ContentProviderException
ITransactionalContentProvider
Reverts all changes made since the last ITransactionalContentProvider.applyChanges()
call.
cancelChanges
in interface ITransactionalContentProvider
ContentProviderException
public boolean isReadOnly(Object propertyKey) throws ELException, PropertyNotFoundException
IUpdateableContentProvider
Returns true if the given property is readonly. If it is readonly, IUpdateableContentProvider.setValue(Object, Object)
will
definitely fail.
isReadOnly
in interface IUpdateableContentProvider
propertyKey
- property key of type String
or Integer
PropertyNotFoundException
ELException
public void setValue(Object propertyKey, Object value) throws ELException, PropertyNotFoundException
IUpdateableContentProvider
Sets new value of the given property
setValue
in interface IUpdateableContentProvider
propertyKey
- property key of type String
or Integer
value
- new property valuePropertyNotFoundException
- if property is not foundELException
public String getProcessID()
public void setProcessID(String processID)
processID
- public IBpmProcess getProcess() throws ContentProviderException
ContentProviderException
protected void release()
BaseFacesSessionBean
release
in class BaseFacesSessionBean