public class DefaultApplicationAdapter extends Object implements ApplicationAdapter, Service, com.groiss.wf.DefaultApplicationAdapterInterface
Modifier and Type | Field and Description |
---|---|
protected Application |
appl |
protected Resource |
applres |
static String |
ID_PREFIX |
protected boolean |
localize |
protected boolean |
running |
protected List<Element> |
userprops |
Constructor and Description |
---|
DefaultApplicationAdapter() |
Modifier and Type | Method and Description |
---|---|
static URL |
getDescFile(Application appl) |
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.
|
List<Right> |
getFinishRights()
Return the list of finish rights used in this application.
|
String |
getNewProcessId(ProcessInstance pi)
The method is called whenever a new process Id is needed
|
protected Page |
getNotificationMail(User user,
ActivityInstance ai)
Build the notification mail (default notification strategy for
notifyUser(User, ActivityInstance) ) |
protected static HTMLPage |
getNotificationMail(User u,
ActivityInstance ai,
String template)
Builds the default notification mail
|
com.groiss.wf.distri.Packer |
getPacker()
Return the Packer used for distributing activities of this application.
|
Resource |
getResource() |
void |
getToolbarActions(ActivityInstance ai,
List<Pair<String,List<Pair<String,?>>>> actions)
Determine the toolbar actions shown in the detail view of an activity instance.
|
List<Element> |
getUserProperties(User u)
Returns the user properties a user can set.
|
String |
getVersion()
Returns the version of the application code.
|
void |
internalStartup()
Sets up the UserProperties and the resources for proper i18n.
|
void |
internalStartupComplete()
Signals that startup is finished.
|
boolean |
isRunning()
Ask the object if it has been started
|
boolean |
localizeNames()
returns true if the application is the default application
or the configuration has a resource file configured.
|
void |
modifyDetailLinks(KeyedList<String,Link> links,
StringBuilder title,
ProcessInstance pi,
ActivityInstance ai)
You can modify the title and links in the detail view of the process.
|
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.
|
int |
nextNum(String id) |
void |
notifyUser(User u,
ActivityInstance ai)
The method is called when an email-notification about a new worklist entry is sent.
|
void |
onAbort(ProcessInstance pi)
An activity is aborted (process is aborted, activity cancelled by goBack)
|
void |
onAddDocument(ProcessInstance pi,
DMSFolder f,
DMSObject o)
Called before a document is added to a process (incl. subfolders) of this application.
|
void |
onAnonymize(User u,
String newId)
The method is called when the anonymize function is called for a user.
|
void |
onChangeAgent(ActivityInstance oldAi,
ActivityInstance newAi)
Change agent has been performed for an activity instance.
|
List<Pair<ActivityInstance,List<ActivityInstance>>> |
onListPreviousSteps(ActivityInstance ai,
List<Pair<ActivityInstance,List<ActivityInstance>>> list)
Called when "go back" is executed.
|
void |
onReactivate(ProcessInstance pi)
A process is reactivated
|
void |
onRemoveDocument(ProcessInstance pi,
DMSFolder f,
DMSObject o)
Called when a document is removed from a process (incl. subfolders) of this application.
|
void |
onSeeAgain(ActivityInstance ai)
An ActivityInstance is taken out of the suspension list.
|
void |
onSeeLater(ActivityInstance ai)
An ActivityInstance is put into the suspension list.
|
void |
setApplication(Application appl) |
void |
shutdown()
This method is called on shutdown.
|
void |
startup()
Called on @enterprise startup.
|
String |
upgrade(Application app)
The default implementation of the upgrade method checks the upgrade information in the properties.xml file
of the application.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onApplicationInstall, onApplicationUninstall, onCopyProcess, onFinishNotComplete
protected Application appl
protected boolean localize
protected Resource applres
protected boolean running
public static final String ID_PREFIX
public void setApplication(Application appl)
setApplication
in interface HasResource
public String getNewProcessId(ProcessInstance pi)
ApplicationAdapter
getNewProcessId
in interface ApplicationAdapter
pi
- the process instance for which the id should be generatedpublic int nextNum(String id)
public void onSeeLater(ActivityInstance ai)
ApplicationAdapter
onSeeLater
in interface ApplicationAdapter
ai
- an activity instancepublic void onSeeAgain(ActivityInstance ai)
ApplicationAdapter
onSeeAgain
in interface ApplicationAdapter
ai
- an activity instancepublic void onChangeAgent(ActivityInstance oldAi, ActivityInstance newAi)
ApplicationAdapter
onChangeAgent
in interface ApplicationAdapter
oldAi
- the old activity instancenewAi
- the new activity instancepublic List<Pair<ActivityInstance,List<ActivityInstance>>> onListPreviousSteps(ActivityInstance ai, List<Pair<ActivityInstance,List<ActivityInstance>>> list)
ApplicationAdapter
onListPreviousSteps
in interface ApplicationAdapter
ai
- the activity instance the process is currently inlist
- 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).public void onAbort(ProcessInstance pi)
ApplicationAdapter
onAbort
in interface ApplicationAdapter
pi
- the aborted activity instance, may be a process instance, may be an activity instancepublic void onReactivate(ProcessInstance pi)
ApplicationAdapter
onReactivate
in interface ApplicationAdapter
pi
- the process instancepublic void onAddDocument(ProcessInstance pi, DMSFolder f, DMSObject o)
ApplicationAdapter
onAddDocument
in interface ApplicationAdapter
pi
- the process instancef
- the folder where the object will be addedo
- the object to addpublic void onRemoveDocument(ProcessInstance pi, DMSFolder f, DMSObject o)
ApplicationAdapter
onRemoveDocument
in interface ApplicationAdapter
pi
- the process instancef
- the foldero
- the object to addprotected Page getNotificationMail(User user, ActivityInstance ai)
notifyUser(User, ActivityInstance)
)user
- the user who will be notifiedai
- the ActivityInstance
which triggered the notificationpublic void notifyUser(User u, ActivityInstance ai)
ApplicationAdapter
notifyUser
in interface ApplicationAdapter
u
- the recipientai
- an activity instancepublic List<Element> getUserProperties(User u)
ApplicationAdapter
getUserProperties
in interface ApplicationAdapter
u
- The user whose properties should be returnedpublic boolean localizeNames()
localizeNames
in interface HasResource
public Resource getResource()
getResource
in interface HasResource
public Right getFinishRight(ActivityInstance ai)
ApplicationAdapter
getFinishRight
in interface ApplicationAdapter
ai
- the new ActivityInstancepublic List<Right> getFinishRights()
ApplicationAdapter
getFinishRights
in interface ApplicationAdapter
public com.groiss.wf.distri.Packer getPacker()
ApplicationAdapter
getPacker
in interface ApplicationAdapter
public void modifyDetailLinks(KeyedList<String,Link> links, StringBuilder title, ProcessInstance pi, ActivityInstance ai)
ApplicationAdapter
modifyDetailLinks
in interface ApplicationAdapter
links
- a keyed list of Link objects, keys are 'form<index>', 'documents', 'notes', 'history', 'process'pi
- the process instanceai
- the activity instance, may be null (for example when called from search)public void modifyDetailPanes(KeyedList<String,NavigationTreeNode> nodes, StringBuilder title, ProcessInstance pi, ActivityInstance ai)
ApplicationAdapter
modifyDetailPanes
in interface ApplicationAdapter
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:ai
- activity instance object, may be nullpublic void startup()
public final void internalStartupComplete()
internalStartupComplete
in interface com.groiss.wf.DefaultApplicationAdapterInterface
public final void internalStartup()
internalStartup
in interface com.groiss.wf.DefaultApplicationAdapterInterface
public void shutdown()
Lifecycle
public boolean isRunning()
Service
public String getVersion()
ApplicationAdapter
getVersion
in interface ApplicationAdapter
public String upgrade(Application app) throws Exception
upgrade
in interface ApplicationAdapter
app
- the application objectException
public static URL getDescFile(Application appl) throws IOException
IOException
protected static HTMLPage getNotificationMail(User u, ActivityInstance ai, String template)
u
- the user who is going to receive this notificationai
- the new ai which triggered the notificationtemplate
- the message template path. if the template is null
, contrib/NotificationMask.html
will be usedpublic void getToolbarActions(ActivityInstance ai, List<Pair<String,List<Pair<String,?>>>> actions)
ApplicationAdapter
getToolbarActions
in interface ApplicationAdapter
ai
- the activity instanceactions
- the actions configured in the worklistpublic void onAnonymize(User u, String newId)
ApplicationAdapter
onAnonymize
in interface ApplicationAdapter
newId
- the id after anonymize@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.