Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.ServiceTask


      Object bo = getBusinessObject(pe);
      if (bo == null) {
        return;
      }

      ServiceTask serviceTask = (ServiceTask) bo;
      String implementationName = serviceTask.getImplementation();
      if(StringUtils.isEmpty(serviceTask.getImplementationType()) ||
          ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(serviceTask.getImplementationType())) {
        setVisibleClassType(true);
        setVisibleExpressionType(false);
        setVisibleDelegateExpressionType(false);
        classNameText.setText(implementationName == null ? "" : implementationName);
      } else if (serviceTask.getImplementationType().equals(ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION)) {
        setVisibleClassType(false);
        setVisibleExpressionType(false);
        setVisibleDelegateExpressionType(true);
        delegateExpressionText.setText(implementationName == null ? "" : implementationName);
      } else {
        setVisibleClassType(false);
        setVisibleExpressionType(true);
        setVisibleDelegateExpressionType(false);
        expressionText.setText(implementationName == null ? "" : implementationName);
      }

      if(StringUtils.isNotEmpty(serviceTask.getResultVariableName())) {
        resultVariableText.setText(serviceTask.getResultVariableName());
      } else {
        resultVariableText.setText("");
      }

      fieldEditor.pictogramElement = pe;
      fieldEditor.diagramEditor = getDiagramEditor();
      fieldEditor.diagram = getDiagram();
      fieldEditor.initialize(serviceTask.getFieldExtensions());
      expressionText.addFocusListener(listener);
      delegateExpressionText.addFocusListener(listener);
      resultVariableText.addFocusListener(listener);
    }
  }
View Full Code Here


        DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
        TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
        ActivitiUiUtil.runModelChange(new Runnable() {
          @Override
          public void run() {
            ServiceTask serviceTask = (ServiceTaskbo;
            serviceTask.setImplementationType(type);
            serviceTask.setImplementation("");
          }
        }, editingDomain, "Model Update");
      }

    }
View Full Code Here

    workParent = factory.createFlatFormComposite(parent);

    customServiceTasks = ExtensionUtil.getCustomServiceTasks(ActivitiUiUtil.getProjectFromDiagram(getDiagram()));

    final ServiceTask serviceTask = getServiceTask();

    if (serviceTask != null) {

      CustomServiceTask targetTask = null;

      for (final CustomServiceTask customServiceTask : customServiceTasks) {
        if (customServiceTask.getId().equals(serviceTask.getExtensionId())) {
          targetTask = customServiceTask;
          break;
        }
      }
View Full Code Here

        Object bo = getBusinessObject(getSelectedPictogramElement());
        if (bo == null) {
          return;
        }

        ServiceTask task = (ServiceTask) bo;
        for (final CustomPropertyField field : customPropertyFields) {

          if (!field.isComplex()) {
            storeField(task, field.getCustomPropertyId(), field.getSimpleValue(), null);
          } else {
View Full Code Here

    }
  }
 
  @Override
  protected void writeAdditionalChildElements(BaseElement element, XMLStreamWriter xtw) throws Exception {
    ServiceTask serviceTask = (ServiceTask) element;
    for (FieldExtension fieldExtension : serviceTask.getFieldExtensions()) {
     
      if (StringUtils.isNotEmpty(fieldExtension.getFieldName())) {
       
        if (didWriteExtensionStartElement == false) {
          xtw.writeStartElement(ELEMENT_EXTENSIONS);
View Full Code Here

  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElementMap().get("servicetask");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof ServiceTask);
    assertEquals("servicetask", flowElement.getId());
    ServiceTask serviceTask = (ServiceTask) flowElement;
    assertEquals("servicetask", serviceTask.getId());
    assertEquals("Service task", serviceTask.getName());
   
    List<FieldExtension> fields = serviceTask.getFieldExtensions();
    assertEquals(2, fields.size());
    FieldExtension field = (FieldExtension) fields.get(0);
    assertEquals("testField", field.getFieldName());
    assertEquals("test", field.getStringValue());
    field = (FieldExtension) fields.get(1);
    assertEquals("testField2", field.getFieldName());
    assertEquals("${test}", field.getExpression());
   
    List<ActivitiListener> listeners = serviceTask.getExecutionListeners();
    assertEquals(3, listeners.size());
    ActivitiListener listener = (ActivitiListener) listeners.get(0);
    assertTrue(ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(listener.getImplementationType()));
    assertEquals("org.test.TestClass", listener.getImplementation());
    assertEquals("start", listener.getEvent());
View Full Code Here

    this.customServiceTaskId = customServiceTaskId;
  }

  @Override
  public Object[] create(ICreateContext context) {
    ServiceTask newServiceTask = new ServiceTask();
    newServiceTask.setName("Service Task");
    newServiceTask.setExtensionId(customServiceTaskId);

    // Process custom service tasks
    if (newServiceTask.isExtended()) {

      CustomServiceTask targetTask = findCustomServiceTask(newServiceTask);

      if (targetTask != null) {
        newServiceTask.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_CLASS);
        newServiceTask.setImplementation(targetTask.getRuntimeClassname());
        newServiceTask.setName(targetTask.getName());
      }
    }

    addObjectToContainer(context, newServiceTask, newServiceTask.getName());

    return new Object[] { newServiceTask };
  }
View Full Code Here

    final IGaService gaService = Graphiti.getGaService();

    DiagramBaseShape baseShape = DiagramBaseShape.ACTIVITY;

    if (ExtensionUtil.isCustomServiceTask(addedTask)) {
      final ServiceTask serviceTask = (ServiceTask) addedTask;
      final List<CustomServiceTask> customServiceTasks = ExtensionUtil.getCustomServiceTasks(ActivitiUiUtil.getProjectFromDiagram(getDiagram()));

      CustomServiceTask targetTask = null;

      for (final CustomServiceTask customServiceTask : customServiceTasks) {
        if (customServiceTask.getId().equals(serviceTask.getExtensionId())) {
          targetTask = customServiceTask;
          break;
        }
      }
View Full Code Here

    super(fp, "MailTask", "Add mail task");
  }

  @Override
  public Object[] create(ICreateContext context) {
    ServiceTask newMailTask = new ServiceTask();
    newMailTask.setType(ServiceTask.MAIL_TASK);
    addObjectToContainer(context, newMailTask, "Mail Task");

    return new Object[] { newMailTask };
  }
View Full Code Here

    } else if (context instanceof ManualTask) {
      result = Activator.getImage(PluginImage.IMG_MANUALTASK);
    } else if (context instanceof UserTask) {
      result = Activator.getImage(PluginImage.IMG_USERTASK);
    } else if (context instanceof ServiceTask) {
      ServiceTask serviceTask = (ServiceTask) context;
      if (ServiceTask.MAIL_TASK.equalsIgnoreCase(serviceTask.getType())) {
        result = Activator.getImage(PluginImage.IMG_MAILTASK);
      } else {
        result = Activator.getImage(PluginImage.IMG_SERVICETASK);
      }
    } else if (context instanceof ScriptTask) {
View Full Code Here

TOP

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

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.