コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @AroundInvoke public Object invoke(javax.interceptor.InvocationContext ctx) throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual object invoke(InvocationContext ctx)
        {
            try
            {
                object result = ctx.proceed();

                StartProcess startProcessAnnotation = ctx.Method.getAnnotation(typeof(StartProcess));

                string key = startProcessAnnotation.value();

                IDictionary <string, object> variables = extractVariables(startProcessAnnotation, ctx);

                businessProcess.startProcessByKey(key, variables);

                return(result);
            }
            catch (InvocationTargetException e)
            {
                Exception cause = e.InnerException;
                if (cause != null && cause is Exception)
                {
                    throw (Exception)cause;
                }
                else
                {
                    throw e;
                }
            }
            catch (Exception e)
            {
                throw new ProcessEngineException("Error while starting process using @StartProcess on method  '" + ctx.Method + "': " + e.Message, e);
            }
        }