Examples of SwitchActivity


Examples of org.uengine.kernel.SwitchActivity

  public void afterComplete(Activity activity, ProcessInstance instance)
    throws Exception {

    if(!(activity instanceof SwitchActivity)) return;
   
    SwitchActivity switchActivity = (SwitchActivity)activity;
    int selectionPath = switchActivity.getCurrentStep(instance);
    Long procDefId = new Long(switchActivity.getProcessDefinition().getBelongingDefinitionId());
    Long pathNo = new Long(selectionPath);

    boolean isNew = false;
    long occurrence=0;
    long total=0;

    Long[] occurrenceAndTotal = getOccurrenceAndTotal(switchActivity, selectionPath);
    if(occurrenceAndTotal==null){
      isNew = true;
    }else{
      occurrence=occurrenceAndTotal[0].longValue();
      total=occurrenceAndTotal[1].longValue();
    }
   
    occurrence++;
   
    String sql = (isNew?
    "insert into BPM_AUDIT_PRBLTY(ProcDefId, TracingTag, PathNo, Occurrence) values (?ProcDefId, ?TracingTag, ?PathNo, ?Occurrence)":
    "update BPM_AUDIT_PRBLTY set Occurrence=?Occurrence where (ProcDefId = ?ProcDefId and TracingTag = ?TracingTag and PathNo = ?PathNo)"
    );
    
    BPM_AUDIT_PRBLTY newProbability = (BPM_AUDIT_PRBLTY)GenericDAO.createDAOImpl(
      DefaultConnectionFactory.create(),
      sql,
      BPM_AUDIT_PRBLTY.class
    );
   
    newProbability.setProcDefId(procDefId);
    newProbability.setTracingTag(switchActivity.getTracingTag());
    newProbability.setPathNo(pathNo);
    newProbability.setOccurrence(new Long(occurrence));
   
    newProbability.insert();   
  }
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

      act = new HumanActivity();
      act.setName("set the right person");
      ((HumanActivity) act).setRole(role2);     
      def.addChildActivity(act);
     
      cAct1 = new SwitchActivity();
      cAct1.setName("switch1");
      def.addChildActivity(cAct1);{
        cAct2 = new SequenceActivity();
        cAct1.addChildActivity(cAct2);{
          act = new HumanActivity();
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

 
  protected String getLabel(int i, Activity activity, ProcessInstance instance, Map options){
    try{
      String locale = (String)options.get("locale");
     
      SwitchActivity switchActivity = (SwitchActivity)activity;
     
      boolean isVertical = options.containsKey("vertical");
      boolean isSelected = false;
      if(instance!=null /*&& instance.isRunning(activity.getTracingTag())*/) {
        Activity currChild = (Activity) switchActivity.getChildActivities().get(i);
        if (!instance.getStatus().equals(Activity.STATUS_RUNNING)) {
          if (currChild instanceof ComplexActivity) {
            while (currChild instanceof ComplexActivity) {
              currChild = (Activity) ((ComplexActivity) currChild).getChildActivities().get(0);
            }
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

      sb.append("<img src='"+imageRootPath+"images/end.gif'>");
    } else {
      Vector<GraphActivity> incommings = graphAct.getPrevious();
     
      if (incommings.get(0).getReferenceActivity() instanceof SwitchActivity) {
        SwitchActivity switchActivity = (SwitchActivity) incommings.get(0).getReferenceActivity();
        Vector<Activity> children = switchActivity.getChildActivities();
       
        appendSwitchActivityDescription(act, switchActivity, children, sb);
      }
     
      sb.append(sav.render(act,instance, (act instanceof ComplexActivity ? noDecoratedOption : options)));
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.