Package org.huihoo.workflow.xpdl.activity

Examples of org.huihoo.workflow.xpdl.activity.Implementation


      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      List activies = workflowProcess.getWorkflowActivities();
      int activitySize = activies.size();

      WorkflowActivity activity = null;
      Implementation impl = null;
      ToolImplementation toolImpl = null;
      ToolSet toolSet = null;
      SubFlowImplementation subFlowImpl = null;

      for (int j = 0; j < activitySize; ++j)
View Full Code Here


      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      List activies = workflowProcess.getWorkflowActivities();
      int activitySize = activies.size();

      WorkflowActivity activity = null;
      Implementation impl = null;
      ExtendedAttribute attribute = null;
      for (int j = 0; j < activitySize; ++j)
      {
        activity = (WorkflowActivity) activies.get(j);
        attribute = (ExtendedAttribute) activity.findExtendedAttribute(XPDLGlobals.ACTIVITY_TYPE);
        if (attribute != null)
        {
          activity.setActivityType(ActivityType.parse(attribute.getValue()));
          activity.removeExtendedAttribute(XPDLGlobals.ACTIVITY_TYPE);
        }
      }
    }

    //  ---------------------------------------------------------------
    //   4. format activity implementation
    //  ---------------------------------------------------------------
    for (int i = 0; i < processList.size(); ++i)
    {
      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      List activies = workflowProcess.getWorkflowActivities();
      int activitySize = activies.size();

      WorkflowActivity activity = null;
      Implementation impl = null;
      ExtendedAttribute attribute = null;
      for (int j = 0; j < activitySize; ++j)
      {
        activity = (WorkflowActivity) activies.get(j);
        impl = activity.getImplementation();
        if (impl != null)
        {
          if (impl instanceof NoImplementation)
          {
            attribute = activity.findExtendedAttribute(XPDLGlobals.PAGE_URL);
            if (attribute != null)
            {
              activity.setImplementation(new PageImplementation(attribute.getValue()));
            }
          }
        }
      }
    }

    //  ---------------------------------------------------------------
    //   5. format performer type
    //  ---------------------------------------------------------------
    for (int i = 0; i < processList.size(); ++i)
    {
      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      List activies = workflowProcess.getWorkflowActivities();
      int activitySize = activies.size();

      WorkflowActivity activity = null;
      Implementation impl = null;
      ExtendedAttribute attribute = null;
      for (int j = 0; j < activitySize; ++j)
      {
        activity = (WorkflowActivity) activies.get(j);
        attribute = (ExtendedAttribute) activity.findExtendedAttribute(XPDLGlobals.PERFORMER_TYPE);
        if (attribute != null)
        {
          activity.setPerformerType(PerformerType.parse(attribute.getValue()));
          activity.removeExtendedAttribute(XPDLGlobals.PERFORMER_TYPE);
        }
      }
    }

    //  ---------------------------------------------------------------
    //   6. format application QualifiedClassName
    //  --------------------------------------------------------------- 
    List wfApps = workflowPackage.getWorkflowApplications();
    int wfAppSize = wfApps.size();
    WorkflowApplication wfApp = null;
    for (int i = 0; i < wfAppSize; ++i)
    {
      wfApp = (WorkflowApplication) wfApps.get(i);
      ExtendedAttribute attribute = wfApp.findExtendedAttribute(XPDLGlobals.APPLICATION_QUALIFIED_CLASS_NAME);
      if (attribute != null)
      {
        wfApp.setQualifiedClassName(attribute.getValue());
        wfApp.removeExtendedAttribute(XPDLGlobals.APPLICATION_QUALIFIED_CLASS_NAME);
      }
    }

    //  ---------------------------------------------------------------
    //   7. validate workflowActivity Implementation & ActivityType
    //  ---------------------------------------------------------------   
    for (int i = 0; i < process_size; ++i)
    {
      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      List activies = workflowProcess.getWorkflowActivities();
      int activitySize = activies.size();

      WorkflowActivity activity = null;
      Implementation impl = null;
      ToolImplementation toolImpl = null;
      ToolSet toolSet = null;
      SubFlowImplementation subFlowImpl = null;

      for (int j = 0; j < activitySize; ++j)
      {
        activity = (WorkflowActivity) activies.get(j);
        impl = activity.getImplementation();
        if (ActivityType.ACTIVITY_BUSINESS.equals(activity.getActivityType()))
        {
          if (impl != null && (impl instanceof SubFlowImplementation))
          {
            errorList.add(
              new WorkflowException(
                "ActivityType 'ACTIVITY_BUSINESS' Implementation can not be 'SubFlow'.{packageID="
                  + workflowPackage.getUUID()
                  + ",processID="
                  + workflowProcess.getUUID()
                  + ",activityID="
                  + activity.getUUID()
                  + "}"));
          }
        }

        if (ActivityType.ACTIVITY_SUBFLOW.equals(activity.getActivityType()))
        {
          if (impl != null && !(impl instanceof SubFlowImplementation))
          {
            errorList.add(
              new WorkflowException(
                "ActivityType 'ACTIVITY_SUBFLOW' Implementation must be 'SubFlow'.{packageID="
                  + workflowPackage.getUUID()
                  + ",processID="
                  + workflowProcess.getUUID()
                  + ",activityID="
                  + activity.getUUID()
                  + "}"));
          }
        }

        if (ActivityType.ACTIVITY_ROUTE.equals(activity.getActivityType()))
        {
          if (impl != null && !(impl instanceof NoImplementation))
          {
            errorList.add(
              new WorkflowException(
                "ActivityType 'ACTIVITY_ROUTE' Implementation must be 'No'.{packageID="
                  + workflowPackage.getUUID()
                  + ",processID="
                  + workflowProcess.getUUID()
                  + ",activityID="
                  + activity.getUUID()
                  + "}"));
          }
        }

      }
    }

    //  ---------------------------------------------------------------
    //   8. format workflowProcess  listener class name
    //  --------------------------------------------------------------- 
    for (int i = 0; i < process_size; ++i)
    {
      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      ExtendedAttribute attribute = workflowProcess.findExtendedAttribute(XPDLGlobals.LISTENER_QUALIFIED_CLASS_NAME);
      if (attribute != null)
      {
        workflowProcess.setListenerClassName(attribute.getValue());
        workflowProcess.removeExtendedAttribute(XPDLGlobals.LISTENER_QUALIFIED_CLASS_NAME);
      }
    }

    //  ---------------------------------------------------------------
    //   9. format workflowActivity  listener class name
    //  --------------------------------------------------------------- 
    for (int i = 0; i < processList.size(); ++i)
    {
      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      List activies = workflowProcess.getWorkflowActivities();
      int activitySize = activies.size();

      WorkflowActivity activity = null;
      Implementation impl = null;
      ExtendedAttribute attribute = null;
      for (int j = 0; j < activitySize; ++j)
      {
        activity = (WorkflowActivity) activies.get(j);
        attribute = (ExtendedAttribute) activity.findExtendedAttribute(XPDLGlobals.LISTENER_QUALIFIED_CLASS_NAME);
View Full Code Here

     
    this.arriveTime=workflowWork.getArriveTime();
    this.acceptTime=workflowWork.getAcceptTime();
    this.dispatchTime=workflowWork.getDispatchTime();
   
    Implementation impl=workflowActivity.getImplementation();
    if(impl instanceof PageImplementation)
    {
      this.pageURL=((PageImplementation)impl).getPageURL();
    }
  }
View Full Code Here

    this.performer=performer_;
  }
 
  public void    execute()    throws WorkflowException
  {
    Implementation impl=activity.getImplementation();
    impl.execute(this);
  }
View Full Code Here

    {
      listeners[i].beforeAccepted(event);
    }
    workflowWork.setAcceptTime(new java.util.Date());
    caseDatabase.updateWorkflowWork(workflowProcess, operator, userTransaction, workflowWork);
    Implementation impl = activity.getImplementation();

    WorkflowServiceBase context=(WorkflowServiceBase)workflowService;
    ClassLoader loader=context.getLoader().getClassLoader();
   
    impl.execute(workflowWork,loader);

    for (int i = 0; i < listeners.length; ++i)
    {
      listeners[i].afterAccepted(event);
    }
View Full Code Here

      "[dispatch_control] workitem: " + workflowWork.getInfo() + " | transition: " + workflowTransition.getInfo());
   
    WorkflowActivity fromActivity=workflowWork.getWorkflowActivity();   
    WorkflowActivity toActivity = workflowTransition.getToWorkflowActivity();
   
    Implementation impl = toActivity.getImplementation();
    if (impl instanceof SubFlowImplementation)
    {
      //-----------------------------------------------------------
      // ���������̴����߼�
      //-----------------------------------------------------------
View Full Code Here

    throws WorkflowException, ScriptException
  {
    log.debug("[execute_dispatchIfNecessary] workitem: " + workflowWork.getInfo());

    WorkflowActivity workActivity = workflowWork.getWorkflowActivity();
    Implementation impl = workActivity.getImplementation();
    if (impl instanceof SubFlowImplementation)
    {
      return accept_core(workflowService,workflowProcess, operator, caseDatabase, userTransaction, workflowWork)
        && dispatch_core(workflowService,workflowProcess, operator, caseDatabase, userTransaction, workflowWork);
    }
View Full Code Here

TOP

Related Classes of org.huihoo.workflow.xpdl.activity.Implementation

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.