Class AbstractActivity
java.lang.Object
com.appiancorp.suiteapi.process.framework.AbstractActivity
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(ActivityClassParameter[] inputs_, SafeActivityReturnVariable[] outputs_, Object extraParameters_, com.appiancorp.asl3.servicefw.connect.ServiceContext sc_) Deprecated.execute(ActivityClassParameter[] inputs_, SafeActivityReturnVariable[] outputs_, Object extraParameters_, ServiceContext sc_) The actual method that implements an activity.Retrieves theHashMapwhich stores key/value pairs to be used in a non-process environment after the activity executes.Returns the metadata associated with this execution, including properties related to the Process Model and Tasks.Returns the primary Locale of the Appian System.getUser()Returns the Locale of the User executing this Smart Service.Returns the User for whom this Smart Service is executing.protected ObjectlookupInWebAppJndi(String name) Deprecated.The JNDI context "comp" should not be used.final ActivityReturnVariable[]perform()This method is called by the framework when the activity is to be executed.final ActivityReturnVariable[]perform(ServiceContext sc_) This method is called by the framework when the activity is to be executed.final Longrun()Deprecated.08-07-2006 Use perform() instead.final Longrun(ServiceContext sc_) Deprecated.08-07-2006 Use perform(ServiceContext) instead.voidsetActivityMap(HashMap activityMap_) Sets theHashMapfor this activity.voidConvenience method to set all properties at once.voidsetExtraParameters(Object extraParameters_) voidsetMetadata(ActivityExecutionMetadata metadata_) voidsetPrimaryLocale(Locale primaryLocale_) voidsetProcessModelProperties(ProcessModelProperties processModelProperties_) voidsetProcessProperties(ProcessProperties processProperties_) voidsetTaskProperties(TaskProperties taskProperties_) voidvoidsetUserLocale(Locale userLocale_)
-
Field Details
-
_metadata
-
-
Constructor Details
-
AbstractActivity
public AbstractActivity()
-
-
Method Details
-
perform
This method is called by the framework when the activity is to be executed. This method callsexecute()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 ofException. 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
public final ActivityReturnVariable[] perform(ServiceContext sc_) throws ActivityExecutionException, Exception This method is called by the framework when the activity is to be executed. This method callsexecute()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 ofException. 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.08-07-2006 Use perform() instead.This method is called by the framework when the activity is to be executed. This method callsexecute()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.08-07-2006 Use perform(ServiceContext) instead.This method is called by the framework when the activity is to be executed. This method callsexecute()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
public SafeActivityReturnVariable[] execute(ActivityClassParameter[] inputs_, SafeActivityReturnVariable[] outputs_, Object extraParameters_, ServiceContext sc_) throws ActivityExecutionException, Exception 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 theActivityParameterHelper.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 ofException. 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 Deprecated.since 6.0.3; override the otherexecute(ActivityClassParameter[], SafeActivityReturnVariable[], Object, ServiceContext)- Parameters:
inputs_-outputs_-extraParameters_-sc_-- Returns:
- Throws:
ActivityExecutionExceptionException
-
getProcessModelProperties
- Specified by:
getProcessModelPropertiesin interfaceSmartServiceContext- Returns:
- the properties of the
ProcessModel
-
setProcessModelProperties
- See Also:
-
getProcessProperties
- Specified by:
getProcessPropertiesin interfaceSmartServiceContext- Returns:
- the properties of the process
-
setProcessProperties
- See Also:
-
getTaskProperties
- Specified by:
getTaskPropertiesin interfaceSmartServiceContext- Returns:
- the properties of the task
-
setTaskProperties
- See Also:
-
setActivityProperties
Convenience method to set all properties at once.- Parameters:
ap_- the properties of the task, process, and model for this activity
-
getMetadata
Description copied from interface:SmartServiceContextReturns the metadata associated with this execution, including properties related to the Process Model and Tasks.- Specified by:
getMetadatain interfaceSmartServiceContext- Returns:
- the metadata needed for the execution of the activity
-
setMetadata
- See Also:
-
setExtraParameters
- See Also:
-
getExtraParameters
- Returns:
- the extra parameters for the activity
-
getUser
- Returns:
- the user executing the activity
-
getUsername
Description copied from interface:SmartServiceContextReturns the User for whom this Smart Service is executing.- Specified by:
getUsernamein interfaceSmartServiceContext- See Also:
-
setUser
- See Also:
-
getActivityMap
Retrieves theHashMapwhich 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 theHashMapwill 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
Sets theHashMapfor this activity.- Parameters:
activityMap_-- See Also:
-
getPrimaryLocale
Description copied from interface:SmartServiceContextReturns the primary Locale of the Appian System.- Specified by:
getPrimaryLocalein interfaceSmartServiceContext- Returns:
- Returns the site's primaryLocale.
- See Also:
-
setPrimaryLocale
- Parameters:
primaryLocale_- The primaryLocale to set.
-
getUserLocale
Description copied from interface:SmartServiceContextReturns the Locale of the User executing this Smart Service.- Specified by:
getUserLocalein interfaceSmartServiceContext- Returns:
- Returns the userLocale.
- See Also:
-
setUserLocale
- Parameters:
userLocale_- The userLocale to set.
-
lookupInWebAppJndi
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
-
execute(ActivityClassParameter[], SafeActivityReturnVariable[], Object, ServiceContext)