Jitterbit Architecture and Best Practices
Jitterbit Architecture and Best Practices
1. Introduction
This document is prepared for AppZen to provide an overview regarding best practices to be
followed while developing projects in Jitterbit and provide architectural recommendations for
the Jitterbit operations to improve code reusability.
While creating Jitterbit operation chains it is recommended that the following suggestions be
followed, as much as possible:
a. Dot Notation Naming Scheme – Using a dot notation allows for easy organization
of operations, scripts, transformations, etc. into folders. This not only improves
readability but also ensures that operations can be easily found and reused.
As an example, consider that we work with two platforms, Oracle Fusion and
AppZen. Both these platforms are going to require different set of operations to
achieve the integration goals.
Let’s assume that for Oracle the following operations are made available:
i. Get all reports
ii. Get report details
iii. Get attachment
Similarly, in case of AppZen API the following operations are made available:
i. Check if report exists
ii. Upload report
iii. Upload image
This notation is not only recommended to be used for operations, but also for
global and project variables, since it makes it easy to associate them to the
appropriate functionality and thereby increases maintainability of code.
For example, in case of Oracle Fusion there might be API endpoints to set, so it
would make sense to use a variable name like $fusion.http.url,
$fusion.http.headers and $fusion.http.operation to set the
target URL, the headers and the HTTP verb type (GET, PUT, POST, etc.).
A similar approach should be taken for the transformations and scripts as well.
b. Library Style Operations – It is important to design all operations with the idea that
they will be re-used, and as such architect your project to take the shape more of
a library than individual operation chains. It might take time in the beginning to
develop projects following this approach, but in the long run it makes code more
maintainable, allows for multiple developers to work on it at the same time and
makes it reusable.
Following the example of Oracle Fusion and AppZen, from the previous point, it is
recommended that the library operations be organized as below:
The recommended way to set this up would lead to the operations being
connected as shown below:
The simple script that would be used in this case, would look similar to this:
As you can see, following this approach makes your project into a simple step-by-
step chaining of operations. This also allows for the Oracle Fusion, AppZen and
CheckReportExists components to be developed individually, possibly even in
different projects so that multiple developers can focus on separate individual
tasks. Not only does this simplify project development, but also improves
maintainability and reusability.
Continuing the example presented above, you will notice that the input/output
global variables were standardized to the following names:
i. fusion.inout
ii. appzen.inout
iii. flows.inout
e. Standardize Logging – While Jitterbit does a good job of logging events, there is no
mechanism to log payloads being sent to a target. Combining aforementioned
methods, with a standardized logging approach solves this problem.
If you look at the image shown above, you will see that there is a logging script that
has been inserted before the source and after the target in each operation. The
script being used is exactly the same for each system, i.e. Oracle Fusion, AppZen
and the Jitterbit Flows being created in this project.
The only change as per the system of relevance is to use the appropriate prefix, i.e
$appzen or $flows and to use the appropriate logging enable/disable variable,
i.e. $appzen.logging.enabled or $flows.logging.enabled.
Using this approach lets you see the incoming and outgoing payloads while also
controlling whether you wish to see the log or not. You could potentially build a
log level functionality like this as well.
f. Separate Target Calls from Transformation – For easier insight into what the
payloads look like and to also make target operations more reusable it is
recommended that the transformation and submission operations be separated
when possible. An example of this would like the following:
This can be achieved by following the approach of creating an error handler for
each library independently, such as what is shown in the image below for Oracle
Fusion. Similar error handlers can be created for other libraries as well (AppZen
and Jitterbit Flows in this case).
The on-error mechanism is used to raise and capture errors. The contents of
fusion.error.handler are quite simplistic here:
This can easily be expanded to send email notification, take records in databses or
even create a log file.
This common error handling approach would easily capture errors for each library
(eventually its own project), but to bubble the error back to the top level calling
operation it is also important that Jitterbit scripts use the Eval() function when
calling other operations. In our controller example operation, this can be done so:
Here the Eval() function is used like a try-catch function. The on-error
mechanism of the controller will then send the error to an error handler, where
we can capture it the way we prefer. An overview of this is shown below.
3. Architecture Recommendations
Based on the best-practices above, there are several architectural improvements that could
be made to the existing AppZen codebase. This would start by separating the calls made to
each endpoint (Oracle Fusion, AppZen, Workday, etc.) into separate projects. This would make
these almost like library functions that can then be called by another project.
The main flows that implement the business logic can then sit in their own project(s). An
overview of this architecture is provided below: