OK

but i think i have a probleme with the persistance.

i deployd withd graphsession.deploy(processDefinition);

but the definition cant be found


thats my code :

package de.fhkl.bda;
  | 
  | import java.util.List;
  | import java.util.Map;
  | import java.util.Set;
  | 
  | import org.jbpm.JbpmConfiguration;
  | import org.jbpm.JbpmContext;
  | import org.jbpm.db.GraphSession;
  | import org.jbpm.graph.def.ProcessDefinition;
  | import org.jbpm.graph.exe.ProcessInstance;
  | import org.jbpm.graph.exe.Token;
  | import org.jbpm.identity.Entity;
  | import org.jbpm.identity.xml.IdentityXmlParser;
  | 
  | public class TestClass {
  |     private static String actorID = "1";
  |     /**
  |      * @param args
  |      */
  |     public static void main(String[] args) {
  |             JbpmConfiguration.getInstance().createSchema();
  |             JbpmContext jbpmContext = 
JbpmConfiguration.getInstance().createJbpmContext();
  |             
  |             try { 
  |                     GraphSession graphSession = 
jbpmContext.getGraphSession();
  |                     ProcessDefinition processDefinition = 
findProcessDefinitionsFromServer("SimpleDefinition1", graphSession);
  |                     System.out.println(processDefinition.getId());  
  |             }
  |             finally {
  |                     jbpmContext.close();
  |             }
  |     }
  |     
  |     public static void deployProcessDefinition(GraphSession graphSession) {
  |             ProcessDefinition processDefinition = ProcessDefinition
  |             .parseXmlString( "<process-definition 
name='SimpleDefinition1'>" 
  |                             + "  <start-state name='start'>"
  |                             + "    <transition to='s' />" 
  |                             + "  </start-state>" 
  |                             + "  <state name='s'>"
  |                             + "    <transition to='t' />" 
  |                             + "  </state>" 
  |                             + "  <state name='t'>"
  |                             + "    <transition to='end' />" 
  |                             + "  </state>" 
  |                             + "  <end-state name='end' />"
  |                             + "</process-definition>" );
  |             graphSession.deployProcessDefinition(processDefinition);
  |     }
  |     
  |     public static ProcessDefinition findProcessDefinitionsFromServer(String 
name, GraphSession graphSession) {
  |             ProcessDefinition processDefinition = 
  |               graphSession.findLatestProcessDefinition(name);
  |             if(processDefinition == null) System.out.println("No process 
definitions found for '" + name + "' !!!");
  |             return processDefinition;
  |     }
  | }
  | 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962131
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to