Interface IElementPropertiesBean<TData,TElement extends IWorkflowElementEntity>

Type Parameters:
TData - Type of the properties model. Serialized and deserialized via JSON. When this is set to JSONObject, no serialization is performed and you can work with the raw data directly.
TElement - Type of the workflow element, i.e. a node or trigger.
All Superinterfaces:
Serializable
All Known Subinterfaces:
INodePropertiesBean<TData>, INodePropertyPluginBean<TData>, ITriggerPropertiesBean<TData>, ITriggerPropertyPluginBean<TData>
All Known Implementing Classes:
FcChangeStateBean, FcDoiInitBean, FcEmailBean, FcLdapQueryBean, FcMultipleConditionBean, FcRedirectBean, FcSaveToWebDavBean, FcSqlStatementBean, FcStateTimerBean, FcSwitchCaseBean, FcTimePointBean

public interface IElementPropertiesBean<TData,TElement extends IWorkflowElementEntity> extends Serializable
The interface of a bean for editing the properties of workflow elements. Each workflow element has got a type, and for each type a handler is registered. Each workflow element handler may use a different bean.

When a workflow element is selected and the properties panel needs to be initialized, prepareViewForElement(IElementPropInitParams) is called with the selected workflow element and the properties model of that workflow element. The default implementation of that method does nothing. If necessary, you can override that method and store a reference to the properties model.

When the properties panel is unloaded (such as when a different workflow element is selected, or the workflow is about to be saved), retrieveCurrentProperties(Object) is called. That method is passed the same properties model that was passed to prepareViewForElement(IElementPropInitParams). If you did not create a new instance, you can just return that value.

By default, the properties model is available to the XHTML page via the variable model. If you do not need any custom logic, you do not have to create bean class.

Since:
7.0.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • prepareViewForElement

      default void prepareViewForElement(IElementPropInitParams<TData> params) throws Exception
      Called each time when the properties panel for a certain workflow element is loaded. This method is passed the workflow element and the properties model, and should perform whatever initialization is necessary in order for the user to start editing the properties.
      Parameters:
      params - The current element to be edited and its properties. You may store a reference to these, modify them, and return them when retrieveCurrentProperties(Object) is called.
      Throws:
      Exception - When the initialization failed. If an exception is thrown, the user is shown an error indicating that the properties cannot be edited.
    • retrieveCurrentProperties

      IRetrieveElementPropsRetVal<TData> retrieveCurrentProperties(TData storedModel)
      Called each time the data that is currently being edited needs to be retrieved, and possibly persisted. Usually this is called when the user switch to another workflow element, or when the

      Note, however, that you may not assume the editing process for the current workflow element is done. The data is sometimes retrieved while the user is still editing the properties, such as to sync the properties with the workflow design area. Do not perform any clean up work here. Use PreDestroy for cleanup.

      Parameters:
      storedModel - The same model that was passed to prepareViewForElement(IElementPropInitParams). If you did not need to replace that model with another instance, you can just returned it. Conversely, if you did store the properties model in your bean, you may just return your stored value and ignore this parameter altogether.
      Returns:
      The current properties that reflect the current user input. You may mutate and return the same object(s) that were passed to prepareViewForElement(IElementPropInitParams).
    • updateCurrentProperties

      default void updateCurrentProperties(IElementUpdateCurrentPropsParams<TData> params) throws Exception
      Called each time when the data of the selected node was edited externally. Normally this does not happen. This only happens when the element handler returned a custom client handler (see IElementHandler.getJavaScript(boolean)) that invoked an external custom params update from the flowchart. If this bean stored the data in a field during prepareViewForElement(IElementPropInitParams), it should update that field.
      Parameters:
      params - Params with the old and new data.
      Throws:
      Exception - When the data could not be updated. This exception is caught and an error message is shown to the user.
    • updateCurrentTask

      default void updateCurrentTask(IElementUpdateCurrentTaskParams params) throws Exception
      Called each time when task of the selection has changed. This happens, for example, when the element is moved between different tasks. Can be used when the bean wishes to keep track of the current task. Otherwise, this does not need to be overridden.
      Parameters:
      params - Params with the old and new data.
      Throws:
      Exception - When the data could not be updated. This exception is caught and an error message is shown to the user.