1 Reply Latest reply on Dec 1, 2006 11:08 AM by pravot

    Invoke POJO or EJB Services

      HI All,

      I am new to to JBoss jBPM and I was wondering if there is a way to invoke services that are POJO or let's say Session beans using jBPM.
      here is a senario that all of your services no matter what is the type of your service they have a execute or processRequest method that gets a message , for instance xml, and then executes the process that it's suppose to do.
      can anyone provide me with a sample or somthing?
      i really appreciate your helps guys

      thanks,

        • 1. Re: Invoke POJO or EJB Services
          pravot

          Hello as far as i now there is no "off the shelf" parameters to plug an EJB on an action handler (although i did not dig into Jira requests) but you can easily code it :

           public void execute(ExecutionContext context) throws Exception {
           String sessionName = (String) context.getContextInstance().getVariable(
           "SessionName");
           EcnAction remote = null;
           try {
           InitialContext ctx = new InitialContext();
           remote = (EcnAction) ctx.lookup(localAdress);
           remote.session(sessionName);
           } catch (Exception e) {
           log.error("Cannot marshal " + localAdress + "-" + e.getMessage());
           }
           remote. blablab
           context.leaveNode();
          }
          
          

          Hope this helps