Personnalisation avancée > Business Logic Customization > Reservation Service > Adding the Undo Reservation Action to a Menu
Adding the Undo Reservation Action to a Menu
An Undo Reservation action is provided for site and organization administrators to immediately release a reserved object for modification by a different user.
This action is available in object menus for out-of-the-box Windchill objects that use the reservation service.
For example, the change request information page includes this action:
The undoReservation action can be added to the action model of any object that implements the wt.reservation.Reservable interface. For example, the change request action model file includes the following undoReservation entry:
<model name="more change request row actions" menufor="wt.change2.WTChangeRequest2">
:
:
<action name="undoReservation" type="reservation"/>
:
:
</model>
Sample Code: Reservation Service
The following example shows the lines added to the change request edit action window. The code requires a reservation for the object being edited and performs update count validation when editing is complete:
<%@ taglib prefix="jca" uri="http://www.ptc.com/windchill/taglib/components"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="cwiz" uri="http://www.ptc.com/windchill/taglib/changeWizards"%>
<%@ taglib prefix="rwiz" uri="http://www.ptc.com/windchill/taglib/reservation"%>
<%@ taglib uri="http://www.ptc.com/windchill/taglib/attachments" prefix="attachments"%>
<%@include file="/netmarkets/jsp/components/beginWizard.jspf"%>

<%@include file="/netmarkets/jsp/components/includeWizBean.jspf"%>

<jca:initializeItem operation="${createBean.edit}"/>

<%@include file="/netmarkets/jsp/change/changeWizardConfig.jspf" %>
<%@include file="/netmarkets/jsp/annotation/wizardConfig.jspf" %>
<%@include file="/netmarkets/jsp/attachments/initAttachments.jspf"%>

<cwiz:initializeChangeWizard changeMode="EDIT"
varianceEffectivity="false" annotationUIContext="change"
changeItemClass="wt.change2.ChangeRequestIfc" />

<jca:wizard helpSelectorKey="change_editChangeRequest"
buttonList="DefaultWizardButtonsWithSubmitPrompt"
formProcessorController=
"com.ptc.windchill.enterprise.change2.forms.controllers.ChangeItemFormProcessorController">
<jca:wizardStep action="editAttributesWizStep" type="object" />
<jca:wizardStep action="affectedEndItemsStep" type="change" />
<jca:wizardStep action="affectedDataStep" type="change" />
<jca:wizardStep action="attachments_step" type="attachments" />
<jca:wizardStep action="associatedChangeIssuesStep" type="changeRequest" />
<jca:wizardStep action="associatedChangeItemsStep" type="change" />
</jca:wizard>

<rwiz:handleUpdateCount/>
<rwiz:configureReservation reservationType="modify"
nforcedByService="true" workflowOverride="true"/>

<attachments:fileSelectionAndUploadApplet/>

<script language='Javascript'>
change_postLoad();
</script>

<%@ include file="/netmarkets/jsp/util/end.jspf"%>
Est-ce que cela a été utile ?