[JBoss Seam] - Re: can't access non-Seam variables from jPDL decision condi
by shea.phillips
I have managed to resolve my issue with not being able to access jBPM process context variable from within jPDL EL expressions using the following approach:
- I implemented an alternate implementation of a jBPM VariableResolver that delegates to the JBPM default variable resolver and the Seam implementation; in my implementation, variables in the JBPM context take precedence; if no value is found for a given variable name in the JBPM context, it looks in the Seam contexts; if there is nothing there, it returns null
- I implemented a JBPMBootStrap Seam component that I deploy from components.xml with a depdendency on the Seam JBPM component (meaning my component will start after Seam's); in its @Create/start() method, it just calls JbpmExpressionEvaluator.setVariableResolver(new MyNewVariableResolver())
Seems to be working well so far.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034357#4034357
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034357
19 years
[EJB 3.0] - Re: Need some help with mapping
by fhh
Okay. I think I'm starting to grasp what you want.
You have a store and each store is of a certain type? So you have stores of the type "department store", "hardware store" etc.
I guess there are fewer types of stores than stores. If that is so you do not have a @OneToOne relationship but @ManyToOne: Many stores belong to one store type. In SQL terminology this would be a 1:n relationship between types and stores.
If that is the case you can simply do this (leaving aside your table_name problem for a moment):
| public class Store {
| private Type storeType;
| @ManyToOne
| @JoinColumn(name = "STORE_TYPE_ID")
| public Type getStoreType() {
| return storeType;
| }
| //
| }
|
If you set up the Type class correctly the persistence layer will automatically determine that the join column must refer to TYPE.TYPE_ID and add a constraint to enforce this foreign key relationship if necessary.
Just to make this complete: I would strongly recommend that you drop your requirement of having the table_name in your type table. (I assume this is not really a table_name for use in dynamic sql but a string value to identify the "type of type" :-)) If you want this it would require you to use composite keys which is IMHO painful.
But THEORETICALLY you could do it like this: You create a class TypePK for the primary key of Type with a field for TYPE_ID (Integer) and a String for TABLE_NAME and annotate the class with @Embeddable, then you replace the type_id and table_name properties with a single property of the TypePk class and annotate it with @EmbeddedId.
Then you change your @ManyToOne relationship to something like:
@ManyTo
@JoinColumns({
@JoinColumn(name="STORE_TYPE_ID", referencedColumnName="TYPE_ID"),
@JoinColumn(name="TABLE_NAME", referencedColumnName="TABLE_NAME")
})
Finally adjust the setter of your Store to prevent setting types that do not have "STORE" as the table_name property of the type's typePK.
Sounds complicated? It is - and in my opinion not worth the effort.
Regards
Felix
P.S.: BTW: If the relationship between store and type is really 1:1 then you could solve this more elegantly by using the inheritance strategy joined.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034352#4034352
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034352
19 years
[JBoss Seam] - Remoting exception
by msduk
Hi I am trying my hand a bit of remoting and am stuck here. It is so close to the example code in section 19 I really cant see a problem.
This is 1.2.0 PATCH + Icefaces + 4.0.5 AS + JAAS
Cheers
Exception:
00:10:50,328 ERROR [Remoting] Error
| java.lang.RuntimeException: Type cannot be determined for component [Component(stockCheck)]. Please ensure that it has a local interface.
| at org.jboss.seam.remoting.InterfaceGenerator.appendComponentSource(InterfaceGenerator.java:284)
| at org.jboss.seam.remoting.InterfaceGenerator.generateComponentInterface(InterfaceGenerator.java:131)
| at org.jboss.seam.remoting.InterfaceGenerator.handle(InterfaceGenerator.java:101)
| at org.jboss.seam.remoting.Remoting.getResource(Remoting.java:110)
| at org.jboss.seam.servlet.ResourceServlet.doPost(ResourceServlet.java:76)
| at org.jboss.seam.servlet.ResourceServlet.doGet(ResourceServlet.java:58)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at halvor.filter.RoleFilter.doFilter(RoleFilter.java:48)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at halvor.filter.TimerFilter.doFilter(TimerFilter.java:42)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Unknown Source)
|
Javascript (the ../ is correct)
| <script type="text/javascript" src="../seam/resource/remoting/resource/remote.js"></script>
| <script type="text/javascript" src="../seam/resource/remoting/interface.js?stockCheck"></script>
| <script type="text/javascript">
| //<![CDATA[
|
| function checkStock() {
| var name = prompt("What is your name?");
| Seam.Component.getInstance("stockCheck").checkStock(name, checkStockCallback);
| }
|
| function checkStockCallback(result) {
| alert(result);
| }
|
| // ]]>
| </script>
|
java :
| package halvor.session;
|
| import javax.ejb.Stateless;
|
| import org.jboss.seam.annotations.Name;
|
|
| @Stateless
| @Name("stockCheck")
| public class StockChecker implements StockCheckerI {
|
| public String checkStock (String itemCode) {
| return "jkjhjk";
| }
|
| }
|
| package halvor.session;
|
| import org.jboss.annotation.ejb.Local;
| import org.jboss.seam.annotations.WebRemote;
|
| @Local
| public interface StockCheckerI {
|
| @WebRemote
| public String checkStock(String itemCode);
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034351#4034351
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034351
19 years