Ejemplo n.º 1
0
        /// <summary>
        /// Create activity instance from transition
        /// </summary>
        /// <returns>the new IActivity object</returns>
        public IActivity CreateActivity(IProcess process)
        {
            // Create activity
            var activity = new TActivity
            {
                Parameters = _parameters.Bind(process),
                Process    = process
            };

            // Link objects
            process.AddActivity(activity);

            return(activity);
        }
        /// <summary>
        /// Create activity instance from transition
        /// </summary>
        /// <returns>the new IActivity object</returns>
        public IActivity CreateActivity(IProcess process)
        {
            // Create activity
            var activity = new TActivity
            {
                Parameters = _parameters.Bind(process),
                Process    = process
            };

            // Set name of activity
            if (activity is Activity activityClass)
            {
                activityClass.Name = Name;
            }

            // Link objects
            process.AddActivity(activity);

            return(activity);
        }