Creating a Simple Workflow
A very simple workflow, Test2Workflow, is provided as an example in the net.juniper.smgt.workflow.samples package. This workflow is composed of only three work items: StartState, LazyLoggerWkItem, and EndState. The LazyLoggerWkItem item is in the wkitemexamples package. Both packages are in the wf_samples.jar file, which is assigned by default to one of the JAR archivist fields. A JAR file can contain various workflows and their respective parameter lists.
The LazyLoggerWkItem prints to the standard output the values of two properties obtained from the User object related to this service provisioning: Name and Address. Those parameters are hard-coded inside the work item. The value of the name property will be included in the message the work item logs to the console. You can assign any value to Name. Name and Address are only workflow terms; that is, they are not real attributes of the User object. According to the translation table, the attribute names are cn for the Name and postalAddress for Address.
Figure 2 shows the sample workflow. The OK output of the StartState work item connects to the LazyLoggerWkItem input. The OK output of LazyLoggerWkItem connects to the EndState work item.
![]()
Building the Workflow
Perform the following steps to build this workflow:
- Select the samples package and open the dialog box to create a new class.
- Change the base class from java.lang.Object to net.juniper.smgt.workflow.Workflow.
- Check the box compose class visually.
- Click Finish.
The tool creates the class and opens the VCE window for that class.
- Place a StartState, an EndState, and a LazyLoggerWkItem icon in the design area.
- Connect the StartState and LazyLoggerWkItem icons.
A dialog box displays the properties that you can use to make a connection.
- Select the property OK, and click Ok.
- Select the LazyLoggerWkItem icon to display a pop-up menu with the options available for that connection.
- Choose this from the pop-up menu.
A solid green line connects the OK output of the StartState icon to the input of the LazyLoggerWkItem icon.
A dialog box displays the properties that you can use to make a connection.
- Choose startState.
- Select the StartState icon to display a pop-up menu with the options available for that connection.
- Choose this from the pop-up menu.
Double-click on the LazyLoggerWkItem icon to open the bean property sheet, and specify a name by editing the name property.
Creating a Parameter List
After creating a workflow, you must create a parameter list for it. A parameter list specifies the data the system needs from the directory to execute a workflow and the data that is written back to the directory.
- In the same package as the workflow, create a new class extending net.juniper.smgt.workflow.WFParameterList with the name Test2WorkflowParameterList. Do not compose the class visually.
- Edit the constructor of this class, and add the two strings Name and Address to the inputParameters property.
Because the sample workflow does not write anything to the directory, you do not need to specify any output parameters.
To make the workflow and parameter list available to the workflow engine, export the TestWorkflow and TestWorkflowParameterList classes to a JAR file named test.jar, in the desired directory. See the VAJ documentation to learn how to perform this task.
To configure the workflow engine to see the JAR file:
- Launch the local configuration tool for the workflow engine.
/opt/UMC/wkf/etc/config- Select the Library tab.
- Enter test.jar in one of the JAR Archivist fields.
Deploying the Workflow via the Directory
Alternatively, you can deploy the workflow via the SDX directory instead of as a JAR file. This method eliminates the need to create the Test2WorkflowParameterList class. Instead, you use SDX Admin to create a workflow object named Test2Workflow in the Workflows subtree. This object contains the parameter list in string format.
You must specify the qualified class name (that is, including the package name) of the workflow you just built. Finally, import into the directory the class bytecodes, which are obtained from the compiled workflow (.class) file.