Beispiel #1
0
 /// <summary>
 /// 验证当前用户是否正确
 /// </summary>
 /// <returns></returns>
 public void ValidateSoapHeader()
 {
     if (authentication == null)
     {
         throw new Exception("请输入身份认证信息!");
     }
     UserValidator = OThinker.H3.Controllers.UserValidatorFactory.Validate(authentication.UserCode, authentication.Password);
     if (UserValidator == null)
     {
         throw new Exception("帐号或密码不正确!");
     }
     Engine = UserValidator.Engine;
 }
 /// <summary>
 /// 设置引擎连接
 /// </summary>
 /// <param name="connection"></param>
 private static void SetEngin(string connection)
 {
     lock (MonoConnectionLockObject)
     {
         if (MonoConnection == null || MonoConnection.Engine == null)
         {
             OThinker.H3.Connection c = new OThinker.H3.Connection();
             string connectionString  = System.Configuration.ConfigurationManager.AppSettings["BPMEngine"];
             try
             {
                 OThinker.Clusterware.ConnectionResult result = c.Open(connection);
                 if (result != OThinker.Clusterware.ConnectionResult.Success)
                 {
                     throw new Exception("引擎服务连接错误->" + result.ToString());
                 }
             }
             catch (Exception ex)
             {
                 try
                 {
                     OThinker.Clusterware.ConnectionResult result = c.Open(connectionString);
                     if (result != OThinker.Clusterware.ConnectionResult.Success)
                     {
                         throw new Exception("引擎服务连接错误->" + result.ToString());
                     }
                 }
                 catch (Exception e)
                 {
                     throw e;
                 }
             }
             MonoConnection = c;
         }
     }
     _engine = MonoConnection.Engine;
 }