Show TOC Start of Content Area

Background documentation Including Additional Functionality  Locate the document in its SAP Library structure

When you create your own Guided Procedures (GP) activities, you may need to include additional functionality to enhance process flow.

The following describes some of the most commonly used features of the GP design time framework.

Process Instantiation

At design time, you can configure process instantiation parameters that define how many process instances may be created at runtime. This is also known as process multiplicity (com.sap.caf.eu.gp.process.api.GPProcessMultiplicity) and can be of the following types:

·        MULTIPLE_INSTANCES_MULTIPLICITY – multiple instances

·        SINGLE_RUNNING_INSTANCE_MULTIPLICITY – only one running instance, and possibly several completed instances

·        SINGLE_INSTANCE_MULTIPLICITY - at most one instance, either running or completed

In addition, you can choose to start the process automatically.

From the com.sap.caf.eu.gp.process.api.IGPModifiableProcess interface, you can use the following methods:

Method

Description

setProcessMultiplicity(GPProcessMultiplicity multiplicity)

Defines the process multiplicity for the current process object.

getProcessMultiplicity()

Returns the type of process multiplicity of the process object.

setAutomaticallyStartedMode(boolean isAutomaticallyStarted)

Sets the process start mode.

isAutomaticallyStarted()

Checks if the process is automatically started.

Info Callable Objects

For each activity object that you create, you can define info callable objects. At runtime, these objects can be executed to provide additional information relevant to the item. You can only use callable objects that expose the user interface – for example, Web Dynpro components or applications, Web pages, BSP applications, and so on.

From the com.sap.caf.eu.gp.process.api.IGPModifiableActivity interface, you can use the following methods:

Method

Description

addInfoCallableObject(IGPCallableObject infoObject)

Adds an info callable object to the given activity and returns an object reference to it.

removeInfoCallableObject(IGPInfoCallableObject infoObject)

Removes the info callable object (if any) from the activity.

You can also map the input parameters of the object to the input parameters of the activity. For more information, see Implementing Parameter Mapping.

Ad-Hoc Items

Ad-hoc items in GP are actions that might be executed if certain conditions occur, but they do not change the general process flow.

From the com.sap.caf.eu.gp.process.api.IGPModifiableActivity interface, you can use the following methods:

Method

Description

addAdHocActivity(IGPModifiableActivity activityObject)

Adds a reference to an ad-hoc activity in the current activity.

removeAdHocActivity(IGPAdhocActivity adhocActivity)

Removes the reference corresponding to a given ad-hoc activity from the current activity.

You can also map the input parameters of the ad-hoc item to the output parameters of the activity. For more information, see Implementing Parameter Mapping.

Permissions

For each development object that you create in the GP design time, you can set permissions for editing and executing the object.

The permission types (com.sap.caf.eu.gp.base.api.GPPermissionType) are:

·        Read (DEV_OBJ_READ)

·        Write (DEV_OBJ_READ_WRITE)

·        Delete (DEV_OBJ_READ_DELETE)

·        Initiate or execute (DEV_OBJ_EXECUTE)

·        Full control (DEV_OBJ_FULL_CONTROL)

·        Owner (DEV_OBJ_OWNER)

From the com.sap.caf.eu.gp.base.api.IGPModifiableDevelopmentObject interface, you can use the following methods:

Method

Description

addPermission(IPrincipal principal,

              GPPermissionType permissionType)

Adds a permission of a particular type to the development object. The principal can be a user, group or role.

removePermission(IGPPermission permission)

Removes a permission from the development object.

removePermission(IPrincipal principal,

                 GPPermissionType permissionType)

Removes a permission of some type for a specific principal.

View Permissions

In complex process or block structures where you have multiple items executed by multiple users, you can define view permissions for the actions processed by different contributors based on process roles.

Information about view permissions is accessed through the modifiable block structure (com.sap.caf.eu.gp.process.api.IGPModifiableBlockStructure):

Method

Description

addViewRole(String blockStructureItemId,

            String roleId)

Adds a view permission for a specified block structure item.

deleteViewRoles(String blockStructureItemId)

Deletes all view permissions for a particular item.

deleteViewRole(String blockStructureItemId,

               String roleId)

Deletes a specified view permission.

containsViewRole(String blockStructureItemId,

                 String roleId)

Checks if the specified role has a view permission for the given block structure item.

getViewRoles(String blockStructureItemId)

Returns the Ids of the roles that have a view permission for the given block structure item.

Attachments

With the GP design time API, you can add attachments to the actions, blocks, and process objects that you create at design time.

Note

Attachments are stored in an attachment list. It is a container used by the:

       Design time to provide access to the available attachments  

       Runtime to provide access and keep changes (for example, new attachments, removal of attachments) in memory until the change is eventually propagated to the database 

For more information about attachment handling at runtime, see Managing Runtime Attachments Using the GP API.

The available attachment type handlers are:

      File (TYPE_FILE)

      URL (TYPE_URL)

      User management handler (TYPE_USER)

From the com.sap.caf.eu.gp.process.api.IGPModifiableActivity interface, you can use the following methods:

Method

Description

addAttachment(final String displayName,

              final String originalFileName,

              final String handlerName,

              final String creator,

              final byte[] content)

Adds an attachment to the attachment list by specifying display name, original file name, handler name, creator and content in bytes and returns a reference to the new attachment.

removeAttachment(String attachmentId)

Removes an attachment from the list.

For more information about specific attachment attributes, refer to Attachment Attributes.

Runtime Views

GP enables process contributors to observe different aspects of a process at runtime by means of different views. You can add and remove available runtime views (com.sap.caf.eu.gp.rtview.api.IGPRTView) when implementing the process object.

The GP framework provides a set of predefined runtime views, which you can use. Additional custom views can be implemented as well.

For more information about how to create custom runtime views, see Creating Custom Runtime Views Using the GP API.

From the com.sap.caf.eu.gp.process.api.IGPModifiableProcess interface, you can use the following methods:

Method

Description

setRuntimeViews(List views)

Defines the list of all views shown at runtime.

getRuntimeViews()

Returns the list of all views shown at runtime.

setDefaultRuntimeView(String viewID)

Defines the default runtime view.

getDefaultRuntimeView()

Returns the Id of the default runtime view.

For more information about runtime views, refer to Defining Runtime Views.

End of Content Area