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

C#: 

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


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

Comments

No comments yet.