Actions that agents perform in Commerce Service Center are linked to ticket actions. Whenever an agent performs an action, it is possible that there will be an environment change made. Whenever an environment changes, a warning or a ticket disposition message may occur.

By default, ticket dispositions may occur with the following REST MVC calls:

When these warnings or messages occur, the data that can be returned is:

The following is an example of what the confirm chain returns as data:

{
  "allWarnings":["The current working order has items in it and has not been
      saved. If you continue, the order will be lost."},
  "activeTIcketDisposition":false,
  "isDiscardable":true
}

If you create an actor that requires a disposition message or error, it must provide information for the environmentChangeState service. The following example shows how the changeOrderActor includes the parameters referenced by the environmentChangeState service and defines the confirm actor-chain.

Note: The three environmentChangeState modifications are identified by comments in this example:

<actor-chain id="changeOrder" transaction="TX_SUPPORTS">
  <form id="changeOrder" name="/atg/commerce/custsvc/environment/ChangeOrder"
      var="changeOrder" handle="changeEnvironment">
    <input name="inputParameters.newOrderId" value="${param.newOrderId}"/>

<!-- Add for environmentChangeState parameters -->
    <input name="doWarnings" value="${param.doWarnings}"/>
    <input name="doTicketDispositionPrompt"
        value="${param.doTicketDispositionPrompt}"/>
    <input name="environmentChangeState.ticketDispositionOptions.
        dispositionOption" value="${param.dispositionOption}"/>
    <input name="environmentChangeState.ticketDispositionOptions.reasonCode"
        value="${param.reasonCode}"/>
    <input name="environmentChangeState.ticketDispositionOptions.ticketNote"
        value="${param.ticketNote}"/>
    <input name="environmentChangeState.ticketDispositionOptions.publicNote"
        value="${param.publicNote}"/>
<!-- End changes -->

    <input name="errorURL" value="${errorURL != null ? errorURL :
        '/model/atg/commerce/custsvc/environment/ChangeOrderActor/
        changeOrder-error'}"/>
    <input name="successURL" value="${successURL != null ? successURL :
        '/model/atg/commerce/custsvc/environment/ChangeOrderActor/
        changeOrder-success'}"/>

<!-- Add the confirmURL input for environmentChangeState -->
    <input name="confirmURL" value="${confirmURL != null ? confirmURL :
        '/model/atg/commerce/custsvc/environment/ChangeOrderActor/
        changeOrder-confirm'}"/>
<!-- End changes -->

  </form>
</actor-chain>
<actor-chain id="changeOrder-error" transaction="TX_SUPPORTS">
  <actor id="error" name="/atg/commerce/custsvc/environment/ChangeOrderActor"
      chain-id="error" return-model-var="model">
    <output id="model" add-map-children="true" value="${model}"/>
  </actor>
</actor-chain>
<actor-chain id="changeOrder-success" transaction="TX_SUPPORTS">
</actor-chain>

<!-- Add changeOrder-confirm chain for environmentChangeState -->
<actor-chain id="changeOrder-confirm" transaction="TX_SUPPORTS">
  <component id="fh" name="/atg/commerce/custsvc/environment/ChangeOrder"
      component-var="fh">
    <output id="allWarnings" name="allWarnings"
        value="${fh.environmentChangeState.allWarnings}"/>
    <output id="isActiveTicketDisposition" name="activeTicketDisposition"
        value="${fh.environmentChangeState.processActiveTicketDisposition}" />
  </component>
  <droplet id="shouldDiscardTicket" name="/atg/ticketing/droplet/
      ShouldDiscardTicket" var="shouldDiscardTicketParamStack">
    <input name="immediately" value="false" />
    <input name="ticket" value="${nucleus['/atg/svc/agent/environment/
        EnvironmentTools'].activeTicket}" />
    <oparam name="output">
      <output id="isDiscardable" name="isDiscardable"
          value="${shouldDiscardTicketParamStack.isDiscardable}" />
      </oparam>
  </droplet>
</actor-chain>
<!-- End changes -->

<actor-chain id="error" transaction="TX_SUPPORTS">
  <component id="fh" name="/atg/commerce/custsvc/environment/ChangeOrder"
      component-var="fh">
    <output id="formError" name="formError" value="${fh.formError}"/>
    <output id="formExceptions" name="formExceptions" value="${fh.formExceptions}"
        filter-id="detailed"/>
  </component>
</actor-chain>

Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices