Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.FieldExtension


      listener = new ActivitiListener();
      listener.setEvent(event);
      listener.setImplementationType(BpmnXMLConstants.ATTRIBUTE_LISTENER_CLASS);
      listener.setImplementation(AlfrescoConversionConstants.CLASSNAME_SCRIPT_TASK_LISTENER);
     
      FieldExtension scriptFieldElement = new FieldExtension();
      scriptFieldElement.setFieldName(AlfrescoConversionConstants.SCRIPT_TASK_LISTENER_SCRIPT_FIELD_NAME);
      scriptFieldElement.setStringValue(finalScript.toString());
      listener.getFieldExtensions().add(scriptFieldElement);
    }
    return listener;
  }
View Full Code Here


  }
  protected ActivityBehavior createCamelActivityBehavior(Task task, List<FieldExtension> fieldExtensions, BpmnModel bpmnModel) {
    try {
      Class< ? > theClass = null;
      FieldExtension behaviorExtension = null;
      for (FieldExtension fieldExtension : fieldExtensions) {
        if ("camelBehaviorClass".equals(fieldExtension.getFieldName()) && StringUtils.isNotEmpty(fieldExtension.getStringValue())) {
          theClass = Class.forName(fieldExtension.getStringValue());
          behaviorExtension = fieldExtension;
          break;
View Full Code Here

    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()));
View Full Code Here

              String fieldStringValue = item.getText(1);
              String fieldExpression = item.getText(2);
              if(StringUtils.isNotEmpty(fieldName) &&
                      (StringUtils.isNotEmpty(fieldStringValue) || StringUtils.isNotEmpty(fieldExpression))) {
               
                FieldExtension fieldExtension = fieldExtensionExists(serviceTask, fieldName);
                if(fieldExtension != null) {
                  fieldExtension.setStringValue(fieldStringValue);
                  fieldExtension.setExpression(fieldExpression);
                } else {
                  FieldExtension newFieldExtension = new FieldExtension();
                  newFieldExtension.setFieldName(fieldName);
                  newFieldExtension.setStringValue(fieldStringValue);
                  newFieldExtension.setExpression(fieldExpression);
                  serviceTask.getFieldExtensions().add(newFieldExtension);
                }
              }
            }
            removeFieldExtensionsNotInList(getItems(), serviceTask);
View Full Code Here

  }
 
  private void removeFieldExtensionsNotInList(TableItem[] items, ServiceTask serviceTask) {
    Iterator<FieldExtension> entryIterator = serviceTask.getFieldExtensions().iterator();
    while(entryIterator.hasNext()) {
      FieldExtension fieldExtension = entryIterator.next();
      boolean found = false;
      for (TableItem item : items) {
        if(item.getText(0).equals(fieldExtension.getFieldName())) {
          found = true;
          break;
        }
      }
      if(found == false) {
View Full Code Here

          implementation = delegateExpressionText.getText();
        }
        fieldExtensionList = new ArrayList<FieldExtension>();
        if(fieldEditor.getItems() != null) {
          for (TableItem tableItem : fieldEditor.getItems()) {
            FieldExtension fieldModel = new FieldExtension();
            fieldModel.setFieldName(tableItem.getText(0));
            fieldModel.setStringValue(tableItem.getText(1));
            fieldModel.setExpression(tableItem.getText(2));
            fieldExtensionList.add(fieldModel);
          }
        }
        shell.close();
      }
View Full Code Here

          newListener.setImplementationType(dialog.implementationType);
          newListener.setImplementation(dialog.implementation);
          if(AlfrescoUserTask.ALFRESCO_SCRIPT_TASK_LISTENER.equalsIgnoreCase(dialog.implementation) ||
                  AlfrescoScriptTask.ALFRESCO_SCRIPT_EXECUTION_LISTENER.equalsIgnoreCase(dialog.implementation)) {
           
            FieldExtension scriptExtension = new FieldExtension();
            scriptExtension.setFieldName("script");
            scriptExtension.setStringValue(dialog.script);
            newListener.getFieldExtensions().add(scriptExtension);
           
            FieldExtension runAsExtension = new FieldExtension();
            runAsExtension.setFieldName("runAs");
            runAsExtension.setStringValue(dialog.runAs);
            newListener.getFieldExtensions().add(runAsExtension);
           
            FieldExtension scriptProcessorExtension = new FieldExtension();
            scriptProcessorExtension.setFieldName("scriptProcessor");
            scriptProcessorExtension.setStringValue(dialog.scriptProcessor);
            newListener.getFieldExtensions().add(scriptProcessorExtension);
           
          } else {
            setFieldsInListener(newListener, dialog.fieldExtensionList);
          }
View Full Code Here

            listener.setImplementationType(dialog.implementationType);
            if(AlfrescoUserTask.ALFRESCO_SCRIPT_TASK_LISTENER.equalsIgnoreCase(dialog.implementation) ||
                    AlfrescoScriptTask.ALFRESCO_SCRIPT_EXECUTION_LISTENER.equalsIgnoreCase(dialog.implementation)) {
             
              List<FieldExtension> extensionList = listener.getFieldExtensions();
              FieldExtension scriptExtension = null;
              FieldExtension runAsExtension = null;
              FieldExtension scriptProcessorExtension = null;
              for (FieldExtension fieldExtension : extensionList) {
                if ("script".equalsIgnoreCase(fieldExtension.getFieldName())) {
                  scriptExtension = fieldExtension;
                } else if ("runAs".equalsIgnoreCase(fieldExtension.getFieldName())) {
                  runAsExtension = fieldExtension;
                } else if ("scriptProcessor".equalsIgnoreCase(fieldExtension.getFieldName())) {
                  scriptProcessorExtension = fieldExtension;
                }
              }
             
              if (scriptExtension != null) {
                scriptExtension.setStringValue(dialog.script);
              } else {
                scriptExtension = new FieldExtension();
                scriptExtension.setFieldName("script");
                scriptExtension.setStringValue(dialog.script);
                listener.getFieldExtensions().add(scriptExtension);
              }
             
              if (runAsExtension != null) {
                runAsExtension.setStringValue(dialog.runAs);
              } else {
                runAsExtension = new FieldExtension();
                runAsExtension.setFieldName("runAs");
                runAsExtension.setStringValue(dialog.runAs);
                listener.getFieldExtensions().add(runAsExtension);
              }
             
              if (scriptProcessorExtension != null) {
                scriptProcessorExtension.setStringValue(dialog.scriptProcessor);
              } else {
                scriptProcessorExtension = new FieldExtension();
                scriptProcessorExtension.setFieldName("scriptProcessor");
                scriptProcessorExtension.setStringValue(dialog.scriptProcessor);
                listener.getFieldExtensions().add(scriptProcessorExtension);
              }
             
            } else {
              setFieldsInListener(listener, dialog.fieldExtensionList);
View Full Code Here

  private void setFieldsInListener(ActivitiListener listener, List<FieldExtension> fieldList) {
    if(listener != null) {
      listener.getFieldExtensions().clear();
      for (FieldExtension fieldModel : fieldList) {
        FieldExtension fieldExtension = new FieldExtension();
        listener.getFieldExtensions().add(fieldExtension);
        fieldExtension.setFieldName(fieldModel.getFieldName());
        fieldExtension.setStringValue(fieldModel.getStringValue());
        fieldExtension.setExpression(fieldModel.getExpression());
      }
    }
  }
View Full Code Here

    }
    return result;
  }

  protected void setFieldString(String fieldname, String fieldValue, ServiceTask mailTask) {
    FieldExtension fieldExtension = null;
    for(FieldExtension extension : mailTask.getFieldExtensions()) {
      if (fieldname.equalsIgnoreCase(extension.getFieldName())) {
        fieldExtension = extension;
      }
    }
    if (fieldExtension == null) {
      fieldExtension = new FieldExtension();
      fieldExtension.setFieldName(fieldname);
      mailTask.getFieldExtensions().add(fieldExtension);
    }

    if (fieldValue != null && fieldValue.contains("${") || fieldValue.contains("#{")) {
      fieldExtension.setExpression(fieldValue);
    } else {
      fieldExtension.setStringValue(fieldValue);
    }
  }
View Full Code Here

TOP

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

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.