Package org.drools.process.core

Examples of org.drools.process.core.Work


      work.setParameter("TaskName", taskName);
      return this;
    }
   
    public HumanTaskNodeFactory actorId(String actorId) {
      Work work = getHumanTaskNode().getWork();
      if (work == null) {
        work = new WorkImpl();
        getHumanTaskNode().setWork(work);
      }
      work.setParameter("ActorId", actorId);
      return this;
    }
View Full Code Here


      work.setParameter("ActorId", actorId);
      return this;
    }
   
    public HumanTaskNodeFactory priority(String priority) {
      Work work = getHumanTaskNode().getWork();
      if (work == null) {
        work = new WorkImpl();
        getHumanTaskNode().setWork(work);
      }
      work.setParameter("Priority", priority);
      return this;
    }
View Full Code Here

      work.setParameter("Priority", priority);
      return this;
    }
   
    public HumanTaskNodeFactory comment(String comment) {
      Work work = getHumanTaskNode().getWork();
      if (work == null) {
        work = new WorkImpl();
        getHumanTaskNode().setWork(work);
      }
      work.setParameter("Comment", comment);
      return this;
    }
View Full Code Here

      work.setParameter("Comment", comment);
      return this;
    }
   
    public HumanTaskNodeFactory skippable(boolean skippable) {
      Work work = getHumanTaskNode().getWork();
      if (work == null) {
        work = new WorkImpl();
        getHumanTaskNode().setWork(work);
      }
      work.setParameter("Skippable", Boolean.toString(skippable));
      return this;
    }
View Full Code Here

      work.setParameter("Skippable", Boolean.toString(skippable));
      return this;
    }
   
    public HumanTaskNodeFactory content(String content) {
      Work work = getHumanTaskNode().getWork();
      if (work == null) {
        work = new WorkImpl();
        getHumanTaskNode().setWork(work);
      }
      work.setParameter("Content", content);
      return this;
    }
View Full Code Here

                }
                if (workItemNode.getWork() == null) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "WorkItem node '" + node.getName() + "' [" + node.getId() + "] has no work specified."));
                } else {
                    Work work = workItemNode.getWork();
                    if (work.getName() == null) {
                        errors.add(new ProcessValidationErrorImpl(process,
                            "WorkItem node '" + node.getName() + "' [" + node.getId() + "] has no work name."));
                    }
                }
                if (workItemNode.getTimers() != null) {
View Full Code Here

    private static final long serialVersionUID = 510l;

    private String swimlane;
   
    public HumanTaskNode() {
        Work work = new WorkImpl();
        work.setName("Human Task");
        Set<ParameterDefinition> parameterDefinitions = new HashSet<ParameterDefinition>();
        parameterDefinitions.add(new ParameterDefinitionImpl("TaskName", new StringDataType()));
        parameterDefinitions.add(new ParameterDefinitionImpl("ActorId", new StringDataType()));
        parameterDefinitions.add(new ParameterDefinitionImpl("Priority", new StringDataType()));
        parameterDefinitions.add(new ParameterDefinitionImpl("Comment", new StringDataType()));
        parameterDefinitions.add(new ParameterDefinitionImpl("Skippable", new StringDataType()));
        parameterDefinitions.add(new ParameterDefinitionImpl("Content", new StringDataType()));
        // TODO: initiator
        // TODO: attachments
        // TODO: deadlines
        // TODO: delegates
        // TODO: recipients
        // TODO: ...
        work.setParameterDefinitions(parameterDefinitions);
        setWork(work);
    }
View Full Code Here

    value = (String) work.getParameter("Locale");
    localeText.setText(value == null ? "en-UK" : value.toString());
  }

  private void createReassignmentTab(TabFolder tabFolder) {
    Work work = (Work) getValue();
   
    String notStartedReassign = (String) work.getParameter("NotStartedReassign");
    String notCompletedReassign = (String) work.getParameter("NotCompletedReassign");
   
    if (notStartedReassign != null) {
      String[] reassigns = notStartedReassign.split(COMPONENT_SEPARATOR_ESCAPED);
     
      for (String reassign : reassigns) {
View Full Code Here

            }
        });
  }
 
  private void createNotificationTab(TabFolder tabFolder) {
    Work work = (Work) getValue();
   
    String notStartedNotify = (String) work.getParameter("NotStartedNotify");
    String notCompletedNotify = (String) work.getParameter("NotCompletedNotify");
   
    if (notStartedNotify != null) {
      String[] notifies = notStartedNotify.split(COMPONENT_SEPARATOR_ESCAPED);
     
      for (String notification : notifies) {
View Full Code Here

        });
   
  }

  protected Work updateValue(Work value) {
        Work work = new WorkImpl();
        work.setName("Human Task");
        work.setParameter("TaskName", nameText.getText());
        work.setParameter("ActorId", actorText.getText());
        work.setParameter("GroupId", groupText.getText());
        work.setParameter("Comment", commentText.getText());
        work.setParameter("Priority", priorityText.getText());
        work.setParameter("Skippable", skippableButton.getSelection() + "");
        String content = contentText.getText();
        work.setParameter("Content", content.trim().length() == 0 ? null : content);
        work.setParameter("Locale", localeText.getText());
       
        // process reassignment
        if (!reassignments.isEmpty()) {
          StringBuffer notStartedReassignments = new StringBuffer();
          StringBuffer notCompletedReassignments = new StringBuffer();
          for (Reassignment reassign : reassignments) {
            if ("not-started".equalsIgnoreCase(reassign.getTypeAsString())) {
              if (notStartedReassignments.length() > 0) {
                notStartedReassignments.append(COMPONENT_SEPARATOR);
              }
              notStartedReassignments.append(reassign.toDataInput());
            } else if ("not-completed".equalsIgnoreCase(reassign.getTypeAsString())) {
              if (notCompletedReassignments.length() > 0) {
                notCompletedReassignments.append(COMPONENT_SEPARATOR);
              }
              notCompletedReassignments.append(reassign.toDataInput());
            }
          }
          if (notStartedReassignments.length() > 0) {
            work.setParameter("NotStartedReassign", notStartedReassignments.toString());
          }
          if (notCompletedReassignments.length() > 0) {
            work.setParameter("NotCompletedReassign", notCompletedReassignments.toString());
          }
        }
       
        // process notifications
        if (!notifications.isEmpty()) {
          StringBuffer notStartedNotifications = new StringBuffer();
          StringBuffer notCompletedNotifications = new StringBuffer();
          for (Notification notification : notifications) {
            if ("not-started".equalsIgnoreCase(notification.getType())) {
              if (notStartedNotifications.length() > 0) {
                notStartedNotifications.append(COMPONENT_SEPARATOR);
              }
              notStartedNotifications.append(notification.toDataInput());
            } else if ("not-completed".equalsIgnoreCase(notification.getType())) {
              if (notCompletedNotifications.length() > 0) {
                notCompletedNotifications.append(COMPONENT_SEPARATOR);
              }
              notCompletedNotifications.append(notification.toDataInput());
            }
          }
          if (notStartedNotifications.length() > 0) {
            work.setParameter("NotStartedNotify", notStartedNotifications.toString());
          }
          if (notCompletedNotifications.length() > 0) {
            work.setParameter("NotCompletedNotify", notCompletedNotifications.toString());
          }
        }
       
       
        work.setParameterDefinitions(((Work) value).getParameterDefinitions());
        return work;
    }
View Full Code Here

TOP

Related Classes of org.drools.process.core.Work

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.