Configuring agents

Enterprise agents

For enterprise agents, you can set the ColonyId or EnterpriseCode attribute in the agent criteria. If the EnterpriseCode attribute is passed in the agent criteria, the agent runs for the specified enterprise. If only the ColonyId attribute is passed in the agent criteria, the agent runs for those enterprises that match the ColonyId.

Enterprise agents implement the getJobsForEnterprise function, whereas other agents implement the getJobs function. In a sharded environment, transaction data for an enterprise can be in multiple colonies. When an enterprise agent that processes on this transaction data is run in a sharded environment, getJobsForEnterprise is called for each colony associated with the enterprise and the ColonyId is passed to each of the executeJob processes.

Consider the following scenarios in which either ColonyId and/or EnterpriseCode is passed when the Enhanced Order Monitor agent is run.

The enterprise agents that process across colonies are as follows:

Person Info Purge agents

Agents such as Person Info Purge and Person Info History Purge require a TableType attribute in the criteria, in addition to the ColonyId attribute. This is because the YFS_Person_Info and YFS_Audit tables exist in more than one shard and the agent runs with one TableType at a time. Therefore, for every colony, an agent must be configured with an agent criteria of TableType="TRANSACTION". In addition, an agent must be configured with an agent criteria of TableType="MASTER", where MASTER is common across colonies.

For example, consider a scenario in which an Enterprise (E1) has two Seller Organizations (Store1 and Store2) associated to it. To support sharding of transactional data, each of these Organizations are configured to colonies colony_E1, colony_Store1, and colony_Store2, respectively. These colonies have different Transaction shards but share the same Master shard. To purge Person Info records, there must be three criteria for TableType="TRANSACTION" (for ColonyId = colony_E1, colony_Store1, and colony_Store2) and one for TableType="MASTER" (for ColonyId=colony_E1).

If the TableType attribute is not set, the agent works for the default TableType for that table. For YFS_Person_Info, the default TableType is TRANSACTION.

Other agents

Agents that process transactional data, such as non-enterprise agents and other purge agents, accept ColonyId as a criteria, and it has to be passed to process the data in the corresponding shard. So a shard level criteria is required for all these agents and gets triggered separately.