Ejemplo n.º 1
0
        /// <summary>
        /// this scours the registry looking for candidate registrations that match a given process name and/ or state nanme
        /// </summary>
        /// <param name="processName"> the name of the process </param>
        /// <param name="stateName">	 the name of the state </param>
        /// <returns> an unambiguous <seealso cref="org.camunda.bpm.engine.test.spring.components.registry.ActivitiStateHandlerRegistry"/> or null </returns>
        public virtual ActivitiStateHandlerRegistration findRegistrationForProcessAndState(string processName, string stateName)
        {
            ActivitiStateHandlerRegistration r = null;

            string key = registrationKey(processName, stateName);

            ICollection <ActivitiStateHandlerRegistration> rs = this.findRegistrationsForProcessAndState(processName, stateName);

            foreach (ActivitiStateHandlerRegistration sr in rs)
            {
                string kName = registrationKey(sr.ProcessName, sr.StateName);
                if (key.Equals(kName, StringComparison.OrdinalIgnoreCase))
                {
                    r = sr;
                    break;
                }
            }

            foreach (ActivitiStateHandlerRegistration sr in rs)
            {
                string kName = registrationKey(null, sr.StateName);
                if (key.Equals(kName, StringComparison.OrdinalIgnoreCase))
                {
                    r = sr;
                    break;
                }
            }

            if ((r == null) && (rs.Count > 0))
            {
                r = rs.GetEnumerator().next();
            }

            return(r);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// used at runtime to register state handlers as they are registered with the spring context
        /// </summary>
        /// <param name="registration"> the <seealso cref="org.camunda.bpm.engine.test.spring.components.registry.ActivitiStateHandlerRegistration"/> </param>
        public virtual void registerActivitiStateHandler(ActivitiStateHandlerRegistration registration)
        {
            string regKey = registrationKey(registration.ProcessName, registration.StateName);

            this.registrations[regKey] = registration;
        }