2 Replies Latest reply on Sep 29, 2011 8:50 AM by Jhonatas Vicente de Jesus

    Business Rules using Fluent API - JBPM 5

    Jhonatas Vicente de Jesus Newbie

      Business Rules using Fluent API - JBPM 5

      Hello people.

      I wonder how to create business rules or rules of navigation using the Fluent API.
      I found this code below:

      Split split = new Split ();
             
      split.setName ("split");
             
      split.setMetaData ("x", 1);
             
      split.setMetaData ("y", 2);
             
      split.setMetaData ("width", 3);
             
      split.setMetaData ("height", 4);
             
      split.setType (Split.TYPE_XOR);
             
      Connection connection = new ConnectionImpl (split, Node.CONNECTION_DEFAULT_TYPE, actionNode, Node.CONNECTION_DEFAULT_TYPE);
             
      ConstraintImpl Constraint constraint = new ();
             
      constraint.setName ("constraint1 ><&&");
             
      constraint.setPriority (1);
             
      constraint.setDialect ("dialect1");
             
      constraint.setType ("type1");
             
      constraint.setConstraint ("constraint-text1");
             
      split.setConstraint (connection, constraint);
             
      connection = new ConnectionImpl (split, Node.CONNECTION_DEFAULT_TYPE, ruleSetNode, Node.CONNECTION_DEFAULT_TYPE);
             
      ConstraintImpl constraint = new ();
             
      constraint.setName ("constraint2");
             
      constraint.setPriority (2);
             
      constraint.setDialect ("dialect2");
             
      constraint.setType ("type2");
             
      constraint.setConstraint ("constraint-text2");
             
      split.setConstraint (connection, constraint);
             
      process.addNode (split);
             
      new ConnectionImpl (startNode, Node.CONNECTION_DEFAULT_TYPE, split, Node.CONNECTION_DEFAULT_TYPE);

      How could I set an expression? If age> 18 go to XXXX activity, if it goes to another activity.!

      I can not find how to set the terms of navigation.

      Sorry for English, I used google translate!