This figure demonstrates the relationship of various AC4J components—Active EJBs, interaction, process, reaction, data tokens and the AC4J data bus.

Interaction is a long-lived unit of work that reflects the behavior of a business transaction. Interaction can have multiple processes, and every process can have multiple reactions. Every process has a base (or a root) reaction. Also, a process is mapped 1-to-1 with an Active EJB instance. An Active EJB instance and its method are created when a request for service arrives. If all the input parameters (in the form of data tokens) to this Active EJB method are provided (or arrived in the data bus), then the reaction is fired inside the process. The asynchronous communication between the client and all reactions is controlled by the AC4J data bus.

The figure shows an Interaction 1 with two processes: takeOrder and checkINV. The first takeOrder process is associated with an Active EJB called JEMPurchaseOrderBean, which has a reaction (base reaction: takeOrder). This reaction requests services from another Active EJB called JEMInventoryBean to complete the interaction. The request is routed through the AC4J data bus and is shown as the first call(checkINV Process) to the data bus with an arrow pointing from the reaction to the AC4J data bus. This activates the Active EJB, JEMInventoryBean, and fires the reaction, checkINV. This step is shown as an arrow from the data bus to the checkINV Process [fireReactionIn(checkINV Process)].

Once the checkINV reaction completes (business logic), it returns the results to the calling process, takeOrder. The return goes through the AC4J data bus and is named returnTo(takeOrder Process), as step #3. Finally, the returned data token fires another reaction (not shown in the figure) inside the takeOrder Process. This step is shown as an arrow from the AC4J data bus to the AC4J server [fireReactionIn(takeOrder Process)].

The reaction is activated only when all the data tokens are available and the conditions are matched, which causes the method to execute. The reactions can "push" and "pull" the data tokens from the AC4J data bus. The return values from an Active EJB method (or reaction) are transformed into a data token by the AC4J infrastructure. Similarly, the AC4J infrastructure transforms the data tokens to the valid input parameters.