コード例 #1
0
  public String toXML() {
    StringBuilder xml = new StringBuilder("<allocate ");
    xml.append("initiator=\"").append(getInitiatorString()).append("\">");

    if (isSystemInitiated()) if (_allocator != null) xml.append(_allocator.toXML());
    xml.append("</allocate>");
    return xml.toString();
  }
コード例 #2
0
  public void parse(Element e, Namespace nsYawl) throws ResourceParseException {
    parseInitiator(e, nsYawl);

    Element eAllocator = e.getChild("allocator", nsYawl);
    if (eAllocator != null) {
      String allocatorClassName = eAllocator.getChildText("name", nsYawl);
      if (allocatorClassName != null) {
        _allocator = AllocatorFactory.getInstance(allocatorClassName);
        if (_allocator != null) _allocator.setParams(parseParams(eAllocator, nsYawl));
        else throw new ResourceParseException("Unknown allocator name: " + allocatorClassName);
      } else throw new ResourceParseException("Missing allocator element: name");
    }
  }
コード例 #3
0
 public Participant performAllocation(Set offerSet, WorkItemRecord wir) {
   return _allocator.performAllocation(offerSet, wir);
 }