【正文】
、配置時(shí)、運(yùn)行時(shí);設(shè)計(jì)時(shí)階段需要完成流程模型設(shè)計(jì);配置時(shí)階段需要完成工作流系統(tǒng)運(yùn)行環(huán)境的配置、工作流模型發(fā)布及版本管理等工作;運(yùn)行時(shí)階段需要負(fù)責(zé)發(fā)起和完成流程實(shí)例等工作。通過流程設(shè)計(jì)器,設(shè)計(jì)過程中結(jié)合UAP工具中設(shè)計(jì)出來的業(yè)務(wù)對(duì)象和注冊(cè)在MOM服務(wù)器上的消息和服務(wù)信息,生成流程模型。流程實(shí)例可以被流程實(shí)例管理模塊加以管理、修改。windows 2003 (建議使用windows2003)U8版本:U871 實(shí)施流程 單據(jù)準(zhǔn)備與數(shù)據(jù)表準(zhǔn)備要開發(fā)具有審批流功能的單據(jù),需確保單據(jù)頭所關(guān)聯(lián)的數(shù)據(jù)庫表或視圖包含一下字段:VoucherId,VoucherCode,VoucherType, iverifystate(審批流狀態(tài)), ireturncount(打回次數(shù)), iswfcontrolled(是否審批流控制),前三個(gè)字段為單據(jù)的關(guān)鍵業(yè)務(wù)參數(shù),后三個(gè)字段指示著單據(jù)是否進(jìn)入審批流和進(jìn)入審批流過程中單據(jù)所處的狀態(tài)。URL預(yù)置格式如下:?xml version= encoding=utf8?Command param Name=cmdLine Value=/ param Name=SubSysID Value=//Command上述各參數(shù)值與UFSystem. UA_Menu中的字段存在對(duì)應(yīng)關(guān)系,idUA_Menu. cMenu_Id,nameUA_Menu. cMenu_Name,authIDUA_Menu. cAuth_Id,SubFunction,其他參數(shù)保留,可不預(yù)置。 param Name=authID Value=QM02010101/ param Name=subFunction Value= / 添加自定義的插件:設(shè)置業(yè)務(wù)事件插件:業(yè)務(wù)對(duì)象事件下注冊(cè)該事件處理后調(diào)用的插件:按照這個(gè)步驟,將審批與打回的業(yè)務(wù)插件定義好,一般來說,審批和打回是用同一個(gè)插件。 開發(fā)流程 審批流程——提交在提交的過程中必須先申明一個(gè)共有過程(此過程供提交,審批,棄審,打回使用):參考代碼:提交的原理:調(diào)用工作流自動(dòng)服務(wù)(提交),進(jìn)入工作流,并修改單據(jù)表頭的iverifystate字段,將其賦值為1提交參考代碼: 39。 amp。 strMainKeyName amp。zhCN:該單據(jù)已經(jīng)不存在或已被其他人修改 DoSubmit = False Exit Function End If 39。 set iverifystate=1 where Convert(char,Convert(money,Ufts),2)=39。 and amp。如果提交成功并且不進(jìn)入工作流處理以下 If isWfCtl = False Then update amp。 = amp。 set ireturncount=ireturncount1 where Convert(char,Convert(money,Ufts),2)=39。 and amp。zhCN:該單據(jù)已經(jīng)不存在或已被其他人修改 DoSubmit = False Set Conn = Nothing Exit Function Else Set Conn = Nothing End If writeLog DoSubmit succeeded Else Set Conn = Nothing DoSubmit = False writeLog DoSubmit failed Exit Function End If End If Set dom = Nothing Set obj = Nothing Exit FunctionErrHandler: strErr = writeLog DoSubmit ErrHandler: amp。39。 strTblName amp。 39。 VoucherId strSQL, Conn, adOpenDynamic, adLockReadOnly writeLog UndoSubmit judge ufts If And Then strErr = GetString() 39。 |eventID| amp。 |VoucherType| amp。 |strErr| amp。 strTblName amp。 VoucherId, effeLines If effeLines = 0 Then strErr = GetString() 39。審批流審核調(diào)用Public Function DoAudition(keyData As String, auditAction As String, ByRef bizData As String, _ calledCtx As Object, ByRef errMsg As String) As Boolean Dim strAction As String Dim objAction As New AuditActionMap Dim KeyDataMap As New KeyDataMap Dim VoucherId As Long Dim VoucherType As String Dim Vufts As String Dim objBizData As New BizDataMap Dim login As Dim Conn As DoAudition = True On Error GoTo ErrHandler auditAction strAction = (Action) keyData VoucherId = CLng((VoucherId)) VoucherType = (VoucherType) Vufts = (Ufts) bizData Set login = New = DP Dim obj As Object Set obj = CreateObject() Set Conn = 39。 errMsg) Set Conn = Nothing Set KeyDataMap = Nothing Set obj = Nothing Exit FunctionErrHandler: errMsg = Set login = Nothing Set Conn = Nothing Set obj = Nothing DoAudition = False (errmsg) = errMsg writeLog (DoAudition amp。 strMainKeyName amp。 m_ufts amp。 = amp。 strMainKeyName amp。 where Convert(char,Convert(money,Ufts),2)=39。 and amp。 strMainViewName amp。 VoucherId, Conn, adOpenForwardOnly, adLockReadOnly Else select * from amp。 m_ufts amp。 = amp。 strTblName amp。 VoucherId, Conn, adOpenForwardOnly, adLockReadOnly If Not IsNull((0).Value) Then billvouchtype, (0).Value End If Set rst = Nothing End If 39。39。39。39。39。39。39。39。39。39。39。39。39。 amp。 amp。 VoucherId, lEffectedCount Case Else update + strTblName + set iverifystate=2 ,cState=1, cverfier=39。, cHandleDate=39。 where + strMainKeyName + = amp。傳回新的時(shí)間戳 VerifyVoucherAgree = True Set rst = Nothing End If Else (errMsg) = strErr (domHead) = writeLog (VerifyVoucherAgree:錯(cuò)誤處理 amp。 m_ufts) Dim strVouchClosed As String strVouchClosed = ErrVoucherClosed(VoucherId, VoucherType, Conn) If strVouchClosed Then vbObjectError + 1000, , strVouchClosed VerifyVoucherDisagree = False strVouchClosed = Exit Function End If If m_ufts = Then update + strTblName + set iverifystate=1 where iverifystate1 and + strMainKeyName + = amp。 39。GetString() 39。 _ amp。 VoucherId, lEffectedCount End If If lEffectedCount = 0 Then vbObjectError + 1000, , GetString() 39