[JBoss jBPM] - dynamic commands
by gogoasa
Hello,
Even if the predefined Commands that can be thrown at the CommandService are pretty rich, it would be nice to be able to throw any code you can think of, without the need to lookup the sources of the various Commands and try to figure out which combination would do the thing you want.
It would make sense then to use dynamic languages like Groovy or Beanshell to specify the command. A simple BeanShell-only command :
public class BshCommand implements Command {
|
| protected String code;
|
| public BshCommand(String code) {
| this.setCode(code);
| }
|
| public Object execute(JbpmContext jbpmContext) throws Exception {
| Interpreter interpreter = new Interpreter();
| interpreter.set("jbpmContext", jbpmContext);
| Object result = interpreter.eval(this.getCode());
| return result;
| }
|
| public String getCode() {
| return code;
| }
|
| public void setCode(String code) {
| this.code = code;
| }
|
| }
|
which could be used like this :
Command cmd = new BshCommand("return jbpmContext.getProcessInstance(5);");
| Object resp = service.execute(cmd);
As bsh is already a dependency, I think the possibilies of querying a remote ejb would be greatly enhanced by just adding this command.
Using BSF the BshCommand could actually be named ScriptCommand and might execute any other cool scripting languages...
Best regards,
Adrian.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085755#4085755
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085755
18 years, 10 months
[JBoss Seam] - Re: Reccomend me a SEAM book
by dan.j.allen
"ellenzhao" wrote : I read Michael Yuan + Thomas Heute's Seam book, it's pretty good but information in that book needs to be updated since Seam is under drastic change. Most of the time, I find Seam reference manual pretty sufficient. I open the reference in a single html and global search is then much easier. If the reference doc does not answer all my questions or my usage of some Seam features turned very exotic, I resorted to this forum and always got informative replies. (If only the search function of the forum could be more usable) Sometimes, if you are stuck by some really strange behaviours of the framework and want to know what's happening under the hood, source code of Seam is the best answer. That's why some people do Seam cvs update everyday to fetch the latest source code, even thought they are not official Seam developers. If Seam source code alone does not help, you might want the source code of some 3rd party libs, for example, hibernate, javassist,....even the source code of jdk. If the source code of jdk still does not help you find the root of your problem, you might want to look at the "native code" of your OS.
I couldn't have said it better myself. I have spent countless hours in the Seam source code. Hopefully I can save people time by bringing what I have learned to the book. I feel that the reference documentation needs to be as concise as possible, whereas a book can give more of a back story and use case. Regardless, the reference documentation is always open on my desktop.
As for the forum search limitations, Amen. I am praying that eventually this forum is moved to something powered by Seam and Hibernate Search. Could you imagine how quickly you can find issues then?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085754#4085754
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085754
18 years, 10 months
[JBoss Seam] - Re: Reccomend me a SEAM book
by dan.j.allen
@Stateful
| @Name("Seam in Action")
| public class SeamBook extends Book {
|
| @Out(required = false)
| private String author;
|
| @Out(required = false)
| private String publisher;
|
| public String showMeTheAuthor() {
| author = "Dan Allen";
| return "/bookInfo.xhtml";
| }
|
| public String showMeThePublisher() {
| publisher = "Manning Publications";
| return "/bookInfo.xhtml";
| }
|
| }
Today I just made the announcement on my blog ( http://www.mojavelinux.com/blog/archives/2007/09/announcing_seam_in_action) about Seam in Action, which I am authoring. The book will cover the upcoming Seam 2.0 release (and perhaps a later version depending on the timing). I explain in my post that if the stars align, the printed book will be available for JavaOne 2008, but that you can get at several of the chapters very soon through Manning's early access program.
I wish I were a miracle worker and could write the book in 0 days, but the reality is that I cannot write at warp speed. Hell, writing is the easy part. Making pretty pictures can eat up the better part of a weekend. Fortunately, Seam makes the code really easy to write, but even that takes design time. All complaining aside, I am confident that it is going to be a great book.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085752#4085752
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085752
18 years, 10 months
[Tomcat, HTTPD, Servlets & JSP] - Re: jsp error : No Java compiler available
by cgo
I still have this issue, however when setting jboss logs to debug I see the 2 NoClassDefFoundError exceptions below. I checked and the first class is in jasper-jdt.jar in the web deployer while the second one I could not find it, so I dropped ant.jar which contains it in the web deployer, but still it doesn't find any of the class. Any idea of what is wrong here ? Is jboss missing some files ?
Throwable
java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/compiler/env/INameEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:238)
at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:217)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:561)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
Throwable
java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildListener
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:238)
at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:219)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:561)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085746#4085746
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085746
18 years, 10 months