Built-in Tasklets and Weblets Packaged with JobServer

The following Tasklet and Weblet components, called Bundles, are a sample of some of the components that come packaged with JobServer. This Bundles extend and customize the functionality of JobServer for your job processing and GUI customization needs. The HelloWorld group of Tasklets are a good way to learn more about the API. Review the documentation for these Bundles, including the source code, to learn more about how to develop your own Bundles to build Jobs and Applications. There are also several functional Bundles like EMailAlert and ShellScript that are part of the BeanSoup project which are also packaged with JobServer. You may find these useful for actual use in your solutions and they are also a good way to learn more about how to develop your own advanced Bundles.

Javadoc details for these BeanSoup Bundles can be found here. You can also view additional details on a specific Bundle by using the Tasklet/Weblet Component tool accessable from the JobServer Workbench. With this tool you can view the developer meta information and view the actual GUI interface associated with the Bundle (if one exists). Additional information including source code can be found at the BeanSoup project website.

Sample Bundles Implementing Tasklets

  1. HelloWorld (part 1)
  2. HelloWorld (part 2)
  3. HelloWorld (part 3)
  4. HelloWorld (part 4)
  5. EMailAlert
  6. ShellScript
  7. JobServerCleanup
  8. Hello Mule

Sample Bundles Implementing Weblets

  1. GWT Mail Demo
  2. Hello Mule App (part 1)
  3. Hello Mule App (part 2)
  4. Hello Mule App (part 3)
  5. Hello Bundle Services

Get started creating your own Tasklets and Weblet Bundles! If you think others would find them useful feel free to share them by contributing your components to the beansoup project.

HelloWorld (part 1)

Hello world (part 1) example Tasklet. This is the simplest possible implementation of a Bundle Tasklet. It does not use any of the more advanced features like Weblet or IOViewer, input JavaBeans, output JavaBeans, etc. It only implements the Tasklet interface and can be used to create a very simple job.

When run as part of a job, this Tasklet logs the message "Hello out there" using the Java Logging API.

HelloWorld (part 2)

Hello world (part 2) example Tasklet. This is a simple implementation of a Bundle Tasklet. It expands on the part 1 version by having the Tasklet use an input JavaBean to store the person's name used in the hello message.

The Tasklet uses the Java Logging API to log the hello the message when run in a job. The message includes the person's name found in the input JavaBean.

Note, that this Tasklet does not include a Weblet customizer to edit the input JavaBean.

HelloWorld (part 3)

Hello world (part 3) example Tasklet. This is a slightly more advanced implementation than the part 2 example. It expands on the part 2 version buy including a simple Weblet to edit the input JavaBean for the Tasklet.

In this example the input JavaBean property, personName can be edited directly by the Weblet. The Weblet also persists any changes made to the input JavaBean.

The Tasklet uses the Java Logging API to log the hello message when run in a job. The message includes the person's name found in the input JavaBean.

HelloWorld (part 4)

Hello world (part 4) example Tasklet. This Tasklet is useful as a template and example for implementing new Tasklets. This example is more advanced version than the part 3 example. It exercises many of the features available to Tasklets including input JavaBean, output JavaBean, Weblet to edit the input JavaBean and an input IOViewer and and ouput IOViewer to view the input and output JavaBeans used when run in a job.

EMailAlert

This Tasklets sends email alerts and notifications. It can be used in a variety of ways by a job. For example, it can be used as the first Taklet to inform the user that the job has started processing or it can be used as the last Tasklet to inform the user that the job has completed processing.

The Weblet for this Tasklet allows the user to set the default values of the to/from/subject/body properties of the email message. These properties can also be set dynamically when the job runs and thus passed in on the fly as input from another Tasklet. So you could dynamically set the email addresses or the body of the message as necessary from another Tasklet.

ShellScript

This Tasklet can execute an arbitrary unix or dos shell script. It includes a Weblet where the script can be defined and edited. The standard out and standard error of the script are saved in an output JavaBean and can be viewed using the IOViewer for given job runs. This can be used to give you an exact audit trail of the exact script content that was used for each job run.

JobServerCleanup

A Tasklet used within the JobServer environment for cleaning up various logging data and outdated database records and trimming historical records. When run regularly, it keeps the JobServer environment well maintained. it includes a Weblet for setting the threashold for how much data to trim from the given database tables.

GWT Mail Demo

This example takes the GWT Mail example founding the GWT project and wraps it into a Weblet. It shows how easy it is run just about any standard GWT code as an soafaces Weblet.

Hello Mule

Example of a simple hello world component. This component implements both a Weblet and a Tasklet interface. The Weblet allows the user to edit/customize the MuleInputBean. This allows the MuleInputBean to be used as input to the Tasklet when this Tasklet is run in a Workflow/Job. In addition, this example shows how the Tasklet can use the native MuleClient interface to access Mule services when a job/workflow is run.

Hello Mule App (part 1)

Example of a simple hello world component that demonstrates using a Weblet to build a GUI application. The application/Weblet calls the UniversalClient interface to invoke a simple web service. This shows how "you can build GUI applications using GWT, and backend services using Mule/SOA directly from withn the Weblet interface and without writting any server side code. This component uses a MyInputBean JavaBean for persistence to store the endpoint name and username. Again no server-side code, all the persistence is automatic.

Hello Mule App (part 2)

Example of a simple hello world component that demonstrates using a Weblet to build a GUI application. The application/Weblet calls the MuleClient interface to invoke a simple web service. This shows how you can build GUI applications using GWT, and backend services using Mule/SOA directly from withn the Weblet interface and without writting any server side code. This component uses a MyInputBean JavaBean for persistence to store the endpoint name and username. Again no server-side code, all the persistence is automatic. Also, this examples passes the input JavaBean to the Weblet using JSON so there is no requirement that the JavaBean implement the IsSerializable interface so long as the JavaBean can be serialized into JSON.

Hello Mule App (part 3)

Example that demonstrates using the UniversalClient directly from a Weblet. Shows how to return java objects using JSON. soafaces will automatically serialize your data transfer objects into JSON so long as you include the DTO (data transfer object) in the soafaces Bundle lib directory. You should place the the DTOs in the jar and in the lib directory within the Bundle. Use the username/password of "guest"/"guest" for the signon service to succeed.

Hello Services

Demonstrates using the UniversalClient interface to access locally implemented services, instead of Mule services. This shows how the UniversalClient can invoke POJO objects and services that are included in the Bundle. The POJO service in the this example is from the UniversalClient by the service name sfb://org.beansoup.helloservices.services.HelloServices/hello.





Copyright © Grand Logic, Inc. All Rights Reserved.