[JBoss jBPM] - question on createTimerAction.java
by X490812
I have had to implement an actionHandler that replaces the action because I want to be able to dynamically update the dueDate (see
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=85157
and
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=82969
)
So I have done the following in an actionHandler:
jbpmContext = executionContext.getJbpmContext();
| jbpmContext.save(executionContext.getProcessInstance());
| CreateTimerAction cta = new CreateTimerAction();
|
| //Timer and duedate are required fields
| cta.setTimerName(timerName);
| cta.setDueDate(strDueDate);
|
| if (transitionName != null)
| cta.setTransitionName(transitionName);
| if (repeat != null)
| cta.setRepeat(repeat);
| if (timerAction != null)
| //cta.setTimerAction((Action) Class.forName(timerAction).newInstance());
| cta.setTimerAction(new Action(new Delegation(timerAction)));
And done the following in a process:
<action class="com.homeq.payoffdemand.jbpm.actions.CreatePDWTimerActionHandler">
| <timerName>UPES_Wait_for_Expiry</timerName>
| <dueDate>fidelityMaintWait</dueDate>
| <transitionName>UPES_Wait_for_Expiry_Decision</transitionName>
| <timerAction>com.homeq.payoffdemand.jbpm.actions.upes.CalcWaitForExpiryActionHandler</timerAction>
| </action>
Does this seem reasonable? is there a better way? In PaRticular, how do I set the action. The above timerAction is an implementation of actionHandler, and I don't know if this is the correct way to set it into the setTimerAction call - see above.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035844#4035844
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035844
19 years
[JBoss Seam] - Javassist object returned from Component.getInstance(
by PatrickMadden
Hi,
I have a strange problem. I'm trying to access another Seam SFSB (SFSB1) from inside another Seam SFSB (SFSB2). I have an accessor in SFSB1 as follows:
| /**
| * @return the webTreeModel
| */
| public WebDocumentTreeModelBean getWebDocumentTreeModel()
| {
| if (this.webDocumentTreeModel == null)
| {
| Object o = Component.getInstance("webDocumentTreeModel", ScopeType.SESSION, true);
|
| if (o != null)
| {
| log.info("Component instance for webDocumentTreeModel is " + o.getClass().getName());
| this.webDocumentTreeModel = (WebDocumentTreeModelBean) o;
| }
| else
| {
| log.info("Failed to create the component webDocumentTreeModel");
| }
| }
|
| return this.webDocumentTreeModel;
| }
|
The Component.getInstance("webDocumentTreeModel") call doesn't return null. However, when I cast it to what I think it should be I get the following error:
anonymous wrote :
| java.lang.ClassCastException: org.javassist.tmp.java.lang.Object_$$_javassist_21
My WebDocumentTreeModel local interface is defined as follows:
| import javax.ejb.Local;
|
| @Local
| public interface WebDocumentTreeModel
| {
| public void destroy();
|
|
My SFSB is defined as follows:
| @Stateful
| @Name("webDocumentTreeModel")
| @Scope(ScopeType.SESSION)
| public class WebDocumentTreeModelBean implements WebDocumentTreeModel
| {
| ....
| }
The other SFSB is defined in a similar fashion and was created using seam gen. The one in question was not however.
I'm just curious if anyone knows about this or has seen this before and can give me a pointer as to what I'm doing wrong.
I'm using Seam 1.2.1 GA and Rich Faces lastest snapshot jar with JBoss 4.0.5.GA
Any help is greatly appreciated.
Thanks,
PVM
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035841#4035841
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035841
19 years
[JBoss Getting Started Documentation] - Duke's Bank problem
by jposnersails
I was able to exectue each of the steps outlined in the getting started guide for dukes bank without a single warning...that is until deployment.
I can ignure the warnings, I suppose. But ultimately, the application fails to load.
Any advice would be appreciated. I am using 4.0.5.GA, JDK 1.5.11, WinXP
Once deployed, I got the following dump:
21:15:22,203 INFO [EARDeployer] Init J2EE application: file:/C:/JBoss/jboss-4.0.5.GA/server/default/deploy/JBossDukesBank.ear
21:15:23,421 WARN [verifier] EJB spec violation:
Bean : CustomerBean
Section: 12.2.2
Warning: The class must be defined as public and must not be abstract.
21:15:23,437 WARN [verifier] EJB spec violation:
Bean : CustomerBean
Section: 12.2.5
Warning: Every entity bean must define the ejbFindByPrimaryKey method.
21:15:23,437 WARN [verifier] EJB spec violation:
Bean : CustomerBean
Section: 22.2
Warning: The bean provider must specify the fully-qualified name of the enterprise bean's local home interface, if any, in the <local-home> element.
Info : Class not found on 'com.sun.ebank.ejb.customer.CustomerHome': No ClassLoaders found for: com.sun.ebank.ejb.customer.CustomerHome
21:15:23,437 WARN [verifier] EJB spec violation:
Bean : CustomerBean
Section: 22.2
Warning: The bean provider must specify the fully-qualified name of the enterprise bean's local interface, if any, in the element.
Info : Class not found on 'com.sun.ebank.ejb.customer.Customer': No ClassLoaders found for: com.sun.ebank.ejb.customer.Customer
21:15:23,437 WARN [verifier] EJB spec violation:
Bean : CustomerBean
Section: 12.2.1
Warning: The Bean Provider must provide a remote interface and a remote home interface or a local interface and a local home interface for the bean.
21:15:23,437 WARN [verifier] EJB spec violation:
Bean : AccountBean
Section: 12.2.2
Warning: The class must be defined as public and must not be abstract.
21:15:23,437 WARN [verifier] EJB spec violation:
Bean : AccountBean
Section: 12.2.5
Warning: Every entity bean must define the ejbFindByPrimaryKey method.
21:15:23,437 WARN [verifier] EJB spec violation:
Bean : AccountBean
Section: 22.2
Warning: The bean provider must specify the fully-qualified name of the enterprise bean's local home interface, if any, in the <local-home> element.
Info : Class not found on 'com.sun.ebank.ejb.account.AccountHome': No ClassLoaders found for: com.sun.ebank.ejb.account.AccountHome
21:15:23,453 WARN [verifier] EJB spec violation:
Bean : AccountBean
Section: 22.2
Warning: The bean provider must specify the fully-qualified name of the enterprise bean's local interface, if any, in the element.
Info : Class not found on 'com.sun.ebank.ejb.account.Account': No ClassLoaders found for: com.sun.ebank.ejb.account.Account
21:15:23,453 WARN [verifier] EJB spec violation:
Bean : AccountBean
Section: 12.2.1
Warning: The Bean Provider must provide a remote interface and a remote home interface or a local interface and a local home interface for the bean.
21:15:23,453 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 12.2.2
Warning: The class must be defined as public and must not be abstract.
21:15:23,453 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 12.2.5
Warning: Every entity bean must define the ejbFindByPrimaryKey method.
21:15:23,453 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 22.2
Warning: The bean provider must specify the fully-qualified name of the enterprise bean's local home interface, if any, in the <local-home> element.
Info : Class not found on 'com.sun.ebank.ejb.tx.TxHome': No ClassLoaders found for: com.sun.ebank.ejb.tx.TxHome
21:15:23,453 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 22.2
Warning: The bean provider must specify the fully-qualified name of the enterprise bean's local interface, if any, in the element.
Info : Class not found on 'com.sun.ebank.ejb.tx.Tx': No ClassLoaders found for: com.sun.ebank.ejb.tx.Tx
21:15:23,453 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 12.2.1
Warning: The Bean Provider must provide a remote interface and a remote home interface or a local interface and a local home interface for the bean.
21:15:23,843 ERROR [MainDeployer] Could not create deployment: file:/C:/JBoss/jboss-4.0.5.GA/server/default/tmp/deploy/tmp34154JBossDukesBank.ear-contents/bank-ejb.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:610)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<CLIP....the rest of the stack dump>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035840#4035840
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035840
19 years
[JBoss Seam] - Re: Request for PDF p:element tag
by dustismo
Norman,
Many thanks for implementing this. Unfortunately it doesn't work for my purpose. I forgot that I needed access to the DocWriter in order to draw the graph onto the pdf. The element tag may end up being useful for other purposes though.
I extended ITextComponent to create a simple tag to renderer JFreeCharts. Possibly someone will find it useful.
| public class PdfGraph extends ITextComponent {
|
| JFreeChart graph = null;
| Element element = null;
| float height;
| float width;
|
| /**
| *
| */
| public PdfGraph() {
|
| }
|
| public void setValue(JFreeChart graph) {
| this.graph = graph;
| }
|
| /* (non-Javadoc)
| * @see org.jboss.seam.pdf.ui.ITextComponent#createITextObject(javax.faces.context.FacesContext)
| */
| @Override
| public void createITextObject(FacesContext context) {
| graph = (JFreeChart) valueBinding(context, "value", graph);
| height = (Float) valueBinding(context, "height", height);
| width = (Float) valueBinding(context, "width", width);
|
| UIDocument doc = (UIDocument)this.findITextParent(this, UIDocument.class);
| DocWriter writer = doc.getWriter();
|
| if (writer instanceof PdfWriter) {
| try {
| PdfContentByte cb = ((PdfWriter)writer).getDirectContent();
| PdfTemplate tp = cb.createTemplate(width, height);
| Graphics2D g2d = tp.createGraphics(width, height, new DefaultFontMapper());
| Rectangle2D r2d = new Rectangle2D.Double(0, 0, width, height);
| this.graph.draw(g2d, r2d);
| g2d.dispose();
| this.element = new ImgTemplate(tp);
| } catch (Exception x) {
| x.printStackTrace();
| }
| }
| }
|
|
| /* (non-Javadoc)
| * @see org.jboss.seam.pdf.ui.ITextComponent#getITextObject()
| */
| @Override
| public Object getITextObject() {
| return element;
| }
|
| /* (non-Javadoc)
| * @see org.jboss.seam.pdf.ui.ITextComponent#handleAdd(java.lang.Object)
| */
| @Override
| public void handleAdd(Object arg0) {
| throw new RuntimeException("No children allowed");
| }
|
| /* (non-Javadoc)
| * @see org.jboss.seam.pdf.ui.ITextComponent#removeITextObject()
| */
| @Override
| public void removeITextObject() {
| element = null;
| }
|
| public float getHeight() {
| return this.height;
| }
|
| public void setHeight(float height) {
| this.height = height;
| }
|
| public float getWidth() {
| return this.width;
| }
|
| public void setWidth(float width) {
| this.width = width;
| }
|
| }
thanks,
Dustin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035837#4035837
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035837
19 years
[JBoss Seam] - Re: Seam enhanced EL expression fails in an Ajax4JSF tag
by alexg79
I don't know what code you want to see, but here's the bean code:
| @Stateful
| @Scope(ScopeType.SESSION)
| @Name("categorybean")
| public class CategoryBean implements CategoryLocal {
|
| private static final int PAGE_SIZE = 30;
|
| @In
| private EntityManager db;
|
| @RequestParameter
| private String id;
|
| private Category cat;
| private Query entryQuery;
| private int page = 0;
|
| public Category getCategory() {
| if (cat == null)
| cat = db.find(Category.class, Short.parseShort(id));
| return cat;
| }
|
| @SuppressWarnings("unchecked")
| public List<Entry> getEntries() {
| if (entryQuery == null) {
| Session session = (Session) db.getDelegate();
| entryQuery = session.createFilter(getCategory().getEntries(), "");
| }
|
| entryQuery.setFirstResult(page * PAGE_SIZE).setMaxResults(30);
| return entryQuery.list();
| }
|
| public boolean isPreviousPageAvailable() {
| return page > 0;
| }
|
| public boolean isNextPageAvailable() {
| return page * PAGE_SIZE < getCategory().getNumEntries() - 1;
| }
|
| public void jumpPage() {
| // Dummy method for jumping pages
| }
|
| public void previousPage() {
| page--;
| }
|
| public void nextPage() {
| page++;
| }
|
| public int getPage() {
| return page;
| }
|
| public void setPage(int page) {
| this.page = page;
| }
|
| public int[] getPageNumbers() {
| int[] pageNumbers = new int[getCategory().getNumEntries()];
| for (int i = 0; i < getCategory().getNumEntries(); i++)
| pageNumbers = i + 1;
| return pageNumbers;
| }
|
| @Remove @Destroy
| public void destroy() {}
|
| }
|
and the local interface:
| @Local
| public interface CategoryLocal {
|
| Category getCategory();
|
| List<Entry> getEntries();
|
| int[] getPageNumbers();
|
| void jumpPage();
|
| int getPage();
|
| void setPage(int page);
|
| boolean isPreviousPageAvailable();
|
| boolean isNextPageAvailable();
|
| void previousPage();
|
| void nextPage();
|
| void destroy();
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035836#4035836
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035836
19 years