Set the Transaction Name After a Start
The following example shows how to set the transaction name after it has been started. This is useful if you want to split transactions based on events that happen in your application:
public String checkout(List<ItemOrders> orders) {
AppdynamicsAgent.startTransaction("Checkout", null, EntryTypes.POJO, false);
/*******************
* Method Body Here
*******************/
if (orders.isEmpty()) {
AppdynamicsAgent.setCurrentTransactionName("Empty Cart");
}
AppdynamicsAgent.getTransaction().end();
}