/// <summary> /// 该事件的处理函数 /// </summary> protected override void __processing() { WE_STATUS status = WE_STATUS.SUSPEND; WorkFlows wfs = new WorkFlows(); try { switch ((string)m_run_params) { case "SUSPEND": status = WE_STATUS.SUSPEND; wfs.UpdateWorkFlowEntity(m_wfentityID, "WE_Status", status); break; case "DELETE": status = WE_STATUS.DELETED; wfs.UpdateWorkFlowEntity(m_wfentityID, "WE_Status", status); break; default: break; } //调用用户定义的回调URL _CustomCallBack(); this.status = TM_STATUS.TM_FINISH; } catch { Trace.WriteLine("Timeout processing exception!"); } }
/// <summary> /// 执行设置工作流实体状态的工作 /// </summary> protected override void __processing() { try { //更新工作流实体的状态 WorkFlows wfs = new WorkFlows(); wfs.UpdateWorkFlowEntity(m_wfentityID, "WE_Status", m_run_params); //如果要改变的状态为ACTIVE, 则发送一个空消息,推动工作流运转 if (((WE_STATUS)m_run_params) == WE_STATUS.ACTIVE) { CWFEngine.SubmitSignal(m_wfentityID, new Dictionary <string, string>(), null); } } catch { string error = string.Format("Set workflow entity {0} error!", m_wfentityID); Trace.WriteLine(error); } }