[JBoss Seam] - selectOneMenu binding to session object
by joeyxxx
I'm trying to bind the currentPersona attribute of the user session object to the selected item in the drop down. Most solutions for this issue on the forum seem to focus on db, persistence context, entity manager etc but my application doesn't use a db directly. I need to have the currentPersona update triggered onChange. If that won't work, an update button will suffice.
I tried the ff because its similar to what worked for me in WO.(I can't shake my past :-)
SelectOneMenu
| <h:selectOneMenu value="#{user.currentPersona}">
| <s:selectItems value="#{user.personaList}" var="per" label="#{per.selectLabel}" hideNoSelectionLabel="true" />
| </h:selectOneMenu>
|
User Class
| @Name("user")
| @Scope(SESSION)
| public class User implements Serializable{
|
| @DataModel
| @Out
| private List<Persona> personaList;
|
| @DataModelSelection
| @Out(required=false)
| private currentPersona;
|
| ...
|
| //Mutators
| public Persona getCurrent Persona() {
| return current Persona;
| }
|
|
| public void setCurrentPersona(Persona selected Persona){
| log.info("Current Persona:", selectedPersona);
| this.current Persona = selectedPersona;
| }
|
| public List<Persona> getPersonaList() {
| return personaList;
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056690#4056690
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056690
18Â years, 10Â months
[JBoss jBPM] - Re: Locating timers from process instance
by cristian_e
"jorges38" wrote : I also have the same need to create a timer dynamically to overwrite the timer create at the process definition..
| Could I use actions within a task instance to create timer for that task? or even lookup independent tables to control priority, for example, if the task is urgente..timer should be set to 1 day, if not urgente..the timer would be set to 3 days....
It is possible to create a timer dinamically in an ActionHandler. We wrote this method to do this:
| public static void createTimer(TaskInstance ti, String name, Date duedate, String actionName)
| {
| Token tk=ti.getToken();
| Timer timer=new Timer(tk);
| timer.setName(name);
| timer.setDueDate(duedate);
| timer.setAction(tk.getProcessInstance()
| .getProcessDefinition()
| .getAction(actionName));
| timer.setGraphElement(ti.getTask().getTaskNode());
| timer.setTaskInstance(ti);
|
| DbSchedulerService schedulerServ=new DbSchedulerService();
| schedulerServ.createTimer(timer);
| }
|
The key is the use of the DbSchedulerService to register the Timer and actually getting it to work. The idea, of course, is that you can get the duedate from wherever you need.
Finally, about how to get a processinstance's timers, you can always build your own HQL query to get them. Look for the hibernate.queries.hbm.xml file inside the jbpm bundle to have an example of this.
Hope this helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056689#4056689
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056689
18Â years, 10Â months