Job Management System Quick Start Guide
BUSINESS MASHUPS - THE FINAL PRODUCT Hybrid Integration’s Job Management System (JMS) is designed to take different input sources, manipulate data,
The mashup is considered the final product, and even though you can run individual services without a mashup,
and produce different outputs. Once you’ve defined all of the services necessary to achieve the desired result, you combine them, or mash them up, into a single “mashup”, creating a
there is a great advantage to placing even one service into a mashup. Any future modifications or additions don’t require you to start over; you can just build on the existing mashup. Let’s
reusable flow for business data.
explore how to create mashups in JMS.
INPUT SERVICE FORM INPUT JMS can be configured to start with a form as input. Since every service will usually require some input from the user, this is the place to “kickoff” your mashup. You can build the form in several different ways, but the main concept is to send in 3 pieces of data to begin. It is important that you include all of the input values you expect to use, so you can avoid replacing the input service each time. The main 3 methods are listed below; sending in either of these posts will prompt JMS to create: INPUT SERVICES A popular way to input to a mashup.
HTML FORM Posting an HTML form automatically creates an input service if it doesn’t exist. If the service exists, it will run each time.
A MASHUP IS AUTOMATICALLY CREATED The first time a form is posted to JMS, it will automatically insert the form fields as an input service to start off the mashup. Every subsequent post to that jobcast will run through the existing mashup.
URL STRING (GET) Simply posting to / JobManagementSystem/formRequest? jobcastname=tutorial&id=1 will automatically create a mashup with a form input as the first module. Adding additional vars is possible by adding &name=george&other=something, etc.
INPUT SERVICE FIELDS The fields posted to JMS are translated into service input fields, and usable in the rest of a mashup.
HTML FORM POST To hide the vars from the url, or to include several variables, you can use a traditional HTML form to post to JMS. This is advisable when you are passing in several user defined fields.
1.
An Input service with the values which were passed in when it was created. It will be named with the Jobcast name + form ie., myserviceform
2.
A mashup with the input service as the first module. This is where you can combine multiple other services, and use rules to manipulate the data.
3.
A mashup service, which is an “instance” of the mashup. Each time you change the mashup, you need to remake the mashup service.
AJAX CALL Ajax calls are supported to eliminate the need for the page to navigate to JMS. Utilizing javascript, you can post to / JobManagementSystem/formRequest? jobcastname=tutorial&id=1 and achieve the same result as a GET or POST.
FORM INPUT SERVICE (TUTORIAL STEP ONE) For the quick start tutorial, let’s do the following:
FIND THE ADDRESS OF JOB MANAGEMENT SYSTEM The URL of JMS will be needed first, and is probably something like http://localhost:8080/JobManagementSystem/ or http:// 75.146.223.217:8080/JobManagementSystem/.
THINK UP A CLEVER NAME FOR YOUR FIRST SERVICE Think about what the service is going to do, and make a name that will be easy to identify. Once you have 100 mashups, they all start to look the same.
Here are a few examples.
GetJobsById
InsertContactData
SearchCustomersByName
Once you have your “jobcastname” figured out, we can move to the next step.
IDENTIFY THE FIELDS THE MASHUP NEEDS TO OPERATE If you created a jobcast name like GetJobsById or InsertContactData, you will need the additional fields. For example, GetJobsById will need a JOBID, and InsertContactData might need &NAME=george&EMAIL=georgem@hybridintegration.com.
THAT’S EVERYTHING - LETS CREATE A MASHUP Type directly into the browser url: the address of JMS, and append the formRequest, jobcastname, and inputfields, like below. http://75.146.223.217:8080/JobManagementSystem/formRequest?jobcastname=GetJobsById&id=1 After you post that the first time, you can now log in to JMS, and look at the input service list. You will see your input service in the list on the left. If you select it, you will see your service requests to the right. Double click on the service request, and click on the input tab. You should find your id in there.
Now go to the Manage menu, and select Mashups. You should see a mashup with your jobcastname. If you double click the mashup, you will see that the first module is your input service. Every time you run that URL, it will invoke a service request in your mashup service.
DATABASE QUERIES JDBC SQL FUNCTIONS JMS DATABASE CONNECTIONS You can Insert, Update, Delete, and Select from any standard SQL database, using the queries in JMS. Caution: Please consult the manufacturer for the database when performing any write queries. You can damage a database with improper queries. Once you’ve established a database connection, it is possible to add multiple queries to different tables, and add, retrieve, or update data within a mashup. The rules for doing these functions will be covered under the rules topic, but for now, let’s see how we can add a database and a query. Special functionality: SQL Notations allow additional fieldnames to be added. select * from jobs where name=’$ {username=george}’ will yield a query with an input named username, even though it doesn’t exist in the database. It also sets the default value to george.
ADDING A DATABASE The first step in performing a query is to add the Database connection. You will
BUILDING A SQL QUERY Once you have a database connection, you can begin adding queries. Click on
ADDING JOBCAST FOR THE QUERY Database queries can be run independently, or within a mashup. To
need the Database Type:Host Name:Database Name:User Name:Password:Port. You only need to add the database connection once. All subsequent queries fall under adding a
Manage/Queries, and select the plus button to add your first query. In order to add a query, it must be performed once with valid data. You should see the resulting fields.
add it to your mashup, you must first save your query as a Jobcast.
database query.
DATABASE QUERY SERVICE (TUTORIAL STEP TWO) We will create a database connection, and a database query to add to our mashup. ADD THE DATABASE DEVICE This step is required once for each database you plan to connect. Select Manage/Database Connections to access the database dialog. When it opens, click the plus button to add a new Database connection. Make sure to select the database type, and complete the Host, DB Name, Username, Password, and port.
ADD THE DATABASE QUERY Once you have a database, you can add queries. Select Manage/Queries to access the query dialog. When it opens, click the plus button to add a new query. You will want to be sure to name this with something that makes sense, since you might have several queries. example_insert is the query shown here. We then select a database from the “using database” dropdown, then the table name from the “search in” dropdown, and finally the column from the last dropdown. The criteria can be filled out in the edit box. You will notice that the dropdowns will build a SQL query in the SQL Statement box. You can edit the query to suit your needs. A simple “Select * from Table” will suffice for the demo. The query “MUST” have a result the first time it’s run. This is necessary for us to capture the DB schema. You can also use a special notation to add fields to the input side of the query, e.g. select * from table where name=’${inputname=george}’ This example will expect a field called inputname as input to the query. With practice, these database queries will become quite intuitive and easy to implement using JMS.