Package org.uengine.ui.flowchart.model

Examples of org.uengine.ui.flowchart.model.ProcessDefinitionInfo


    if (chilrenActivity != null) {
      for (int i = 0; i < chilrenActivity.size(); i++) {
        Activity act = chilrenActivity.get(i);
       
        if (act.isHidden() == false) {
          ProcessDefinitionInfo pdInfo = prefixLogic(act);
         
          pdInfo.setName(act.getName().getText());
          pdInfo.setTracingTag(act.getTracingTag());
          if (act instanceof HumanActivity) {
            HumanActivity humanAct = (HumanActivity) act;
            pdInfo.setRoleName(humanAct.getRole().getDisplayName().getText());
            pdInfo.setDuration(String.valueOf(humanAct.getDuration()));
            pdInfo.setDescription(humanAct.getDescription().getText());
          }
         
          if (act instanceof SubProcessActivity) {
            pdInfo.setSubDefId(((SubProcessActivity)act).getDefinitionId());
          }
         
          String activityClassName = act.getClass().toString();
          pdInfo.setType(activityClassName.substring(activityClassName.lastIndexOf(".") + 1, activityClassName.length()));
         
          if (act instanceof SwitchActivity) {
            Condition[] condition = ((SwitchActivity) act).getConditions();
            String[] conditionDescription = new String[condition.length];
            for (int j = 0; j < condition.length; j++) {
              conditionDescription[j] = condition[j].getDescription().getText();
            }
            pdInfo.setCondition(conditionDescription);
          }
         
          pdInfo = suffixLogic(act, pdInfo);
         
          if(act instanceof ComplexActivity) {
            pdInfo.setChildren(makeChildren(((ComplexActivity) act).getChildActivities()));
            if (pdInfo.getChildren() != null) {
              if (pdInfo.getChildren().size() != 0) {
                returnProcessDefinitionInfos.add(pdInfo);
              }
            }
          } else {
            if (this.onlyHumanActivity == true) {
View Full Code Here


  }
 
  @Override
  protected ProcessDefinitionInfo prefixLogic(Activity act) {
   
    ProcessDefinitionInfo pdInfo = new ProcessDefinitionInfo();
   
    if (act instanceof HumanActivity) {
      try {
        HumanActivity humanAct = (HumanActivity) act;
       
        String[] taskId = humanAct.getTaskIds(this.instance);
        if (taskId != null) {
          pdInfo.setTaskId(humanAct.getTaskIds(this.instance)[0]);
        }
       
        String status = act.getStatus(this.instance);
        if (!Activity.STATUS_READY.equals(status)) {
          Calendar cal = null;
          cal = humanAct.getStartedTime(this.instance);
          if (cal != null) {
            pdInfo.setStartedDate(cal.getTime());
            cal = null;
          }
         
          cal = humanAct.getDueDate(this.instance);
          if (cal != null) {
            pdInfo.setDueDate(cal.getTime());
            cal = null;
          }
         
          cal = humanAct.getEndTime(this.instance);
          if (cal != null) {
            pdInfo.setFinishedDate(cal.getTime());
            cal = null;
          }
        }
       
        String endpoint = null;
        Role[] roles = this.pm.getProcessDefinitionRemoteWithInstanceId(this.instance.getInstanceId()).getRoles();
        if (roles != null) {
          for (Role role : roles) {
            if (role.getName().equals(humanAct.getRole().getName())) {
              endpoint = this.pm.getRoleMappingObject(this.instance.getInstanceId(), role.getName()).toString();
              break;
            }
          }
        }
        pdInfo.setEndpoint(endpoint);
      } catch (Exception e) {
        e.printStackTrace();
     
    }
   
    try {
      pdInfo.setStatus(act.getStatus(instance));
    } catch (Exception e) {
      e.printStackTrace();
   
   
    if (act instanceof SubProcessActivity) {
      pdInfo.setSubInstId(((SubProcessActivity)act).getInstanceId());
    }
   
    return pdInfo;
  }
View Full Code Here

public class MakeProcessDefinitionToJSON extends AbstractMakeProcessDefinitionToJSON {

  @Override
  protected ProcessDefinitionInfo prefixLogic(Activity act) {
    return new ProcessDefinitionInfo();
  }
View Full Code Here

TOP

Related Classes of org.uengine.ui.flowchart.model.ProcessDefinitionInfo

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.