Openerp 工作流的流程返回

2022-08-14 06:06:12 字數 4942 閱讀 9721

乙個簡單的審批工作流程,流程圖如下:

普通流程是直線的,這個流程的難點在於增加了乙個退回的節點,這就需要在流程設計時,有乙個觸發訊號位於此流程之外。

**如下:

流程節點定義:

<

record

model

="workflow.activity"

id="act_draft_setting"

>

<

field

name

="wkf_id"

ref="wkf_holidays_setting"

/>

<

field

name

="flow_start"

>true

field

>

<

field

name

="name"

>draft_setting

field

>

record

>

<

record

model

="workflow.activity"

id="act_wait_modify_setting"

>

<

field

name

="wkf_id"

ref="wkf_holidays_setting"

/>

<

field

name

="name"

>wait_modify_setting

field

>

<

field

name

="kind"

>function

field

>

<

field

name

="action"

>button_return()

field

>

record

>

<

record

model

="workflow.activity"

id="act_wait_confirm_setting"

>

<

field

name

="wkf_id"

ref="wkf_holidays_setting"

/>

<

field

name

="name"

>wait_confirm_setting

field

>

<

field

name

="kind"

>function

field

>

<

field

name

="action"

>button_confirm()

field

>

record

>

<

record

model

="workflow.activity"

id="act_validate_setting"

>

<

field

name

="wkf_id"

ref="wkf_holidays_setting"

/>

<

field

name

="name"

>validate_setting

field

>

<

field

name

="kind"

>function

field

>

<

field

name

="action"

>button_validate()

field

>

record

>

節點遷移定義:

<

record

model

="workflow.transition"

id="holiday_setting_draft2confirm"

>

<

field

name

="act_from"

ref="act_draft_setting"

/>

<

field

name

="act_to"

ref="act_wait_confirm_setting"

/>

record

>

<

record

model

="workflow.transition"

id="holiday_setting_confirm2validate"

>

<

field

name

="act_from"

ref="act_wait_confirm_setting"

/>

<

field

name

="act_to"

ref="act_validate_setting"

/>

<

field

name

="signal"

>validate_setting

field

>

<

field

name

="group_id"

ref="base.group_hr_user"

/>

record

>

<

record

model

="workflow.transition"

id="holiday_setting_confirm2modify"

>

<

field

name

="act_from"

ref="act_wait_confirm_setting"

/>

<

field

name

="act_to"

ref="act_wait_modify_setting"

/>

<

field

name

="signal"

>wait_modify_setting

field

>

<

field

name

="group_id"

ref="base.group_hr_user"

/>

record

>

<

record

model

="workflow.transition"

id="holiday_setting_modify2confirm"

>

<

field

name

="act_from"

ref="act_wait_modify_setting"

/>

<

field

name

="act_to"

ref="act_wait_confirm_setting"

/>

<

field

name

="signal"

>button_submit

field

>

<

field

name

="group_id"

ref="base.group_hr_user"

/>

record

>

xml檔案中的button定義:

<

button

string

="審核"

name

="validate_setting"

states

="wait_confirm"

type

="workflow"

groups

="base.group_hr_user"

class

="oe_highlight"

/>

<

button

string

="退回"

name

="wait_modify_setting"

states

="wait_confirm"

type

="workflow"

groups

="base.group_hr_user"

class

="oe_highlight"

/>

<

button

string

="提交"

name

="button_submit"

states

="wait_modify"

groups

="base.group_hr_user"

class

="oe_highlight"

/>

剩下的就是在python中定義每個button的**即可。

工作流建模 工作流概念

工作流建模 工作流概念 1 案例 工作流系統得基本目的是處理案例。每個案例都有乙個唯一標識,而且每個案例的生命週期都是有限的。案例生命週期都處於某個特定狀態,該狀態由三個元素組成 1 案例相關的屬性的值 案例屬性是一系列同案例相關的變數。能夠用來管理案例。正是通過這些變數,才有可能指出在特定條件下某...

Activiti工作流之流程變數

以請假單為例,流程變數的意義在於將請假單跟這個流程繫結在一起,流程走到 請假單的狀態就跟到 相當於定義了乙個流程變數來儲存相對應的狀態.流程變數存在兩個級別位置,一是流程例項級別的的流程變數 在流程例項啟動時就將流程變數放入 二是流程任務級別的流程變數 在執行當前任務時將流程變數放入 10張表 se...

flowable工作流子流程呼叫

flowable工作流子流程介紹 工作流提供了子流程的呼叫,一種是內部子流程,可以讓使用者主要看主流程,保持業務清晰,另一種是引用外部子流程 call activity 復用外部流程功能。工作中有用到flowable 6.5.06版本。bpmn檔案 測試子流程 流程圖 單元測試類 title des...