Interface BudgetBatchAdminSession
- All Superinterfaces:
AutoCloseable, BudgetAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Budgets in bulk. The
data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create a
Budget , a BudgetForm is requested using
getBudgetFormsForCreate() specifying the desired activities, fiscal
periods, and record Types or none if no record Types are
needed. Each of the returned BudgetForms will indicate that it is
to be used with a create operation and can be used to examine metdata or
validate data prior to creation. Once a BudgetForm is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each BudgetForm
corresponds to an attempted transaction.
The BudgetForms returned from
getBudgetFormsForCreate() may be linked to the originating request
through the peer Ids of the BudgetForm . In the case where
there may be duplicates, any BudgetForm of the same peer
Ids may be used for a create operation.
Once a batch of BudgetForms are submitted for create, a
CreateResponse is returned for each BudgetForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createBudgets() , errors specific to
an individual BudgetForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
BudgetForm through the BudgetForm Id .
For updates, BudgetForms are requested to the Budget
Id that is to be updated using getBudgetFormsForUpdate()
where the reference Id in the BudgetForm may be used to
link the request. Similarly, the BudgetForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The BudgetForm can only be used once for a successful
update and cannot be reused.
Once a batch of BudgetForms are submitted for update, an
UpdateResponse is returned for each BudgetForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateBudgets() , errors specific to
an individual BudgetForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
BudgetForm through the BudgetForm Id .
The delete operations delete Budgets in bulk. To unmap a
Budget from the current Business , the
BudgetBusinessAssignmentSession should be used. These delete operations
attempt to remove the Budget itself thus removing it from all
known Business catalogs. Bulk delete operations return the results
in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasBudgets(AliasRequestList aliasRequests) Adds anIdto aBudgetfor the purpose of creating compatibility.createBudgets(BudgetBatchFormList budgetForms) Creates a new set ofBudgets.Deletes allBudgetsin thisBusiness.deleteBudgets(IdList budgetIds) Deletes budgets for the givenIds.deleteBudgetsForActivity(Id activityId) Deletes budgets for the given activity.deleteBudgetsForFiscalPeriod(Id fiscalPeriodId) Deletes budgets for the given fiscal period.Deletes budgets expired before the given date.getBudgetFormsForCreate(BudgetPeerList peers, Type[] budgetRecordTypes) Gets the budget forms for creating a bunch of new budgets.getBudgetFormsForUpdate(IdList budgetIds) Gets the budget forms for updating an existing set of budgets.updateBudgets(BudgetBatchFormList budgetForms) Updates existing budgets.Methods inherited from interface BudgetAdminSession
aliasBudget, canCreateBudgets, canCreateBudgetWithRecordTypes, canDeleteBudgets, canManageBudgetAliases, canUpdateBudgets, createBudget, deleteBudget, getBudgetFormForCreate, getBudgetFormForUpdate, getBusiness, getBusinessId, updateBudgetModifier and TypeMethodDescriptionvoidaliasBudget(Id budgetId, Id aliasId) Adds anIdto aBudgetfor the purpose of creating compatibility.booleanTests if this user can createBudgets.booleancanCreateBudgetWithRecordTypes(Type[] budgetRecordTypes) Tests if this user can create a singleBudgetusing the desired record types.booleanTests if this user can deleteBudgets.booleanTests if this user can manageIdaliases forBudgets.booleanTests if this user can updateBudgets.createBudget(BudgetForm budgetForm) Creates a newBudget.voiddeleteBudget(Id budgetId) Deletes aBudget.getBudgetFormForCreate(Id activityId, Id fiscalPeriodId, Type[] budgetRecordTypes) Gets the budget form for creating new budgets.getBudgetFormForUpdate(Id budgetId) Gets the budget form for updating an existing budget.Gets theBusinessassociated with this session.Gets theBusinessIdassociated with this session.voidupdateBudget(BudgetForm budgetForm) Updates an existing budget.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getBudgetFormsForCreate
BudgetBatchFormList getBudgetFormsForCreate(BudgetPeerList peers, Type[] budgetRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the budget forms for creating a bunch of new budgets. A new form is returned for each supplied activity and fiscal period pair.- Parameters:
peers- a list of activities and fiscal periodsbudgetRecordTypes- array of budget record types to be included in each create operation or an empty list if none- Returns:
- the budget forms
- Throws:
NotFoundException- anactivityIdorfiscalPeriodIdis not foundNullArgumentException-peersorbudgetRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createBudgets
CreateResponseList createBudgets(BudgetBatchFormList budgetForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofBudgets. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
budgetForms- the budget forms- Returns:
- the create responses
- Throws:
NullArgumentException-budgetFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBudgetFormsForUpdate
BudgetBatchFormList getBudgetFormsForUpdate(IdList budgetIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the budget forms for updating an existing set of budgets. A new budget form should be requested for each update transaction.- Parameters:
budgetIds- theIdsof theBudget- Returns:
- the budget form
- Throws:
NotFoundException- abudgetIdis not foundNullArgumentException-budgetIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBudgets
UpdateResponseList updateBudgets(BudgetBatchFormList budgetForms) throws OperationFailedException, PermissionDeniedException Updates existing budgets. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
budgetForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-budgetFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllBudgets
Deletes allBudgetsin thisBusiness.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBudgets
DeleteResponseList deleteBudgets(IdList budgetIds) throws OperationFailedException, PermissionDeniedException Deletes budgets for the givenIds.- Parameters:
budgetIds- theIdsof the budgets to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-budgetIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBudgetsForActivity
DeleteResponseList deleteBudgetsForActivity(Id activityId) throws OperationFailedException, PermissionDeniedException Deletes budgets for the given activity.- Parameters:
activityId- theIdof an activity- Returns:
- the delete responses
- Throws:
NullArgumentException-activityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBudgetsForFiscalPeriod
DeleteResponseList deleteBudgetsForFiscalPeriod(Id fiscalPeriodId) throws OperationFailedException, PermissionDeniedException Deletes budgets for the given fiscal period.- Parameters:
fiscalPeriodId- theIdof a fiscal period- Returns:
- the delete responses
- Throws:
NullArgumentException-fiscalPeriodIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveBudgetsByDate
DeleteResponseList deleteIneffectiveBudgetsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes budgets expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasBudgets
AliasResponseList aliasBudgets(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aBudgetfor the purpose of creating compatibility. The primaryIdof theBudgetis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another budget, it is reassigned to the given budgetId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-