[PDK Series] Coding a Real Plug-in Part II

After the use case description I’ve done on the previous post it’s time to start working on our plug-in, and the first thing to do that is talking about the enviornment that we need. So, we are going to use the Plug-in Development Kit 6.1 with the latest version of TIBCO AMX BusinessWorks we have available at the time I’m writing these that it is the TIBCO AMX BusinessWorks 6.3.

And the first thing we have to do it is to create the “plugin skeleton” or the plug-in structure (I don’t know if I should write plugin or plug-in, so I think I’m going to be changing from one form to another, I hope you can forgive me for that Open-mouthed smile ). To do that as it was explain on my first post about PDK, we have to launch the wizard the TIBCO AMX BusinessWorks Studio for Designers.

This time we are going to repeate the step-by-step because it isn’t the goal of this thing, but I’m going to highlight the key aspects about the work we are done.

The first thing we have to do after we complete the meta-data of the plug-in it is to define the operations our new palette is going to have. In this case, I want to start with little features and then we are going to improve them. So, I’m going to start with two operations: send and receive.

NOTE: Another relevant aspect it is the images. You are going to need one image for the whole palette (32×32) and then one image for each of the activities (48×48). I’ve done mine with the GIMP and using the official logo of the product. I hope they don’t mind.

The activity definition is one of the most important things here because we have to take some decisions here for each activity:

  • Activity Type: We have to decide which activity type are each one of we have defined on the palette. And we have the following options:
    • Synchronous: This is the normal activity that blocks the process flow until it is finished and get the output available for the next tasks in the process.
    • Asynchronous: This is an asynchornous approach when the activity it is launch and the flow doesn’t wait until it finishes and the output of the activity it is not available for the process. It is similar when you do a Spawn call-process on TIBCO BusinessWorks 5.x
    • Process Starter: This is a process starter activity who launches instances processes.
    • Signal-In:  This is a mix about the process starter and the synchronous activity. It its an activity that it is on the middle of the process and block the process until it receives a signal from outside the process. Samples of this category are: Wait for JMS message or similar ones.
    • Abstract:  This is not a BW activity and it is only for sharing information and code with another activities.
  • Configuration Paratemers: For each activity you have to define which parameters are available to be specified when you drag and drop that activity inside a BusinessWorks process. The things that you can configure are:
    • Name and Lable of this parameters
    • Control Type, so you can configure if you want to allow the user to type text or to select from a group of choices, a button, a password field, a file dialog, property field or so.
    • Default value
    • The section that property should be shown: You can configure from General and Advanced but you can add your custom ones (we’ll see that in detail on another post)
    • You can specified if that is Required field or if it is a Property field.
  • Input/Output/Fault Schemas: The other main key aspect is how to configure the different schemas for activity: input, output and fault (for exceptions). We have choose here again about different possibilities:
    • XSD/WSDL
    • XSD Editor: You are going to use the default Eclipse XML Schema editor to create the different schemas for the different components.
    • Java Code: You use java to build your needs.
    • None: If you don’t need any configuration for that field

You can choose for the option that you want, but that option will be the same for the three components: input, output and fault.

After you configure that things, you are going to allow the wizard to generate a lot of Java code and Java projects to create all the structure that you need to create your plug-in.

In our specific case, we have created the following artifacts:

  • RabbitMQSender Activity (Synchronous) :
    • ‘Host’ configuration attribute (TextBox / Required / Module Property) on the General Section
    • ‘Port’ configuration attribute (TextBox / Required / Module Property) on the General Section
    • Input schema:
      • queue attribute (string).
      • message attribute (string).
    • Output schema:
      • sent attribute (boolean).
  • RabbitMQReceiver Activity (Process Starter) :
    • ‘Host’ configuration attribute (TextBox / Required / Module Property) on the General Section
    • ‘Port’ configuration attribute (TextBox / Required / Module Property) on the General Section
    • ‘Queue configuration attribute (TextBox / Required / Module Property) on the General Section
    • Input schema:
      • No input Schema
    • Output schema:
      • message attribute (string).

We are going to continue advancing on this task in the following weeks so, stay tuned!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s