2 Replies Latest reply on Jan 30, 2006 2:54 PM by Ktdr

    deploying actions on process definitions

    Ktdr Newbie

      Hello,

      I'm deploying a process definition with this code:
      import java.util.List;

      import org.jbpm.db.GraphSession;
      import org.jbpm.db.JbpmSession;
      import org.jbpm.db.JbpmSessionFactory;
      import org.jbpm.graph.def.ProcessDefinition;
      import org.jbpm.graph.exe.ProcessInstance;
      import org.jbpm.graph.exe.Token;

      public class despliegue {
      static JbpmSessionFactory jbpmSessionFactory = JbpmSessionFactory.buildJbpmSessionFactory();

      /** Creates a new instance of despliegue */
      public despliegue() {
      }
      public static void main(String args[]){
      ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      " <process-definition"+
      " name='flujo_fac_elec'>"+
      " <start-state name='est_inicio' >"+
      " "+
      " </start-state>"+
      " "+
      " "+
      " "+
      " "+
      " "+
      " "+
      " "+
      " "+
      " "+
      " "+
      " "+
      " "+
      " <end-state name='fin'></end-state>"+
      " </process-definition>"
      );

      // Let's open a new persistence session
      JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession();
      // ... and begin a transaction on the persistence session
      jbpmSession.beginTransaction();

      // Save the process definition in the database
      jbpmSession
      .getGraphSession()
      .saveProcessDefinition(processDefinition);

      // Commit the transaction
      jbpmSession.commitTransaction();
      // And close the jbpmSession.
      jbpmSession.close();

      but what's up with actions??? because, doesn't it's deployed on database?... how save actions deployer process on eclipse...? insert actions on database? classpath? if i use this code i must put class files on classpath??

      thanks for any help or idea,

      Ktdr