Examples of WorkflowProcess


Examples of org.drools.definition.process.WorkflowProcess

    parser.startElementBuilder(localName, attrs);

    String id = attrs.getValue("id");
    String name = attrs.getValue("name");
   
    WorkflowProcess process = (WorkflowProcess) parser.getParent();
       
    List<Lane> lanes = (List<Lane>)
            ((RuleFlowProcess) process).getMetaData(LaneHandler.LANES);         
        if (lanes == null) {
            lanes = new ArrayList<Lane>();
View Full Code Here

Examples of org.drools.definition.process.WorkflowProcess

            throw new IllegalArgumentException("Could not find process instance " + processInstanceId);
        }
        if (processId == null) {
            throw new IllegalArgumentException("Null process id");
        }
        WorkflowProcess process = (WorkflowProcess)
            kruntime.getKnowledgeBase().getProcess(processId);
        if (process == null) {
            throw new IllegalArgumentException("Could not find process " + processId);
        }
        if (processInstance.getProcessId().equals(processId)) {
View Full Code Here

Examples of org.drools.definition.process.WorkflowProcess

            throw new IllegalArgumentException("Could not find process instance " + processInstanceId);
        }
        if (processId == null) {
            throw new IllegalArgumentException("Null process id");
        }
        WorkflowProcess process = (WorkflowProcess)
            ((InternalRuleBase) workingMemory.getRuleBase()).getProcess(processId);
        if (process == null) {
            throw new IllegalArgumentException("Could not find process " + processId);
        }
        if (processInstance.getProcessId().equals(processId)) {
            return;
        }
        ((WorkflowProcessInstanceImpl) processInstance).disconnect();
        ((ProcessInstance) processInstance).setProcess(process);
        for (NodeInstance nodeInstance: processInstance.getNodeInstances()) {
            Long oldNodeId = nodeInstance.getNodeId();
            Long newNodeId = nodeMapping.get(oldNodeId);
            if (newNodeId == null) {
                newNodeId = oldNodeId;
            }
            if (process.getNode(newNodeId) == null) {
                throw new IllegalArgumentException("Could not find node " + newNodeId);
            }
            if (newNodeId != oldNodeId) {
                ((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId);
            }
View Full Code Here

Examples of org.drools.definition.process.WorkflowProcess

    parser.startElementBuilder(localName, attrs);

    String id = attrs.getValue("id");
    String name = attrs.getValue("name");
   
    WorkflowProcess process = (WorkflowProcess) parser.getParent();
       
    List<Lane> lanes = (List<Lane>)
            ((RuleFlowProcess) process).getMetaData(LaneHandler.LANES);         
        if (lanes == null) {
            lanes = new ArrayList<Lane>();
View Full Code Here

Examples of org.enhydra.shark.xpdl.elements.WorkflowProcess

      protected ToolRunner (SharkTransaction t,WfActivityInternal wai) throws BaseException {
         this.transaction=t;
         this.activity=wai;
         WfProcessInternal pr=wai.container(t);
         WorkflowProcess wp=SharkUtilities.
            getWorkflowProcess(pr.package_id(t),
                               pr.manager_version(t),
                               pr.process_definition_id(t));
         this.actDef=SharkUtilities.getActivityDefinition(t,wai,wp,wai.block_activity(t));
      }
View Full Code Here

Examples of org.fireflow.model.WorkflowProcess

    /* (non-Javadoc)
     * @see org.fireflow.engine.IProcessInstance#getWorkflowProcess()
     */
    public WorkflowProcess getWorkflowProcess() throws EngineException {
        WorkflowDefinition workflowDef = rtCtx.getDefinitionService().getWorkflowDefinitionByProcessIdAndVersionNumber(this.getProcessId(), this.getVersion());
        WorkflowProcess workflowProcess = null;

        workflowProcess = workflowDef.getWorkflowProcess();

        return workflowProcess;
    }
View Full Code Here

Examples of org.fireflow.model.WorkflowProcess

     * 触发process instance相关的事件
     * @param e
     * @throws org.fireflow.engine.EngineException
     */
    protected void fireProcessInstanceEvent(ProcessInstanceEvent e) throws EngineException {
        WorkflowProcess workflowProcess = this.getWorkflowProcess();
        if (workflowProcess == null) {
            return;
        }

        List<EventListener> listeners = workflowProcess.getEventListeners();
        for (int i = 0; i < listeners.size(); i++) {
            EventListener listener = listeners.get(i);
            Object obj = rtCtx.getBeanByName(listener.getClassName());
            if (obj != null) {
                ((IProcessInstanceEventListener) obj).onProcessInstanceEventFired(e);
View Full Code Here

Examples of org.fireflow.model.WorkflowProcess

                    taskInstance.getActivity(),
                    "DefaultToolTaskInstanceRunner:TaskInstance的任务类型错误,只能为TOOL类型");
        }
        Task task = taskInstance.getTask();
        if (task == null) {
            WorkflowProcess process = taskInstance.getWorkflowProcess();
            throw new EngineException(taskInstance.getProcessInstanceId(), process,
                    taskInstance.getTaskId(),
                    "The Task is null,can NOT start the taskinstance,");
        }
        if (((ToolTask) task).getApplication() == null || ((ToolTask) task).getApplication().getHandler() == null) {
            WorkflowProcess process = taskInstance.getWorkflowProcess();
            throw new EngineException(taskInstance.getProcessInstanceId(), process,
                    taskInstance.getTaskId(),
                    "The task.getApplication() is null or task.getApplication().getHandler() is null,can NOT start the taskinstance,");
        }

        Object obj = runtimeContext.getBeanByName(((ToolTask) task).getApplication().getHandler());

        if (obj==null || !(obj instanceof IApplicationHandler)){
            WorkflowProcess process = taskInstance.getWorkflowProcess();
            throw new EngineException(taskInstance.getProcessInstanceId(), process,
                    taskInstance.getTaskId(),
                    "Run tool task instance error! Not found the instance of "+((ToolTask) task).getApplication().getHandler()+" or the instance not implements IApplicationHandler");
           
        }
View Full Code Here

Examples of org.fireflow.model.WorkflowProcess

      final String parentTaskInstanceId) throws EngineException,
      KernelException {
    final String wfprocessId = workflowProcessId;
   
    final WorkflowDefinition workflowDef = runtimeContext.getDefinitionService().getTheLatestVersionOfWorkflowDefinition(wfprocessId);
    final WorkflowProcess wfProcess = workflowDef.getWorkflowProcess();

    if (wfProcess == null) {
      throw new RuntimeException(
          "Workflow process NOT found,id=[" + wfprocessId
              + "]");
    }
    IProcessInstance processInstance =  (IProcessInstance) this.execute(new IWorkflowSessionCallback() {

      public Object doInWorkflowSession(RuntimeContext ctx)
          throws EngineException, KernelException {

        ProcessInstance processInstance = new ProcessInstance();
        processInstance.setCreatorId(creatorId);
        processInstance.setProcessId(wfProcess.getId());
        processInstance.setVersion(workflowDef.getVersion());
        processInstance.setDisplayName(wfProcess.getDisplayName());
        processInstance.setName(wfProcess.getName());
        processInstance.setState(IProcessInstance.INITIALIZED);
        processInstance.setCreatedTime(ctx.getCalendarService()
            .getSysDate());
        processInstance
            .setParentProcessInstanceId(parentProcessInstanceId);
        processInstance.setParentTaskInstanceId(parentTaskInstanceId);
       
        ctx.getPersistenceService().saveOrUpdateProcessInstance(
            processInstance);
       
        return processInstance;
      }
    });
   
    // 初始化流程变量
    processInstance.setProcessInstanceVariables(new HashMap<String, Object>());
   
    List<DataField> datafields = wfProcess.getDataFields();
    for (int i = 0; datafields != null && i < datafields.size(); i++) {
      DataField df =  datafields.get(i);
      if (df.getDataType().equals(DataField.STRING)) {
        if (df.getInitialValue() != null) {
          processInstance.setProcessInstanceVariable(df
View Full Code Here

Examples of org.fireflow.model.WorkflowProcess

                        workflowProcessFileNames.get(i).trim());
                if (inStream == null) {
                    throw new IOException("没有找到名称为" + workflowProcessFileNames.get(i) + "的流程定义文件");
                }
               
                WorkflowProcess workflowProcess = parser.parse(inStream);

                WorkflowDefinition workflowDef = new WorkflowDefinition();
                workflowDef.setVersion(new Integer(1));

                workflowDef.setWorkflowProcess(workflowProcess);

                String latestVersionKey = workflowProcess.getId() + "_V_" + workflowDef.getVersion();
                workflowDefinitionMap.put(latestVersionKey, workflowDef);
                latestVersionKeyMap.put(workflowProcess.getId(), latestVersionKey);

            }
        }

    }
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.