[jboss-user] [JBoss jBPM] - Re: HowTo: Use JBPM4 API (on JBoss 5)

2009-07-30 Thread JimDwyer
You need to built a little java class with a method like this:  

public void startWorkflow(){
try{
InitialContext ctx = new InitialContext();
ProcessEngine processEngine = 
(ProcessEngine)ctx.lookup("java:/ProcessEngine");

// ProcessEngine and Services are to be used as 
singletons.  (ie they are threadsafe)
RepositoryService repositoryService = 
processEngine.getRepositoryService();
ExecutionService executionService = 
processEngine.getExecutionService();
TaskService taskService = processEngine.getTaskService();
HistoryService historyService = 
processEngine.getHistoryService();
ManagementService managementService = 
processEngine.getManagementService();

   
ProcessInstance processInstance = 
executionService.startProcessInstanceByKey("AsyncActivity");
System.out.println("ProcessId: " + 
processInstance.getId());

}catch (NamingException ne){
System.out.println(ne);
}



Then call that from a jsp or something.  

 <%jsp useBean id="bean" class="org.someco.Test" scope="session" />
 <% bean.startWorkflow(); %>

Package the class and jsp into a war, deploy the war on the jboss.  

That should do it.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246949#4246949

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246949
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: HowTo: Use JBPM4 API (on JBoss 5)

2009-07-30 Thread djcye
But the 

"new InitialContext().lookup("java:/ProcessEngine")"

Have to take place inside the JBoss right ? Has somone an example for this ?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246920#4246920

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246920
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: HowTo: Use JBPM4 API (on JBoss 5)

2009-07-30 Thread jbarrez
Exactly. If you use the demo setup provided by the distribution, you can use 
the ProcessEngine which is bound to JNDI. You can adapt the database 
configuration in the jbpm folder (under deploy) for your database.

Another solution is just to use jBPM as a standalone Jar, and creating a 
process engine using new Configuration().buildProcessEngine(). You can store 
this object in a static field for example (it's thread-safe).

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246903#4246903

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246903
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: HowTo: Use JBPM4 API (on JBoss 5)

2009-07-29 Thread JimDwyer
>From the usersguide, section 2.6

In JBoss, the ProcessEngine can be obtained from JNDI with
 
new InitialContext().lookup("java:/ProcessEngine")

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246789#4246789

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246789
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss jBPM] - Re: HowTo: Use JBPM4 API (on JBoss 5)

2009-07-29 Thread JimDwyer
I was wondering the same thing myself.  Do I use JNDI, @EJB?  How does it work 
now?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246748#4246748

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246748
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user