How to create your first XDE procedure
This tutorial will describe how to create your first XDE procedure. This will introduce concepts such as the XDE perspective, creating a new project and procedure, editing procedures and running the procedure using the built in XDE engine.
Hello World #
In this tutorial we will create the "Hello World" XDE package. This package will simply return the string "Hello World" when run.
Change to the XDE Perspective #
The XDE perspective is the arrangement of windows and views that best suits the XDE developer.
If you're not already in the XDE development perspective then select Window > Open Perspective > Other... and then select XDE Development from the popup dialog. Note how the palette window is added to our view.
Create a new XDE project #
Before creating a new procedure, we need an XDE project to put it in. In the main menu select File > New > Project... and then select XDE Development > XDE Project from the popup dialog. Enter Hello World for the project name, then click Finish. This project will contain all the functionality of our XDE package.
Create a new procedure #
We now add our workflow logic by creating a procedure file. In the main menu, select File > New > XDE Procedure. Change the filename from the default to HelloWorld.xde and then click Finish. The default procedure, including only a start and return step will be shown. Note also that the palette is now populated with the various step types and tools which can be used to define workflow logic.
Modify the procedure #
We can now add our functionality. The newly created procedure does nothing useful so we need to return something. Select the Return step and then click on the empty expression field to edit the return value. In the popup editor type "Hello world!" and then type Ctrl-Enter. Save the workflow by selecting Save from the File Menu.
Run the procedure #
The SDK has an built in XDE engine, allowing us to run and test our procedures as we will build them. To do this, from the main menu select Run > Open Run Dialog.... Double click on XDE Procedure to create a new run configuration. Type Hello World into the name field of the run configuration. Click Browse and then select HelloWorld.xde as the procedure to run from this configuration. Click Apply and then click Run to run the procedure.
On completion of the procedure, you will be shown a result document describing the execution of the workflow. Not the exit value at the top of this dialog, this should match our procedure return value - Hello World!.
Debug the procedure#
Note that you can stop a procedure at any point by adding a breakpoint to a step. This allows you to examine the state of any variable at that point in the execution. To do this, select the step you wish to stop on and from the Run menu select Toggle Breakpoint.
To debug your procedure, from the main menu select Run > Open Debug Dialog.... Select the Hello World run configuration and then click Debug to run the procedure in the debugger.
Generate an XDE Package #
To export your new project as an XDE package, right click on the Hello World project and select Export as XAR file. Choose a filesystem destination for the XAR file and then click Finish. This package can now be shared with our developers or distributed and ran in other XDE engines.