Package com.groiss.wf

Interface ApplicationAdapter

All Superinterfaces:
HasResource, Lifecycle, Service
All Known Implementing Classes:
DefaultApplicationAdapter

public interface ApplicationAdapter extends HasResource, Service
Interface for classes customizing the application behaviour. your implementation will be used for an application if it is registered in the application administration as application class.
  • Method Details

    • setApplication

      void setApplication(Application a)
    • of

      static ApplicationAdapter of(String applId)
      get the current ApplicationAdapter instance for the passed application-Id
      Parameters:
      applId - the application-ID
      Returns:
    • of

      static ApplicationAdapter of(Application appl)
      get the current ApplicationAdapter instance for the passed Application
      Parameters:
      appl - the application
      Returns:
    • getNewProcessId

      String getNewProcessId(ProcessInstance pi)
      The method is called whenever a new process Id is needed
      Parameters:
      pi - the process instance for which the id should be generated
    • onSeeLater

      default void onSeeLater(ActivityInstance ai)
      An ActivityInstance is put into the suspension list.
      Parameters:
      ai - an activity instance
    • onSeeAgain

      default void onSeeAgain(ActivityInstance ai)
      An ActivityInstance is taken out of the suspension list.
      Parameters:
      ai - an activity instance
    • onChangeAgent

      default void onChangeAgent(ActivityInstance oldAi, ActivityInstance newAi)
      Change agent has been performed for an activity instance.
      Parameters:
      oldAi - the old activity instance
      newAi - the new activity instance
    • onListPreviousSteps

      Called when "go back" is executed.
      Parameters:
      ai - the activity instance the process is currently in
      list - a list of Pairs. The first element of the pair is a previous activity instance, the second is a list of activities that must be aborted when going back to this step (for example siblings in a parallelism).
      Returns:
      the changed (or unchanged) list
    • onAbort

      default void onAbort(ProcessInstance pi)
      An activity is aborted (process is aborted, activity cancelled by goBack)
      Parameters:
      pi - the aborted activity instance, may be a process instance, may be an activity instance
    • onReactivate

      default void onReactivate(ProcessInstance pi)
      A process is reactivated
      Parameters:
      pi - the process instance
    • onAddDocument

      default void onAddDocument(ProcessInstance pi, DMSFolder f, DMSObject o)
      Called before a document is added to a process (incl. subfolders) of this application.
      Parameters:
      pi - the process instance
      f - the folder where the object will be added
      o - the object to add
    • onRemoveDocument

      default void onRemoveDocument(ProcessInstance pi, DMSFolder f, DMSObject o)
      Called when a document is removed from a process (incl. subfolders) of this application.
      Parameters:
      pi - the process instance
      f - the folder
      o - the object to remove
    • notifyUser

      void notifyUser(User u, ActivityInstance ai)
      The method is called when an email-notification about a new worklist entry is sent.
      Parameters:
      u - the recipient
      ai - an activity instance
    • getUserProperties

      default List<Element> getUserProperties(User u)
      Returns the user properties a user can set. It is normally read from the application configuration.
      Parameters:
      u - The user whose properties should be returned
      Returns:
      a list of jdom elements describing the property.
    • getFinishRight

      default Right getFinishRight(ActivityInstance ai)
      Returns the right which is needed for sending the process to next agent The system checks if the sending user has this right for the agent and org.-unit of the given ai.
      Parameters:
      ai - the new ActivityInstance
    • getFinishRights

      default List<Right> getFinishRights()
      Return the list of finish rights used in this application.
      Returns:
      a List of rights
    • getPacker

      default com.groiss.wf.distri.Packer getPacker()
      Return the Packer used for distributing activities of this application.
      Returns:
      a Packer object
    • modifyDetailPanes

      default void modifyDetailPanes(KeyedList<String,NavigationTreeNode> nodes, StringBuilder title, ProcessInstance pi, ActivityInstance ai)
      You can modify the title and tabs in the detail view of the process. This method is called when the details of an item are to be displayed. This is not called every time, but rather for the first time and when the gui supposes that the item has been changed.
      Parameters:
      nodes - a list of configured nodes, the keys are the node ids, for example 'history'. For forms the keys are 'form:<fid>' where fid is the id of the form in the process. The nodes are copied from the original ones and therefore mutable. Additional attributes can be set via NavigationTreeNode.setAttrib(String, Object).
      title - HTML text can be added to the StringBuilder, for getting the standard appearance, use the following structure:
      <span class="scPID"><label>Id:</label> <span class="scValue">..id..</span></span>
      <span class="scProcess"><label>Process:</label> <span class="scValue">..process name..</span></span>
      <span class="scTask"><label>Task:</label> <span class="scValue">..task name..</span></span>
      <span class="scSubject"><label>Subject:</label> <span class="scValue">..the subject..</span></span>
      ai - activity instance object, may be null
    • getToolbarActions

      default void getToolbarActions(ActivityInstance ai, List<Pair<String,List<Pair<String,?>>>> actions)
      Determine the toolbar actions shown in the detail view of an activity instance.
      Parameters:
      ai - the activity instance
      actions - the actions configured in the worklist
    • getVersion

      String getVersion()
      Returns the version of the application code. The returning string is compared to the version in the database when the system starts up in restricted mode.
      Returns:
      the version string
    • upgrade

      default String upgrade(Application appl) throws Exception
      The method is called when the application server detects that the version of the application in the database is different from the version of the code.
      Throws:
      Exception
    • onAnonymize

      default void onAnonymize(User u, String newId)
      The method is called when the anonymize function is called for a user. It allows to add some application specific action for removing the user or user name from the database.
      Parameters:
      u -
      newId - the id after anonymize
    • onFinishNotComplete

      default void onFinishNotComplete(ActivityInstance ai)
      The method is called when the user cancels the post-finish selection dialog (e.g. select choice-branch, follow-up-user etc.)
      Parameters:
      ai - the last task that needs to be finished
    • onApplicationInstall

      default void onApplicationInstall(Application appl)
      This method is called on installation of an application. When the method is called, the following actions have been done: application import, change of classpath, loading of configuration
      Parameters:
      appl - the application object
    • onApplicationUninstall

      default void onApplicationUninstall(Application appl)
      This method is called on application uninstall (delete). It is performed before any of the application objects have been deleted.
      Parameters:
      appl - the application object
    • onCopyProcess

      default void onCopyProcess(ProcessInstance originPI, ProcessInstance newPI)
      This method is called when task function "Create process copy" is executed. It is performed after copy operation has been finished and the begin step of the process has been started. After executing this method the first interactive process step will be started.
      Parameters:
      originPI - the ProcessInstance where "Create process copy" has been called
      newPI - the ProcessInstance which has been created by "Create process copy"