[jboss-user] [jBPM] - jBPM5 and Seam 2.2.2 at jBoss 6 Server

nt2005 do-not-reply at jboss.com
Sat Jan 14 02:10:19 EST 2012


nt2005 [https://community.jboss.org/people/nt2005] created the discussion

"jBPM5 and Seam 2.2.2 at jBoss 6 Server"

To view the discussion, visit: https://community.jboss.org/message/646810#646810

--------------------------------------------------------------
Hey Guys,

I still have got a problem implement jBPM5 into seam. Okay, here ist what I have done in Eclipse:

Create a new project "Seam 2 Web Project" as EAR.
Update the standard libraries with that from jBPM 5.2 Runtime:

drools-core-5.3.1
drools-compiler-5.3.1
knowledge-api-5.3.
org.eclipse.jdt.core
All available libaries of jBPM 5.2.0
and btm-2.1.2.

I delete also the old libraries (that I have overwrited with the new ones).

I have seam 



package org.domain.process.session;
 
import javax.ejb.Remove;
import javax.ejb.Stateful;
 
import org.drools.KnowledgeBase;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.log.Log;
import org.jboss.seam.international.StatusMessages;
import org.jboss.seam.annotations.Destroy;
 
@Stateful
@Name("processHandler")
public class ProcessBean implements ProcessHandler
{
    private static final String MARKER = "------------------------";
 
    // add additional action methods
 
    public void start() {
        
        System.out.println("Okay, lets start the process!");
        
        KnowledgeBase kbase = readKnowledgeBase();
        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        ksession.startProcess("com.nt.myprocess");
        
    }
    
    private KnowledgeBase readKnowledgeBase() {
        log.info(MARKER +" readKnowledgeBase() "+ MARKER);
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        kbuilder.add(ResourceFactory.newClassPathResource("resources/process.bpmn"), ResourceType.BPMN2);
        
        return kbuilder.newKnowledgeBase();
    }
 
    @Destroy
    @Remove
    public void destroy() {}
 
}
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/646810#646810]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120114/5a3870cc/attachment.html 


More information about the jboss-user mailing list