Examples of FieldOperation


Examples of org.jbpm.pvm.internal.wire.operation.FieldOperation

    addInjection(fieldName, new EnvDescriptor(type));
  }

  /** add a field injection based on a descriptor */
  public void addInjection(String fieldName, Descriptor descriptor) {
    FieldOperation injectionOperation = new FieldOperation();
    injectionOperation.setFieldName(fieldName);
    injectionOperation.setDescriptor(descriptor);
    addOperation(injectionOperation);
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.wire.operation.FieldOperation

  public FieldBinding() {
    super("field");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    FieldOperation fieldOperation = new FieldOperation();
    if (element.hasAttribute("name")) {
      fieldOperation.setFieldName(element.getAttribute("name"));
    } else {
      parse.addProblem("field must have name : "+XmlUtil.toString(element), element);
    }
    Element descriptorElement = XmlUtil.element(element);
    if (descriptorElement!=null) {
      Descriptor descriptor = (Descriptor) parser.parseElement(descriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
      if (descriptor!=null) {
        fieldOperation.setDescriptor(descriptor);
      } else {
        parse.addProblem("unknown descriptor element "+descriptorElement.getTagName()+" inside field operation: "+XmlUtil.toString(element), element);
      }
    } else {
      parse.addProblem("field must have 1 descriptor element out of "+parser.getBindings().getTagNames(WireParser.CATEGORY_DESCRIPTOR)+" as content: "+XmlUtil.toString(element), element);
View Full Code Here

Examples of org.jbpm.pvm.internal.wire.operation.FieldOperation

      objectDescriptor.addInjection("deployers", listDescriptor);
     
    } else {
      // merge the new deployment managers with the existing ones
      objectDescriptor = (ObjectDescriptor) wireDefinition.getDescriptor(descriptorName);
      FieldOperation injection = (FieldOperation) objectDescriptor.getOperations().get(0);
      ListDescriptor existingDescriptor = (ListDescriptor) injection.getDescriptor();
      List<Descriptor> valueDescriptors = existingDescriptor.getValueDescriptors();
      valueDescriptors.addAll(listDescriptor.getValueDescriptors());
    }

    return objectDescriptor;
View Full Code Here

Examples of org.jbpm.pvm.internal.wire.operation.FieldOperation

    addInjection(fieldName, new EnvDescriptor(type));
  }

  /** add a field injection based on a descriptor */
  public void addInjection(String fieldName, Descriptor descriptor) {
    FieldOperation injectionOperation = new FieldOperation();
    injectionOperation.setFieldName(fieldName);
    injectionOperation.setDescriptor(descriptor);
    addOperation(injectionOperation);
  }
View Full Code Here

Examples of org.jbpm.wire.operation.FieldOperation

* @see WireParser
*/
public class FieldBinding implements Binding {

  public Object parse(Element element, Parse parse, Parser parser) {
    FieldOperation fieldOperation = new FieldOperation();
    if (element.hasAttribute("name")) {
      fieldOperation.setFieldName(element.getAttribute("name"));
    } else {
      parse.addProblem("field must have name : "+XmlUtil.toString(element));
    }
    Element descriptorElement = XmlUtil.element(element);
    if (descriptorElement!=null) {
      Descriptor descriptor = (Descriptor) parser.parseElement(descriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
      if (descriptor!=null) {
        fieldOperation.setDescriptor(descriptor);
      } else {
        parse.addProblem("unknown descriptor element "+descriptorElement.getTagName()+" inside field operation: "+XmlUtil.toString(element));
      }
    } else {
      parse.addProblem("field must have 1 descriptor element out of "+parser.getBindings().getTagNames(WireParser.CATEGORY_DESCRIPTOR)+" as content: "+XmlUtil.toString(element));
View Full Code Here

Examples of org.jbpm.wire.operation.FieldOperation

  public Object parse(Element element, Parse parse, Parser parser) {
    TypeRefDescriptor typeRefDescriptor = new TypeRefDescriptor();
    typeRefDescriptor.setContextClass(HibernatePvmDbSession.class);

    FieldOperation persistenceServiceInjection = new FieldOperation();
    persistenceServiceInjection.setFieldName("hibernateSession");
    persistenceServiceInjection.setDescriptor(typeRefDescriptor);
   
    ObjectDescriptor objectDescriptor = new ObjectDescriptor();
    objectDescriptor.setClassName(StandardJobSession.class.getName());
    objectDescriptor.addOperation(persistenceServiceInjection);
   
View Full Code Here

Examples of org.jbpm.wire.operation.FieldOperation

    // inject the command executor
    TypeRefDescriptor commandExecutorDescriptor = new TypeRefDescriptor();
    commandExecutorDescriptor.setContextClass(CommandService.class);

    FieldOperation commandExecutorInjection = new FieldOperation();
    commandExecutorInjection.setFieldName("commandService");
    commandExecutorInjection.setDescriptor(commandExecutorDescriptor);
   
    descriptor.addOperation(commandExecutorInjection);

    if (element.hasAttribute("name")) {
      StringDescriptor nameDescriptor = new StringDescriptor();
      nameDescriptor.setValue(element.getAttribute("name"));
      FieldOperation nameInjection = new FieldOperation();
      nameInjection.setFieldName("name");
      nameInjection.setDescriptor(nameDescriptor);
    }

    parseIntAttribute(element, "threads", descriptor, "nbrOfThreads", parse);
    parseIntAttribute(element, "idle", descriptor, "idleMillis", parse);
    parseIntAttribute(element, "idle-max", descriptor, "idleMillisMax", parse);
View Full Code Here

Examples of org.jbpm.wire.operation.FieldOperation

      String intText = element.getAttribute(attributeName);
      try {
        int intValue = Integer.parseInt(intText);
        IntegerDescriptor intValueDescriptor = new IntegerDescriptor();
        intValueDescriptor.setValue(intValue);
        FieldOperation intValueInjection = new FieldOperation();
        intValueInjection.setFieldName(fieldName);
        intValueInjection.setDescriptor(intValueDescriptor);
        descriptor.addOperation(intValueInjection);
      } catch (NumberFormatException e) {
        parse.addProblem("couldn't parse attribute "+attributeName+" as an integer: "+intText);
      }
    }
View Full Code Here

Examples of org.jbpm.wire.operation.FieldOperation

 
  /** convenience method to add a type based field injection */
  public void addTypedInjection(Class<?> type, String fieldName) {
    TypeRefDescriptor typeRefDescriptor = new TypeRefDescriptor();
    typeRefDescriptor.setEnvironmentClass(type);
    FieldOperation injectionOperation = new FieldOperation();
    injectionOperation.setFieldName(fieldName);
    injectionOperation.setDescriptor(typeRefDescriptor);
    addOperation(injectionOperation);
  }
View Full Code Here

Examples of uk.ac.uea.threadr.util.Operation.FieldOperation

    if (declaredFields.length == 0) return new FieldOperation[0];
   
    /* If there are fields, convert them to FieldOperations. */
    FieldOperation[] fields = new FieldOperation[declaredFields.length];
    for (int i = 0; i < fields.length; i++) {
      fields[i] = new FieldOperation(clazz, declaredFields[i]);
    }
   
    return fields; // Return the FieldOperations.
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.