cancel
Showing results for 
Search instead for 
Did you mean: 

Determining transaction to call dynamically

saumya_govil
Active Contributor
0 Kudos

Dear Experts,

I am using MII 12.2.6 and inside a transaction I need to make a sub-transaction call. But the name of the sub-transaction including the path needs to be determined at run time. I could do this far, and I then assign the transaction name in the incoming parameters of the 'Transaction Call' or even 'Dynamic transaction Call' action block and pass the input parameters for this transaction. But when I execute the transaction, as the sub-transaction is dynamically determined, the input parameters are not recognized and the transaction throws an error for unrecognized parameter names.

Does any one know how the transaction name and corresponding parameters be determined/passes dynamically?

Any help will be appreciated.

Kind Regards,

Saumya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Saumya,

  Since the transaction path is passed at run time, the action block is unable to determine the parameters and hence the error. A similar scenario comes up when you try to use a web service action block dynamically.

  However, since you already have the trasnaction path and the input parameters with you, I believe the easiest way to do would be a HTTPPost action block calling the Runner Servlet.

Regards

Tufale

saumya_govil
Active Contributor
0 Kudos

Hi Tufale,

Thanks for your reply. I also have XML file as an input parameter to the transaction. Would the HTTPPost work with a big XML file passed in the URL? Not sure if there is a limit to the length of the URL?

Any suggestions please?

Regards,
Saumya

saumya_govil
Active Contributor
0 Kudos

Hi Tufale,

I tried using the HTTPPost action. I use the URL as: http://localhost:50000/XMII/Runner?Transaction=<transaction_path> but not sure how to pass the input parameters to the transaction. Thankfully I have same input and output parameters for every local transaction as well. There are 2 input parameters, 1 is an XML file and another a Boolean value. Can you please suggest how to pass them with the HTTP Post?

I tried setting just the 'PostData' parameter of HTTPPost with the XML input ignoring the Boolean for now. Strangely the action gets executed with return 200, but the transactions seems to be never called!

Any hints please?

Regards,

Saumya

Former Member
0 Kudos

Hi Saumya,

  I would pass the input XML in the Post Data and the boolean along with the URL. To get the result out of the child transaction, mark an output parameter and add it to the URL you are building.

In the HTTPPost action block, use "ReturnAsXML" property to get the result out of the child transaction.

Here is a sample screenshot of how I passed the input parameter to the child.

To check if your child transaction is executing, you can

     1. Check the output of the transaction.

     2. Use event logger / write file action block to monitor the input  to the child.

Regards

Tufale Ashai

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Saumya,

I assume that the sub-transactions your are going to call is finite. Better use Switch Action Block and navigate to the required sub-transaction so, things work easy and faster.

Regards,

Parandgaman.GR

saumya_govil
Active Contributor
0 Kudos

Hi Parandgaman.GR,

Thanks for the reply. Unfortunately the sub-transactions are not finite. They might be specific to each country. Some might not already exist and are later added and determined based on the new country implementation. As I am creating a global solution, I need to have the flexibility to determine the transaction as they come.

Any suggestions on such special case please?

Regards,

Saumya

Former Member
0 Kudos

Hi Saumya,


Recommended option is to go with Switch case.


The alternate option is HTTP Post:

Check the link for explanation in passing parameter to Transaction runner URL.

Try to execute URL with proper input and output parameters directly in browser to check out put.


R,

Parandhaman