com.sap.caf.eu.gp.process.api

Interface IGPModifiableBlockStructure

All Superinterfaces:
IGPBlockStructure

public interface IGPModifiableBlockStructure
extends IGPBlockStructure

Defines the internal structure of a block. Allows addition, removal, insertion and replace of child activities wapped in IGPBlockStructureItems. The block items are stored in a list, which defines the default worklfow ordering i.e. if there are no transitions between the items. Child block items can be accessed by their index in the list or by their id. In addition the block structure allows to set view roles for its items. View roles determine who can observe the status of certain activities during runtime.

Version:
0.1

Method Summary
 IGPModifiableBlockStructureItem addItem(IGPModifiableActivity activity)
          Create a new block item with the specified activity and add it to the end of children list.
 void addViewRole(String blockStructureItemId, String roleId)
          Adds a view permission for the given role for the given block structure item
 boolean containsViewRole(String blockStructureItemId, String roleId)
          Checks if the given role has a view permission for the given block structure item
 boolean deleteViewRole(String blockStructureItemId, String roleId)
          Removes the view permission for the given role for the given block structure item
 void deleteViewRoles(String blockStructureItemId)
          Removes all view permissions for the given block structure item
 IGPModifiableBlock getBlock()
          Get the block this structure is associated to.
 Iterator getItems()
          Get the children items of this block structure.
 IGPModifiableBlockStructureItem getModifiableItem(int index)
          Get the block item at a given index.
 IGPModifiableBlockStructureItem getModifiableItem(String itemId)
          Get the block item with a given id.
 Iterator getViewRoles(String blockStructureItemId)
          Returns the roleIds of the roles that have a view permission for the given block structure item.
 IGPModifiableBlockStructureItem insertItem(int index, IGPModifiableActivity activity)
          Create new block item and insert it at the specified position in the list.
 boolean removeItem(int index)
          Delete the block item at a given index.
 boolean removeItem(String itemId)
          Delete the block item with a given id.
 IGPModifiableBlockStructureItem setItem(int index, IGPModifiableActivity activity)
          Create new block item and set it at the specified position in the list.
 void swap(int first, int second)
          Swaps two block structure items.
 
Methods inherited from interface com.sap.caf.eu.gp.process.api.IGPBlockStructure
getIndexOf, getItem, getItem, getItemCount, getItemsIterator
 

Method Detail

getBlock

IGPModifiableBlock getBlock()
Get the block this structure is associated to.

Returns:
the parent block

addItem

IGPModifiableBlockStructureItem addItem(IGPModifiableActivity activity)
                                        throws GPInvocationException
Create a new block item with the specified activity and add it to the end of children list.

Parameters:
activity - the activity - block or action to add
Returns:
the newly create block item
Throws:
GPInvocationException - if the activity argument is not of type IGPModifiableAction or IGPModifiableBlock

insertItem

IGPModifiableBlockStructureItem insertItem(int index,
                                           IGPModifiableActivity activity)
                                           throws GPInvocationException
Create new block item and insert it at the specified position in the list. The item previously on position index will be shifted forward.

Parameters:
index - the index at which to insert the item
activity - the activity to add
Returns:
the newly created block item
Throws:
GPInvocationException - if the activity argument is not of type IGPModifiableAction or IGPModifiableBlock

setItem

IGPModifiableBlockStructureItem setItem(int index,
                                        IGPModifiableActivity activity)
                                        throws GPInvocationException
Create new block item and set it at the specified position in the list. The item previously on position index will be removed from the list.

Parameters:
index - he index at which to set the item
activity - the activity to add
Returns:
the newly created block item
Throws:
GPInvocationException - if the activity argument is not of type IGPModifiableAction or IGPModifiableBlock

getModifiableItem

IGPModifiableBlockStructureItem getModifiableItem(String itemId)
Get the block item with a given id.

Parameters:
itemId - the item id
Returns:
the child block item with the specified id or null if none.

getModifiableItem

IGPModifiableBlockStructureItem getModifiableItem(int index)
Get the block item at a given index.

Parameters:
index - the item index
Returns:
the child block item at the specified index.

removeItem

boolean removeItem(String itemId)
Delete the block item with a given id.

Parameters:
itemId - item id
Returns:
true if the item existed; false otherwise

removeItem

boolean removeItem(int index)
Delete the block item at a given index.

Parameters:
index - item index
Returns:
true if the item existed; false otherwise

getItems

Iterator getItems()
Get the children items of this block structure.

Returns:
iterator of IGPModifiableBlockStructureItems

swap

void swap(int first,
          int second)
Swaps two block structure items.


addViewRole

void addViewRole(String blockStructureItemId,
                 String roleId)
Adds a view permission for the given role for the given block structure item

Parameters:
blockStructureItemId -
roleId -

deleteViewRoles

void deleteViewRoles(String blockStructureItemId)
Removes all view permissions for the given block structure item

Parameters:
blockStructureItemId - *

deleteViewRole

boolean deleteViewRole(String blockStructureItemId,
                       String roleId)
Removes the view permission for the given role for the given block structure item

Parameters:
blockStructureItemId -
roleId -
Returns:

containsViewRole

boolean containsViewRole(String blockStructureItemId,
                         String roleId)
Checks if the given role has a view permission for the given block structure item

Parameters:
blockStructureItemId -
roleId -
Returns:

getViewRoles

Iterator getViewRoles(String blockStructureItemId)
Returns the roleIds of the roles that have a view permission for the given block structure item.

Parameters:
blockStructureItemId -
Returns:


Copyright 2009 SAP AG Complete Copyright Notice