cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry (Work Manager in SMP): Determine the SMP Application ID and other metadata in Java

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

I enabled the transaction failure handling (see: ).

After doing that, the error files generated by this functionality are generated in the following folder ..\Server\configuration\com.sap.mobile.platform.server.agentry.application.[SMP_APPLICATION_ID]\[FAILED_TRANSACTION_QUEUE_PARAMETER_SET_IN_SMP]

In the Agentry project I created a Service Event, type Poll, to periodically read the error files in this folder and send them to a custom backend table for further processing.

The problem is that I had to hardcode the path to the folder in my step handler in the following way:


File _Folder = new File(

                    ConfigManager.getFilePath("configuration\\com.sap.mobile.platform.server.agentry.application.HARDCODED_SMP_APP_ID\\FailedTransactionsQueue"));

I would like to find a way to determine what is the Agentry app executing the step handler, to dynamically specify the corresponding folder to read the files.

How can I know the SMP Application ID from the Java backend? I tried to inspect the Server and ConfigurationManager objects but I haven't been able to find this property yet.

I also don't know what code is triggered to generate this XML error files in the server. I tried to inspect Agentry-v5.jar but I'm not able to find how the log error files are generated.

Thank you in advance for your help.

Marçal

Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Marcal,

Probably the best way will be to use the findConfigurationFile and get the Path from that and append your directory from there.

findConfigurationFile("javaBE.ini").getPath()

You may need to reference with super.findConfigurationFile depending on where you are calling it from.

--Bill

Marçal_Oliveras
Active Contributor
0 Kudos

Thank you Bill,

This works.

I just did a small change:


File _Folder = new File(_server.findConfigurationFile("JavaBE.ini").getParent() + "\\FailedTransactionsQueue");

Even though my question has been answered, I still have the folder name hard coded which can be changed from the SMP cockpit, but I think I can live with that. I don't see how to access to the SMP application metadata.

Marçal_Oliveras
Active Contributor
0 Kudos

Hi Bill,

For some reason I didn't mark the discussion as a question and now I can't mark your reply as the correct answer. I hope you can change that please.

Former Member
0 Kudos

Marcal,

The reason why is because you didn't mark it as a question. 

Can you can it?

Stephen

agentry_src
Active Contributor
0 Kudos

Now Marked as a Question as requested!

Cheers, Mike (Moderator)

Marçal_Oliveras
Active Contributor
0 Kudos

Thanks

Answers (0)