|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthero.session.UserSessionBean
The User Session Bean, is an stateful session bean that provides the user API to get information on
Todo list and started activities and to produce events on activities (start, terminate, cancel).
This Session Bean is based on Engine Session Bean: a recursive implementation that manage the previous execution operations
and propagates the activity state changes to the activities that are connected to this one.
The User Session Bean API provides information about user projects and activites (project list,
todo list and activity list) and also useful information about project instances or user
preferences. With this API users can performs his task/activities by using start, terminate and
cancel methods and also terminates workflow processes.
The following lines shows a sample code to use this API in your application:
First of all you have to import the User Session files:
import hero.interfaces.UserSessionLocalHome;
import hero.interfaces.UserSessionLocal;
import hero.interfaces.UserSessionHome;
import hero.interfaces.UserSession;
import hero.interfaces.UserSessionUtil;
Now, it is time to create the User Session instance:
Like this if you want to use local interfaces:
UserSessionLocalHome userh = (UserSessionLocalHome)hero.interfaces.UserSessionUtil.getLocalHome();
UserSessionLocal usersession = userh.create();
or like this if you use remote interfaces:
UserSessionHome userh = (UserSessionHome)hero.interfaces.UserSessionUtil.getHome();
UserSession usersession = userh.create();
after that, you can init the User Session API for this user by using the init method:
usersession.init();
Now you can call all User Sessions methods...
Field Summary |
Fields inherited from interface hero.util.EventConstants |
ADDEDGE, ADDNODE, ADDROLE, ADDUSERPROJECT, ANTICIPATING, CANCELED, CHANGEROLE, DELETEEDGE, DELETENODE, DELETEPROJECT, EDGE, EDGENAME, EVENT, LOG, NODE, NODEDEADLINE, NODEIN, NODENAME, NODEOUT, NODESTATE, NODETYPE, PROJECT, PROJECTNAME, READYINITIAL, ROLE, ROLENAME, SETEDGESTATE, SETNODEDEADLINE, SETNODEEXECUTOR, SETNODESTATE, SETUSERROLE, START, TERMINATED, UNSETUSERROLE, USER, USERNAME, USERROLE |
Constructor Summary | |
UserSessionBean()
|
Method Summary | |
void |
cancelActivity(java.lang.String projectName,
java.lang.String nodeName)
Tries to cancel an activity (when activity is executing or anticipating) |
void |
deleteUserProperty(java.lang.String key)
Delete a property of a user |
void |
ejbActivate()
Internal Enterprise Java Beans method. |
void |
ejbCreate()
Creates the User Session Bean. |
void |
ejbPassivate()
Internal Enterprise Java Beans method. |
void |
ejbRemove()
Internal Enterprise Java Beans method. |
java.util.Collection |
getActivityList(java.lang.String projectName)
Obtain all user activities from specific project (executing and anticipating state) |
java.util.Collection |
getActivityListAllInstances()
Obtain executing user activities for all instances (ready and anticipable state) |
java.util.Collection |
getActivityListByProperty(java.lang.String key,
java.lang.String value)
Obtain executing user activities matching with property value (executing and anticipating state activities) |
java.util.Collection |
getInstancesByProperty(java.lang.String key,
java.lang.String value)
Get Workflow instances from a property |
java.util.Collection |
getInstancesByPropertyNames(java.lang.String key,
java.lang.String value)
Get Workflow instances from a property |
java.util.Collection |
getInstancesList()
Get user instances list. |
java.util.Collection |
getInstancesListNames()
Get instances list names for this user. |
hero.interfaces.BnNodeValue |
getNode(java.lang.String projectName,
java.lang.String nodeName)
Get Node Value from a specific project |
java.util.Collection |
getProjectInstances(java.lang.String projectName)
Get Workflow instances of this project |
java.util.Collection |
getProjectInstancesNames(java.lang.String projectName)
Get workflow instances names of this project |
java.util.Collection |
getProjectList()
Get user project list. |
java.util.Collection |
getProjectListNames()
Get project list names for this user |
java.util.Collection |
getProjectsByProperty(java.lang.String key,
java.lang.String value)
Get Workflow projects from a property |
java.util.Collection |
getProjectsByPropertyNames(java.lang.String key,
java.lang.String value)
Get Workflow projects from a property |
java.util.Collection |
getToDoList(java.lang.String projectName)
Obtain all user activities from specific project (ready and anticipable state) |
java.util.Collection |
getToDoListAllInstances()
Obtain todo user activities for all instances (ready and anticipable state) |
java.util.Collection |
getToDoListByProperty(java.lang.String key,
java.lang.String value)
Obtain todo user activities matching with property value (ready and anticipable state activities) |
java.lang.String |
getUser()
Get the user name |
hero.interfaces.BnUserLightValue |
getUserLightValue()
Get the user light value |
java.lang.String |
getUserMail(java.lang.String userName)
Get the mail of this user from Bonita database. |
java.lang.String |
getUserPassword()
Get the user password |
java.util.Collection |
getUserProperties()
Get User properties |
void |
removeProject(java.lang.String projectName)
Delete a Workflow project |
void |
setSessionContext(javax.ejb.SessionContext context)
Internal Enterprise Java Beans method. |
void |
setUserMail(java.lang.String userName,
java.lang.String mail)
Set the mail of this user into Bonita database. |
void |
setUserProperty(java.lang.String key,
java.lang.String value)
Set a property of a user |
void |
startActivity(java.lang.String projectName,
java.lang.String nodeName)
Tries to start an activity (when activity state is ready or anticipable) |
void |
terminate(java.lang.String projectName)
Tries to terminate a project (only when all project activities are terminated) |
void |
terminateActivity(java.lang.String projectName,
java.lang.String nodeName)
Tries to terminate an activity (when activity state is executing or anticipating) |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UserSessionBean()
Method Detail |
public java.util.Collection getProjectList() throws hero.util.HeroException
hero.util.HeroException
public java.util.Collection getProjectListNames() throws hero.util.HeroException
hero.util.HeroException
public java.util.Collection getInstancesList() throws hero.util.HeroException
hero.util.HeroException
public java.util.Collection getInstancesListNames() throws hero.util.HeroException
hero.util.HeroException
public void removeProject(java.lang.String projectName) throws hero.util.HeroException
projectName
- the name of the project
hero.util.HeroException
public java.util.Collection getToDoList(java.lang.String projectName) throws hero.util.HeroException
projectName
- the name of the project
hero.util.HeroException
public java.util.Collection getActivityList(java.lang.String projectName) throws hero.util.HeroException
projectName
- the name of the project
hero.util.HeroException
public java.util.Collection getToDoListAllInstances() throws hero.util.HeroException
hero.util.HeroException
public java.util.Collection getActivityListAllInstances() throws hero.util.HeroException
hero.util.HeroException
public java.util.Collection getToDoListByProperty(java.lang.String key, java.lang.String value) throws hero.util.HeroException
key
- the key of the propertyvalue
- the value of the property
hero.util.HeroException
public java.util.Collection getActivityListByProperty(java.lang.String key, java.lang.String value) throws hero.util.HeroException
key
- the key of the propertyvalue
- the value of the property
hero.util.HeroException
public java.util.Collection getProjectInstancesNames(java.lang.String projectName) throws hero.util.HeroException
projectName
- the name of the project
hero.util.HeroException
public java.util.Collection getProjectInstances(java.lang.String projectName) throws hero.util.HeroException
projectName
- the name of the project
hero.util.HeroException
public java.util.Collection getInstancesByProperty(java.lang.String key, java.lang.String value) throws hero.util.HeroException
hero.util.HeroException
public java.util.Collection getInstancesByPropertyNames(java.lang.String key, java.lang.String value) throws hero.util.HeroException
hero.util.HeroException
public java.util.Collection getProjectsByProperty(java.lang.String key, java.lang.String value) throws hero.util.HeroException
hero.util.HeroException
public java.util.Collection getProjectsByPropertyNames(java.lang.String key, java.lang.String value) throws hero.util.HeroException
hero.util.HeroException
public void startActivity(java.lang.String projectName, java.lang.String nodeName) throws hero.util.HeroException
projectName
- the name of the projectnodeName
- the name of the node
hero.util.HeroException
public void terminateActivity(java.lang.String projectName, java.lang.String nodeName) throws hero.util.HeroException
projectName
- the name of the projectnodeName
- the name of the node
hero.util.HeroException
public void cancelActivity(java.lang.String projectName, java.lang.String nodeName) throws hero.util.HeroException
projectName
- the name of the projectnodeName
- the name of the node
hero.util.HeroException
public void terminate(java.lang.String projectName) throws hero.util.HeroException
projectName
- the name of the project
hero.util.HeroException
public hero.interfaces.BnNodeValue getNode(java.lang.String projectName, java.lang.String nodeName) throws hero.util.HeroException
projectName
- the name of the projectnodeName
- the name of the node
hero.util.HeroException
public java.lang.String getUser()
public hero.interfaces.BnUserLightValue getUserLightValue() throws hero.util.HeroException
hero.util.HeroException
public java.lang.String getUserMail(java.lang.String userName) throws hero.util.HeroException
userName
- the name of the user
hero.util.HeroException
public void setUserMail(java.lang.String userName, java.lang.String mail) throws hero.util.HeroException
userName
- the name of the user
hero.util.HeroException
public java.lang.String getUserPassword() throws hero.util.HeroException
hero.util.HeroException
public java.util.Collection getUserProperties() throws hero.util.HeroException
hero.util.HeroException
public void setUserProperty(java.lang.String key, java.lang.String value) throws hero.util.HeroException
key
- the key of the propertyvalue
- the name of the property
hero.util.HeroException
public void deleteUserProperty(java.lang.String key) throws hero.util.HeroException
key
- the key of the property
hero.util.HeroException
public void ejbCreate() throws javax.ejb.CreateException
javax.ejb.CreateException
public void setSessionContext(javax.ejb.SessionContext context)
setSessionContext
in interface javax.ejb.SessionBean
public void ejbRemove()
ejbRemove
in interface javax.ejb.SessionBean
public void ejbActivate()
ejbActivate
in interface javax.ejb.SessionBean
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.SessionBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |