1 Reply Latest reply on Feb 17, 2011 1:39 PM by Tom Cunningham

    Jboss - can we route to actions?

    Tanu Gulati Newbie


      i am updating my jboss-esb.xml code for exceptions. I have one exception handler service which as of now handles exception when <CarrierAdminSystem> is blank. now i want to update the service code to route properly so that when <policyNumber> field is blank we should get the error message as well but i do not want to create a new service in jboss-esb.xml


      below is the code


      1. <service category="Acord" 
      2. description="Handling 103 SubType Error Message" invmScope="GLOBAL" name="203ExceptionHandler"> 
      3.    <actions mep="RequestResponse"> 
      5.     <action 
      6.      class="com.foresters.esb.acord.A203HoldingInquiry.A203ExceptonHandler" 
      7.      name="A103TransSubTypeException" process="handleTransSubTypeErrMsg"> 
      8.      <property name="errorMessage203" value="CarrierAdminSystem does not have a valid value"/> 
      9.     </action> 
      11. <action 
      12.      class="com.foresters.esb.acord.A203HoldingInquiry.A203ExceptonHandler" 
      13.      name="A203PolicyNumberException" process="handleTransSubTypeErrMsg"> 
      14.      <property name="errorMessage203_policynumer" value="policy number is mandatory"/> 
      15.     </action> 
      16.    </actions> 
      17.   </service>  



      if you have notice above I have a class A203ExceptionHandler which is generic one and shows the error message depends on property defind in action (in this example "errorMessage203") is it possible to add some kind of condition here so that i can execute the actions based on some conditions i want to execute action A103TransSubTypeException or  A203PolicouyNumberException depends on some condition.

      can you please let me know how to do it

        • 1. Jboss - can we route to actions?
          Tom Cunningham Master

          I'm not sure what you're doing here - is something in your action producing an exception each time?    Is it the same code that produces an action in each instance?


          I'd take a look at the exceptions_fault quickstart - you might be able to rework this in a better manner.     Hard coding exception message strings in properties isn't an optimal way to handle things.