关于工作流的问题!我的工作流脚本代码
Sub completed_OnEnter
Delete1_OnDelete
End Sub
Sub denied_OnEnter
Delete2_OnDelete
End Sub
Function Create_OnCreateValidate
If workflowsession.fields("FeatureRequestStatus")="Submitted" Then
Create_OnCreateValidate=true
WorkflowSession.ItemAuthors.Add "administrator@oaserver.exchange", 0
else
Create_OnCreateValidate = false
End If
End Function
function Create_OnCreate
LogAudit
SendMessage "lussia","ProdMgmt: New Feature Request","Marketing has submitted a new feature request for your approval."
End function
Function complete_OnChangeValidate
If workflowsession.fields("FeatureRequestStatus")= "Completed" Then
complete_OnChangeValidate=true
else
complete_OnChangeValidate = false
end if
End Function
function complete_OnChange
LogAudit
SendMessage "lussia","Marketing and ProdMgmt: Feature Complete","Development has completed the new feature."
SendMessage "administrator","Marketing and ProdMgmt: Feature Complete","Development has completed the new feature."
End function
Function deny_OnChangeValidate
If workflowsession.fields("FeatureRequestStatus")= "Denied" Then
deny_OnChangeValidate=true
denied_OnEnter
else
deny_OnChangeValidate = false
end if
End Function
function deny_OnChange
LogAudit
SendMessage "administrator","Marketing: Feature Denied","Product management has denied a new feature request."
End function
Function approve_OnChangeValidate
If workflowsession.fields("FeatureRequestStatus")="Approved" Then
approve_OnChangeValidate=true
else
approve_OnChangeValidate = false
end if
End Function
function approve_OnChange
LogAudit
SendMessage "michael","Dev Team: Feature Approval","Product management has approved a new feature."
End function
Sub Delete1_OnDelete
LogAudit
SendMessage "administrator","Marketing and ProdMgmt: Feature Complete","Development has completed the new feature.is deleted"
End Sub
Sub Delete2_OnDelete
LogAudit
SendMessage "administrator","Marketing and ProdMgmt: Feature Complete","Development has completed the new feature.is deleted"
End Sub
Sub SendMessage(msgTo, msgSubject, msgBody)
Set objMessage =workflowsession.getNewWorkflowMessage
objMessage.To = msgTo & "@" & workflowsession.domain
objMessage.From = "administrator@oaserver.exchange"
objMessage.Subject = msgSubject
htmlBody = "<html><body>"
htmlBody = htmlBody & "<p>" & msgBody & "<p>"
htmlBody = htmlBody & "<p>Title of request: " & workflowsession.fields("DAV:displayname") & "<p>"
htmlBody = htmlBody & "<p>Please <a href=""http://" & workflowsession.server
htmlBody = htmlBody & "/testapp/test/"
htmlBody = htmlBody & workflowsession.fields("DAV:displayname") & """"
htmlBody = htmlBody & ">Click here</a> to open the request.</p>"
htmlBody = htmlBody & "</body>"
htmlBody = htmlBody & "</html>"
objMessage.textbody = htmlBody
objMessage.Send
set objMessage=nothing
End Sub
Sub LogAudit()
Dim strDebug
strDebug = vbCrLf
strDebug = strDebug & WorkflowSession.StateFrom & " -> " & WorkflowSession.StateTo
WorkflowSession.AddAuditEntry strDebug
End Sub
workflow designer是office xp开发版带的version 7.0.9064