[JBoss Tools] - How to holding Entity Query search values when returning to page
by Busssard Buss
Busssard Buss [http://community.jboss.org/people/bussard] created the discussion
"How to holding Entity Query search values when returning to page"
To view the discussion, visit: http://community.jboss.org/message/539626#539626
--------------------------------------------------------------
Hello All,
I created a new CRUD project using JBoss Tools. It runs very well. But one thing don't work as I expected: When returning from a xxxEdit the xxxList has its search param cleared and the list returns to the first page.
I looked in many foruns but without a direct response.
So this is what I have:
The xxxList with a rich:dataTable and the action colum
<rich:column styleClass="action">
<f:facet name="header">Ação</f:facet>
<s:link view="/MetasNivelamento/#{empty from ? 'Comarcas' : from}.xhtml"
value="#{empty from ? 'Lançar Dados' : 'Selecionar'}"
propagation="#{empty from ? 'none' : 'default'}"
id="comarcasViewId">
<f:param name="comarcasId"
value="#{_comarcas.id}"/>
</s:link>
</rich:column>
The xxxEdit with the follwing returning buttom
<s:button view="/MetasNivelamento/#{empty comarcasFrom ? 'ComarcasList' : comarcasFrom}.xhtml"
id="done"
value="Return"/>
And here is my extend to EntityQuery
@SuppressWarnings("serial")
@Name("comarcasList")
public class ComarcasList extends EntityQuery<Comarcas> {
private static final String EJBQL = "select comarcas from Comarcas comarcas";
private static final String[] RESTRICTIONS = {
"lower(comarcas.polo) like lower(concat(#{comarcasList.comarcas.polo},'%'))",
"lower(comarcas.regiaoJudiciaria) like lower(concat(#{comarcasList.comarcas.regiaoJudiciaria},'%'))",
"lower(comarcas.entrancia) like lower(concat(#{comarcasList.comarcas.entrancia},'%'))",
"lower(translate(comarcas.comarca,'âàãáÁÂÀÃéêÉÊíÍóôõÓÔÕüúÜÚÇç','AAAAAAAAEEEEIIOOOOOOUUUUCC')) like lower(concat(translate(#{comarcasList.comarcas.comarca},'âàãáÁÂÀÃéêÉÊíÍóôõÓÔÕüúÜÚÇç','AAAAAAAAEEEEIIOOOOOOUUUUCC'),'%'))",
"lower(translate(comarcas.varaComum,'âàãáÁÂÀÃéêÉÊíÍóôõÓÔÕüúÜÚÇç','AAAAAAAAEEEEIIOOOOOOUUUUCC')) like lower(concat('%',translate(#{comarcasList.comarcas.varaComum},'âàãáÁÂÀÃéêÉÊíÍóôõÓÔÕüúÜÚÇç','AAAAAAAAEEEEIIOOOOOOUUUUCC'),'%'))",
"lower(comarcas.competencia) like lower(concat(#{comarcasList.comarcas.competencia},'%'))", };
private Comarcas comarcas = new Comarcas();
public ComarcasList() {
setEjbql(EJBQL);
setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
setMaxResults(25);
}
public Comarcas getComarcas() {
return comarcas;
}
}
If I use the browser's back buttom (or a equivalent Ajax function ) it work as expected.
Anybody has a solution ?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/539626#539626]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[JBoss Messaging] - Infinite Redelivery
by Sébastien Gérard
Sébastien Gérard [http://community.jboss.org/people/sebge2] created the discussion
"Infinite Redelivery"
To view the discussion, visit: http://community.jboss.org/message/539624#539624
--------------------------------------------------------------
Hello !
I'm here because of a redelivery problem. I've tryed on Jboss 4.2.0 ou 4.2.3 with Spring 2.5.6. Unfortunately, Jboss seems to not handle correctly the RedeliveryLimit attribute. Thanks to JMX, I can see that the RedeliveryLimit for my configured queue is set to -1 (i.e., no limit). Even if I set that attribute to 3, the behaviour is the same: my listener continuously receives the message (on message is called again & again) and throws a runtime exception every time it receives the message. The message is never placed in the DLQ. Changing the redelivering delay,rightly delays the reception of my messages. Here is the configuration of my queue:
My spring message listener:
Here is my listenener:
public void onMessage(Message message) {
boolean isSuccessfullyReceived = false;
try {
if ( throwingPolicy != null )
{
throwingPolicy.throwExceptionIfRequired(message, this);
}
isSuccessfullyReceived = true;
} finally {
final String messageId = messageIdentifierService.getMessageIdentifier(message);
if (isSuccessfullyReceived) {
logger.debug("Message [" + message + "] has been successfully received.");
onCompleted(messageId, message);
} else {
logger.debug("Message [" + message + "] has NOT been successfully received.");
onException(messageId, message);
}
}
}
Any idea ?
Thanks for your help :) !
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/539624#539624]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[jBPM] - Process Variable cannot be casted and accessed
by Gerardo Navarro Suarez
Gerardo Navarro Suarez [http://community.jboss.org/people/GerardoNS] created the discussion
"Process Variable cannot be casted and accessed"
To view the discussion, visit: http://community.jboss.org/message/539622#539622
--------------------------------------------------------------
Hi All,
I'm having a problem to access a process variable in an ActionHandler. I've installed jBPM 3.2.3 (suite) and the GPD eclipse plugin, which is very nice for the deployment of the process and all its resources.
The problem appears in the jbpm-console when the token moves from state named "first" to the end-state "end". The transition fires and calls de.hpi.pois.GetterAction. The ActionHandler wants to acess the process variable "appli" and then the error appears. The process variable cannot be cast (see the attached errorLog). The jbpm-console displays the error message:"Error signalling token: An exception of type "org.jbpm.graph.def.DelegationException" was thrown. The message is: de.hpi.pois.klassen.Application cannot be cast to de.hpi.pois.klassen.Application".
I know that there is already a thread ( http://community.jboss.org/message/377445#377445 http://community.jboss.org/message/377445#377445) dealing with almost the same problem, but this discussion doesn't come to an end. I hope that this discussion will get a result. Maybe you'll have an idea.
It's only a guess, but maybe there are some configurations missing (maybe for the hibernate, I don't know). To deploy the process I use the deployment tab provided by the GPD eclipse plugin (see GPDt.png). I wonder how experts deploy their processes? Maybe I'm doing something wrong.
I've prepared a little process for this thread which reproduces the problem. My main project is a bit bigger, but there happens the same problem.
My processdefiniton.xml:
<process-definition
xmlns="urn:jbpm.org:jpdl-3.2"
name="simple">
<start-state name="start">
<transition to="first" name="to_state">
<action name="actoin1" class="de.hpi.pois.action.ApplicationCreation"></action>
</transition>
</start-state>
<state name="first">
<transition name="to_end" to="end">
<action name="action2" class="de.hpi.pois.action.GetterAction"></action>
</transition>
</state>
<end-state name="end"></end-state>
</process-definition>
The ActionHandler ApplicationCreation:
package de.hpi.pois.action;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import de.hpi.pois.klassen.Application;
public class ApplicationCreation implements ActionHandler
{
private static final long serialVersionUID = 1893405813471405736L;
@Override
public void execute(ExecutionContext arg0) throws Exception
{
Application appli = Application.createApplication("Gerardo, mailto:g@hpi.de g(a)hpi.de");
arg0.setVariable("appli", appli);
}
}
The ActionHandler GetterAction:
package de.hpi.pois.action;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import de.hpi.pois.klassen.Application;
public class GetterAction implements ActionHandler
{
private static final long serialVersionUID = -7981154292715474830L;
@Override
public void execute(ExecutionContext arg0) throws Exception
{
Application appli = (Application) arg0.getVariable("appli");
arg0.setVariable("name", appli.getName());
arg0.setVariable("email", appli.getEmail());
}
}
The class Applicaion:
package de.hpi.pois.klassen;
import java.io.Serializable;
public class Application implements Serializable
{
private static final long serialVersionUID = 134598365872315L;
public String name;
public String email;
public Application(){}
public Application(String name, String email)
{
setName(name);
setEmail(email);
}
public static Application createApplication(String entry)
{
String[] entryElements = entry.split(",");
return new Application(entryElements[0], entryElements[1]);
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
}
Thanks fro your help. I appreciate it a lot.
Greetings,
Gerardo
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/539622#539622]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years