Class AbstractActivity

java.lang.Object
com.appiancorp.suiteapi.process.framework.AbstractActivity
All Implemented Interfaces:
SmartServiceContext

public abstract class AbstractActivity extends Object implements SmartServiceContext
Abstract class to be subclassed when implementing a Java execution environment activity. The subclass will contain the code that actually performs the activity.
  • Field Details

  • Constructor Details

    • AbstractActivity

      public AbstractActivity()
  • Method Details

    • perform

      This method is called by the framework when the activity is to be executed. This method calls execute() but does not notify the process engine of success. This method is not meant to be overridden and is thus final.
      Returns:
      The return values from the activity.
      Throws:
      ActivityExecutionException - This exception contains the actual exception that occurred while executing the activity. It can also contain messages for both user and the administrator. In the case of attended activity the message for the user will be display immediately.
      Exception - If anything else goes wrong. Activities can throw any subclass of Exception. All exceptions are caught and handled higher in the framework. If an activity fails, it is necessary to throw an exception from this method so that the process engine will be alerted that the activity failed.
    • perform

      This method is called by the framework when the activity is to be executed. This method calls execute() but does not notify the process engine of success. This method is not meant to be overridden and is thus final.
      Parameters:
      sc_ - ServiceContext of the user executing the activity.
      Returns:
      The return values from the activity.
      Throws:
      ActivityExecutionException - This exception contains the actual exception that occurred while executing the activity. It can also contain messages for both user and the administrator. In the case of attended activity the message for the user will be display immediately.
      Exception - If anything else goes wrong. Activities can throw any subclass of Exception. All exceptions are caught and handled higher in the framework. If an activity fails, it is necessary to throw an exception from this method so that the process engine will be alerted that the activity failed.
    • run

      @Deprecated public final Long run() throws Exception
      Deprecated.
      08-07-2006 Use perform() instead.
      This method is called by the framework when the activity is to be executed. This method calls execute() and then notifies the process engine of success, assuming the activity was successful. This method is not meant to be overridden and is thus final.
      Returns:
      The id of the next activity to execute.
      Throws:
      Exception - If anything goes wrong.
    • run

      @Deprecated public final Long run(ServiceContext sc_) throws Exception
      Deprecated.
      08-07-2006 Use perform(ServiceContext) instead.
      This method is called by the framework when the activity is to be executed. This method calls execute() and then notifies the process engine of success, assuming the activity was successful. This method is not meant to be overridden and is thus final.
      Parameters:
      sc_ - ServiceContext of the user executing the activity.
      Returns:
      The id of the next activity to execute.
      Throws:
      Exception - If anything goes wrong.
    • execute

      The actual method that implements an activity. This method is meant to be overridden in all subclasses.
      Parameters:
      inputs_ - The input parameters to the activity.
      outputs_ - The structure for the outputs from the activity. This object graph should be populated and returned from this method.
      extraParameters_ - Any extra parameters for the activity returned to the framework from the ActivityParameterHelper.createExtraOutputMap(com.appiancorp.suiteapi.process.ActivityClassParameter[])
      sc_ - The activity will be performed under this service context
      Returns:
      The results of the activity execution.
      Throws:
      ActivityExecutionException - This exception contains the actual exception that occurred while executing the activity. It can also contain messages for both user and the administrator. In the case of attended activity the message for the user will be display immediately.
      Exception - If anything else goes wrong. Activities can throw any subclass of Exception. All exceptions are caught and handled higher in the framework. If an activity fails, it is necessary to throw an exception from this method so that the process engine will be alerted that the activity failed.
    • execute

      @Deprecated public SafeActivityReturnVariable[] execute(ActivityClassParameter[] inputs_, SafeActivityReturnVariable[] outputs_, Object extraParameters_, com.appiancorp.asl3.servicefw.connect.ServiceContext sc_) throws ActivityExecutionException, Exception
      Parameters:
      inputs_ -
      outputs_ -
      extraParameters_ -
      sc_ -
      Returns:
      Throws:
      ActivityExecutionException
      Exception
    • getProcessModelProperties

      public ProcessModelProperties getProcessModelProperties()
      Specified by:
      getProcessModelProperties in interface SmartServiceContext
      Returns:
      the properties of the ProcessModel
    • setProcessModelProperties

      public void setProcessModelProperties(ProcessModelProperties processModelProperties_)
      See Also:
    • getProcessProperties

      public ProcessProperties getProcessProperties()
      Specified by:
      getProcessProperties in interface SmartServiceContext
      Returns:
      the properties of the process
    • setProcessProperties

      public void setProcessProperties(ProcessProperties processProperties_)
      See Also:
    • getTaskProperties

      public TaskProperties getTaskProperties()
      Specified by:
      getTaskProperties in interface SmartServiceContext
      Returns:
      the properties of the task
    • setTaskProperties

      public void setTaskProperties(TaskProperties taskProperties_)
      See Also:
    • setActivityProperties

      public void setActivityProperties(ActivityProperties ap_)
      Convenience method to set all properties at once.
      Parameters:
      ap_ - the properties of the task, process, and model for this activity
    • getMetadata

      public ActivityExecutionMetadata getMetadata()
      Description copied from interface: SmartServiceContext
      Returns the metadata associated with this execution, including properties related to the Process Model and Tasks.
      Specified by:
      getMetadata in interface SmartServiceContext
      Returns:
      the metadata needed for the execution of the activity
    • setMetadata

      public void setMetadata(ActivityExecutionMetadata metadata_)
      See Also:
    • setExtraParameters

      public void setExtraParameters(Object extraParameters_)
      See Also:
    • getExtraParameters

      public Object getExtraParameters()
      Returns:
      the extra parameters for the activity
    • getUser

      public User getUser()
      Returns:
      the user executing the activity
    • getUsername

      public String getUsername()
      Description copied from interface: SmartServiceContext
      Returns the User for whom this Smart Service is executing.
      Specified by:
      getUsername in interface SmartServiceContext
      See Also:
    • setUser

      public void setUser(User user_)
      See Also:
    • getActivityMap

      public HashMap getActivityMap()
      Retrieves the HashMap which stores key/value pairs to be used in a non-process environment after the activity executes. When the activity executes all key/value pairs in the HashMap will be copied to the request.

      Note: It is recommended that users use a unique prefix for their keys to avoid potential conflicts.
      Returns:
      the activity's HashMap
    • setActivityMap

      public void setActivityMap(HashMap activityMap_)
      Sets the HashMap for this activity.
      Parameters:
      activityMap_ -
      See Also:
    • getPrimaryLocale

      public Locale getPrimaryLocale()
      Description copied from interface: SmartServiceContext
      Returns the primary Locale of the Appian System.
      Specified by:
      getPrimaryLocale in interface SmartServiceContext
      Returns:
      Returns the site's primaryLocale.
      See Also:
    • setPrimaryLocale

      public void setPrimaryLocale(Locale primaryLocale_)
      Parameters:
      primaryLocale_ - The primaryLocale to set.
    • getUserLocale

      public Locale getUserLocale()
      Description copied from interface: SmartServiceContext
      Returns the Locale of the User executing this Smart Service.
      Specified by:
      getUserLocale in interface SmartServiceContext
      Returns:
      Returns the userLocale.
      See Also:
    • setUserLocale

      public void setUserLocale(Locale userLocale_)
      Parameters:
      userLocale_ - The userLocale to set.
    • lookupInWebAppJndi

      @Deprecated protected Object lookupInWebAppJndi(String name) throws NamingException
      Deprecated.
      The JNDI context "comp" should not be used. Use any context that does not begin with "comp", and retrieve the object using the standard JNDI syntax: Context ctx = new InitialContext(); Object o = ctx.lookup(name);
      Returns the object stored in the Appian web app JNDI, under the given name. This is only needed for objects stored in the special "comp" context (such as "comp/env/jdbc").
      Parameters:
      name - The JNDI name to lookup.
      Throws:
      NamingException