about us      downloads      documentation      contact      home 
 products
 antHR
 workflow studio
 technical toolkits
 content entry
 workflow
 security
 hierarchy
 concepts
 how tos
 reference
 FAQs
previous: Design  next: Adding a property

How to: Create a new Action in .NET - Implementing the skeleton

  Step 1 : Summary
  Step 2 : Design
  Step 3 : Implementing the skeleton
  Step 4 : Adding a property
  Step 5 : Finishing the implementation
  Step 6 : Registering and testing the action

Implementing the shell of an Action - (page 3 of 6)

Level: developer

In order to start implementing an action, you need a new assembly. Add references to
Ant.ContentEntry.dll, Ant.ContentEntry.Windows.dll, Ant.ContentEntry.Web.dll,     
Ant.ContentEntry.Types.dll, Ant.Database.dll, Ant.Security.dll and Ant.Workflow


Start a new class in the assembly, and then implement the action interface with default code. You should have something like this:
using System;
using Ant.ContentEntry;
using Ant.ContentEntry.ClassInformation;
using Ant.ContentEntry.FieldDisplayers;
using Ant.ContentEntry.Converters;
using Ant.Database;
using Ant.Security;
using Ant.Workflow;

namespace HowTos
{
    /// <summary>
    /// This is an example action
    /// </summary>
    public class HowToAction : Action
    {
        AuthenticatedUser user;
        /// <summary>
        /// Constructor, taking a user which is supplied whenever
        /// this action is constructed by the workflow engine
        /// </summary>
        /// <param name="user">Logged on user</param>
        public HowToAction(AuthenticatedUser user)
        {
            this.user = user;
        }
        #region Action Members

        public void Terminate(ActivityInstance instance, Ant.Database.AntConnection connection, 
            Ant.Database.AntTransaction transaction, ref string state)
        {
            throw new NotImplementedException();
        }

        public bool StartAction(ActivityInstance instance, Ant.Database.AntConnection connection, 
            Ant.Database.AntTransaction transaction, User performer, ref string state)
        {
            throw new NotImplementedException();
        }

        public string GetHelpUrl()
        {
            throw new NotImplementedException();
        }

        public string GetActionName()
        {
            throw new NotImplementedException();
        }

        public string ShortDescription
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        public string LongDescription
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        public string ProcessActionResults(ActivityInstance instance, Ant.Database.AntConnection connection, 
            Ant.Database.AntTransaction transaction, User performedBy, string results, ref string state)
        {
            throw new NotImplementedException();
        }

        public System.Collections.ICollection GetRequiredTransitionNames()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
    


 

Did you find this article helpful? Comments on this page are welcome and can only help us improve the quality of our documentation.
© Ant Organisation Ltd, 2003