Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.StartEvent


    }
    return STENCIL_EVENT_START_NONE;
  }
 
  protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    StartEvent startEvent = (StartEvent) flowElement;

    setPropertyValue(PROPERTY_NONE_STARTEVENT_INITIATOR, startEvent.getInitiator(), propertiesNode);
    setPropertyValue(PROPERTY_FORMKEY, startEvent.getFormKey(), propertiesNode);
   
    addFormProperties(startEvent.getFormProperties(), propertiesNode);
    addEventProperties(startEvent, propertiesNode);
  }
View Full Code Here


    addFormProperties(startEvent.getFormProperties(), propertiesNode);
    addEventProperties(startEvent, propertiesNode);
  }
 
  protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    StartEvent startEvent = new StartEvent();
    startEvent.setInitiator(getPropertyValueAsString(PROPERTY_NONE_STARTEVENT_INITIATOR, elementNode));
    startEvent.setFormKey(getPropertyValueAsString(PROPERTY_FORMKEY, elementNode));
    String stencilId = BpmnJsonConverterUtil.getStencilId(elementNode);
    if (STENCIL_EVENT_START_NONE.equals(stencilId)) {
      convertJsonToFormProperties(elementNode, startEvent);
    } else if (STENCIL_EVENT_START_TIMER.equals(stencilId)) {
      convertJsonToTimerDefinition(elementNode, startEvent);
View Full Code Here

   
    // Test the flow
    org.activiti.bpmn.model.Process process = bpmnModel.getProcesses().get(0);
    List<StartEvent> startEvents = process.findFlowElementsOfType(StartEvent.class);
    assertEquals(1, startEvents.size());
    StartEvent startEvent = startEvents.get(0);
    assertEquals(1, startEvent.getOutgoingFlows().size());
    assertEquals(0, startEvent.getIncomingFlows().size());
   
    String nextElementId = startEvent.getOutgoingFlows().get(0).getTargetRef();
    UserTask userTask = (UserTask) process.getFlowElement(nextElementId);
    assertEquals("First Task", userTask.getName());
   
    assertEquals(1, userTask.getOutgoingFlows().size());
    assertEquals(1, userTask.getIncomingFlows().size());
View Full Code Here

    org.activiti.bpmn.model.Process process = new org.activiti.bpmn.model.Process();

    process.setId("oneTaskProcess");
    process.setName("The one task process");

    StartEvent startEvent = new StartEvent();
    startEvent.setId("start");
    process.addFlowElement(startEvent);

    UserTask userTask = new UserTask();
    userTask.setName("The Task");
    userTask.setId("theTask");
View Full Code Here

    org.activiti.bpmn.model.Process process = new org.activiti.bpmn.model.Process();
    model.addProcess(process);
    process.setId("twoTasksProcess");
    process.setName("The two tasks process");

    StartEvent startEvent = new StartEvent();
    startEvent.setId("start");
    process.addFlowElement(startEvent);

    UserTask userTask = new UserTask();
    userTask.setName("The First Task");
    userTask.setId("task1");
View Full Code Here

    M2Model model = AlfrescoConversionUtil.getContentModel(conversion);
    M2Namespace modelNamespace = model.getNamespaces().get(0);
   
    for(FlowElement flowElement : conversion.getProcess().getFlowElements()) {
      if(flowElement instanceof StartEvent) {
        StartEvent startEvent = (StartEvent) flowElement;
        if(startEvent.getFormKey() == null) {
         
          Module module = AlfrescoConversionUtil.getExtension(conversion).getModules().get(0);
          Configuration detailsForm = module.addConfiguration(EVALUATOR_STRING_COMPARE,
              MessageFormat.format(EVALUATOR_CONDITION_ACTIVITI, conversion.getProcess().getId()));
         
          // No form-key is set, either use the default or generate of start-form if this
          // is available
          if(conversion.getWorkflowDefinition().getStartFormDefinition() != null
              && !conversion.getWorkflowDefinition().getStartFormDefinition().getFormGroups().isEmpty()) {
           
            // Create the content model for the start-task
            M2Type type = new M2Type();
         
            model.getTypes().add(type);
            type.setName(AlfrescoConversionUtil.getQualifiedName(modelNamespace.getPrefix(),
                AlfrescoConversionConstants.START_TASK_SIMPLE_NAME));
            type.setParentName(AlfrescoConversionConstants.DEFAULT_START_FORM_TYPE);
           
            // Create a form-config for the start-task
            Module shareModule = AlfrescoConversionUtil.getExtension(conversion).getModules().get(0);
            Configuration configuration = shareModule.addConfiguration(AlfrescoConversionConstants.EVALUATOR_TASK_TYPE
                , type.getName());
            Form formConfig = configuration.createForm();
            formConfig.setStartForm(true);
           
            // Populate model and form based on FormDefinition
            formCreator.createForm(type, formConfig, conversion.getWorkflowDefinition().getStartFormDefinition(), conversion);
           
            // Use the same form-config for the workflow details
            detailsForm.addForm(formConfig);
           
            // Set formKey on start-event, referencing type
            startEvent.setFormKey(type.getName());
          } else {
            // Revert to the default start-form
            startEvent.setFormKey(DEFAULT_START_FORM_TYPE);
           
            // Also add form-config to the share-module for workflow detail screen, based on the default form
            populateDefaultDetailFormConfig(detailsForm);
          }
         
View Full Code Here

    org.activiti.bpmn.model.Process process = new org.activiti.bpmn.model.Process();
    model.addProcess(process);
    process.setId("oneTaskProcess");
    process.setName("The one task process");
  
    StartEvent startEvent = new StartEvent();
    startEvent.setId("start");
    process.addFlowElement(startEvent);
   
    UserTask userTask = new UserTask();
    userTask.setName("The Task");
    userTask.setId("theTask");
View Full Code Here

    org.activiti.bpmn.model.Process process = new org.activiti.bpmn.model.Process();
    model.addProcess(process);
    process.setId("twoTasksProcess");
    process.setName("The two tasks process");
  
    StartEvent startEvent = new StartEvent();
    startEvent.setId("start");
    process.addFlowElement(startEvent);
   
    UserTask userTask = new UserTask();
    userTask.setName("The First Task");
    userTask.setId("task1");
View Full Code Here

    BpmnModel bpmnModel = new BpmnModel();
    Process process = new Process();
    process.setId("simpleProcess");
    process.setName("Very simple process");
    bpmnModel.getProcesses().add(process);
    StartEvent startEvent = new StartEvent();
    startEvent.setId("startEvent1");
    TimerEventDefinition timerDef = new TimerEventDefinition();
    timerDef.setTimeDuration("PT5M");
    startEvent.getEventDefinitions().add(timerDef);
    ActivitiListener listener = new ActivitiListener();
    listener.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION);
    listener.setImplementation("${test}");
    listener.setEvent("end");
    startEvent.getExecutionListeners().add(listener);
    process.addFlowElement(startEvent);
    UserTask task = new UserTask();
    task.setId("reviewTask");
    task.setAssignee("kermit");
    process.addFlowElement(task);
View Full Code Here

      return false;
    return super.canCreate(context);
  }

  public Object[] create(ICreateContext context) {
    StartEvent startEvent = new StartEvent();
    MessageEventDefinition  timerEvent = new MessageEventDefinition();
    startEvent.getEventDefinitions().add(timerEvent);
    addObjectToContainer(context, startEvent, "Message start");

    // return newly created business object(s)
    return new Object[] { startEvent };
  }
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.StartEvent

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.