Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.ProcessDefinition


                return;
            }
            if (!(processValue instanceof ProcessDefinition)) {
                context.setError("Error getting diagram info", "The process value is not of type ProcessDefinition");
            }
            final ProcessDefinition processDefinition = (ProcessDefinition) processValue;
            final FileDefinition fileDefinition = processDefinition.getFileDefinition();
            if (! fileDefinition.hasFile("gpd.xml")) {
                targetExpression.setValue(elContext, null);
                context.selectOutcome("success");
                return;
            }
View Full Code Here


     * traverse and access property if it is missing in the default fetchgroup
     */
    Iterator iter = result.iterator();
    while (iter.hasNext())
    {
      ProcessDefinition pd = (ProcessDefinition)iter.next();
      retrieveProcessDefinition(pd);
    }

    return result;
  }
View Full Code Here

            if (idValue instanceof Long) {
                id = ((Long)idValue).longValue();
            } else {
                id = Long.valueOf(idValue.toString()).longValue();
            }
            final ProcessDefinition processDefinition = context.getJbpmContext().getGraphSession().getProcessDefinition(id);
            if (processDefinition == null) {
                context.setError("Error loading process", "No process definition was found with an ID of " + id);
                return;
            }
            targetExpression.setValue(elContext, processDefinition);
View Full Code Here

    {
      processInstance = jbpmContext.newProcessInstance(processDefinitionName);
    }
    else
    {
      ProcessDefinition processDefinition = jbpmContext.getGraphSession().loadProcessDefinition(processDefinitionId);
      processInstance = new ProcessInstance(processDefinition);
    }

    if (key != null)
    {
View Full Code Here

     
      mergedPageflowDefinitions.addAll(((PageflowDeploymentHandler) ((DeploymentStrategy) Contexts.getEventContext().get(StandardDeploymentStrategy.NAME)).getDeploymentHandlers().get(PageflowDeploymentHandler.NAME)).getPageflowDefinitions());
     
      for (String pageflow: mergedPageflowDefinitions)
      {
         ProcessDefinition pd = getPageflowDefinitionFromResource(pageflow);
         pageflowProcessDefinitions.put( pd.getName(), pd );
      }
   }
View Full Code Here

      }
   }

   private void deployProcess(JbpmContext jbpmContext, String definitionResource)
   {
      ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(definitionResource);
      if (log.isDebugEnabled())
      {
         log.debug( "deploying process definition : " + processDefinition.getName() );
      }
      jbpmContext.deployProcessDefinition(processDefinition);
   }
View Full Code Here

   class SeamSubProcessResolver implements SubProcessResolver
   {
      public ProcessDefinition findSubProcess(Element element)
      {
         String subProcessName = element.attributeValue("name");
         ProcessDefinition pageflow = pageflowProcessDefinitions.get(subProcessName);
         return pageflow==null ? DB_SUB_PROCESS_RESOLVER.findSubProcess(element) : pageflow;
      }
View Full Code Here

import org.jbpm.instantiation.Delegation;

public class TaskControllerDbTest extends AbstractDbTestCase {

  public void testTaskControllerWithVariableAccesses() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <task-node name='t'>" +
      "    <task name='clean ceiling'>" +
      "      <controller>" +
      "        <variable name='a' access='read,write' mapped-name='x' />" +
      "        <variable name='b' access='read,write' mapped-name='y' />" +
      "        <variable name='c' access='read,write' />" +
      "      </controller>" +
      "    </task>" +
      "  </task-node>" +
      "</process-definition>"
    );
   
    processDefinition = saveAndReload(processDefinition);
   
    TaskNode taskNode = (TaskNode) processDefinition.getNode("t");
    Task task = taskNode.getTask("clean ceiling");
    TaskController taskController = task.getTaskController();
    assertNotNull(taskController);
    assertNull(taskController.getTaskControllerDelegation());
    List variableAccesses = taskController.getVariableAccesses();
View Full Code Here

    assertNotNull(variableAccesses);
    assertEquals("c", variableAccess.getMappedName());
  }
 
  public void testTaskControllerWithDelegation() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <task-node name='t'>" +
      "    <task name='clean ceiling'>" +
      "      <controller class='my-own-task-controller-handler-class'>" +
      "        --here comes the configuration of the task controller handler--" +
      "      </controller>" +
      "    </task>" +
      "  </task-node>" +
      "</process-definition>"
    );
   
    processDefinition = saveAndReload(processDefinition);
   
    TaskNode taskNode = (TaskNode) processDefinition.getNode("t");
    Task task = taskNode.getTask("clean ceiling");
    TaskController taskController = task.getTaskController();
    assertTrue( (taskController.getVariableAccesses()==null)
                || (taskController.getVariableAccesses().isEmpty()) );
    Delegation taskControllerDelegation = taskController.getTaskControllerDelegation();
View Full Code Here

    assertNotNull(taskControllerDelegation);
    assertEquals("my-own-task-controller-handler-class", taskControllerDelegation.getClassName());
  }
 
  public void testStartTaskController() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state name='t'>" +
      "    <task name='task to start this process'>" +
      "      <controller />" +
      "    </task>" +
      "  </start-state>" +
      "</process-definition>"
    );
   
    processDefinition = saveAndReload(processDefinition);
   
    Task task = processDefinition.getTaskMgmtDefinition().getStartTask();
    assertNotNull(task.getTaskController());
  }
View Full Code Here

TOP

Related Classes of org.jbpm.graph.def.ProcessDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.