[JBoss Seam] - Business process injection doesn't work in a Seam component
by chawax
Hi,
I have a problem using JBpm with Seam.
I modeled a process with nodes and binded actions to these nodes. But the injection of business process variables or processInstance in Seam component does not work when running these actions. I don't have the problem if the token did not go through a task-node before (ie a business process with no human action). I guess it deals with a context problem, but I can't understand what the problem exactly is.
For example, I modeled my node this way :
<node name="Acceptation">
| <transition to="End" />
| <action expression="#{demandeAbsenceAction.demandeAcceptee}" />
| </node>
I have a first Seam component (conversation scope) which creates the process instance this way :
@org.jboss.seam.annotations.bpm.CreateProcess(definition = "validationDemandeAbsence")
| @org.jboss.seam.annotations.End
| public void valider()
| {}
It also outjects idDemandeAbsence variable in the business process :
@org.jboss.seam.annotations.Out(required = false, scope = org.jboss.seam.ScopeType.BUSINESS_PROCESS)
| protected java.lang.Long idDemandeAbsence;
I had a look in the JBPM tables and this outjection works well.
I have another Seam component (conversation scope too) which contains methods binded to JPDL nodes. It injects processInstance and idDemandeAbsence variables this way :
@org.jboss.seam.annotations.In(create = true)
| protected org.jbpm.graph.exe.ProcessInstance processInstance;
|
| @org.jboss.seam.annotations.In(value = "idDemandeAbsence", scope = org.jboss.seam.ScopeType.BUSINESS_PROCESS)
| protected java.lang.Long idDemandeAbsence;
And of course it declares the action method binded to JPDL node (no annotation on this method, should there be some ?) :
public void demandeAcceptee()
| {}
But idDemandeAbsence and processInstance variables are alway null. Do I use JBpm and Seam the right way ? I work on this problem for several days, so any help will be greatly appreciated ;)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089601#4089601
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089601
18 years, 6 months
[JBoss Seam] - Re: Problems when paginating with search criterias
by uke
This is the code as it looks now. One problem is that the s:links put the searchCriteria as a get-parameter, which messes up some characters. Is it possible to html-encode it in some way?
I tried to solve problem no2 by adding a hidden field in the search-form, which sets firstResult to 0, but that didn't do anything, perhaps because get-parameters are prioritized over post-parameters?
components.xml:
| <fwk:entity-query name="users"
| entity-manager="#{entityManager}"
| ejbql="from User"
| order="name"
| max-results="10">
| <fwk:restrictions>
| <value>lower(name) like lower(concat(#{searchCriteria},'%'))</value>
| </fwk:restrictions>
| </fwk:entity-query>
|
pages.xml:
| <page view-id="/listUsers.xhtml">
| <param name="firstResult" value="#{users.firstResult}"/>
| <param name="searchCriteria" value="#{searchCriteria}"/>
| </page>
|
listUsers.xhtml:
| <h:form>
| <h:inputText name="searchCriteria" value="#{searchCriteria}"/>
| <h:commandButton value="Search"/>
| </h:form>
| <h:dataTable value="#{users.resultList}"var="user">
| <h:column>
| <s:link view="/viewUser.xhtml" value="#{user.name}">
| <f:param name="userId" value="#{user.id}"/>
| </s:link>
| </h:column>
| </h:dataTable>
| <s:link rendered="#{users.previousExists}" value="First">
| <f:param name="firstResult" value="0"/>
| </s:link>
| <s:link rendered="#{users.previousExists}" value="Previous">
| <f:param name="firstResult" value="#{users.previousFirstResult}"/>
| </s:link>
| <s:link rendered="#{users.nextExists}" value="Next">
| <f:param name="firstResult" value="#{users.nextFirstResult}"/>
| </s:link>
| <s:link rendered="#{users.nextExists}" value="Last">
| <f:param name="firstResult" value="#{users.lastFirstResult}"/>
| </s:link>
|
Thanks in advance
Sebastian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089597#4089597
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089597
18 years, 6 months