This project is read-only.

1. Apply for Leave: Controller Program (FillLeaveData Method) 

VB .NET: 

  1.         ' Process DataBase Execution
  2.         ' Do with Workflow
  3.         ' Initiated a Workflow
  4.         Dim engine As HSDc.RingleFlow.Api.IWorkflowEngine = HSDc.RingleFlow.Api.Factory.WorkflowEngineFactory.GetInstance()
  5.         ' Get a Process Definition
  6.         Dim repository As HSDc.RingleFlow.Api.Service.IRepositoryService = engine.RespositoryService
  7.         Dim definition As HSDc.RingleFlow.Api.Kernel.IProcessDefinition = repository.GetProcessDefinitionByName("請假流程")
  8.         ' Initiated a Workflow,and write data into Workflow
  9.         Dim runtime As HSDc.RingleFlow.Api.Service.IRuntimeService = engine.RuntimeService
  10.        Dim variables As New Dictionary(Of String, Object)
  11.        variables.Add("emp", userId)
  12.        variables.Add("formData", LeaveData.GetXml())
  13.        Dim instance As HSDc.RingleFlow.Api.Kernel.IProcessInstance = runtime.CreateProcessInstance(definition, variables)
  14.        ' Write Instance id into database
  15.        Dim record As RecordLeave.LeaveInfoRow = CType(LeaveData.LeaveInfo.Rows(0), RecordLeave.LeaveInfoRow)
  16.        record.WorkflowID = instance.Id
  17.        ' dao.save(...., instance.Id)
  18.        Return LeaveData

Last edited Jun 25, 2012 at 2:03 PM by cathysung, version 2

Comments

No comments yet.