Try OpenEdge Now
skip to main content
Application Developer's Guide
Developing BPM Workflow adapters : Using system adapters : Using the PAKCreatePI adapter
 

Using the PAKCreatePI adapter

You can now define a Flow (private) presentation for the Start workstep of a BPM Project. When you right-click the Start workstep and select Open, BPM Designer automatically launches a Web application, with a workflow consisting of a Start workstep, followed by a CreatePI adapter workstep (to be performed by the PAKCreatePI adapter), and an End workstep.
Note: PAKCreatePI cannot be used in a Web application that is an interface to an Activity workstep in a BPM Project. It can only be used in a standalone Web application or a Web application that is used as an interface for a Start workstep in a BP Server application.
To use the PAKCreatePI adapter:
1. Click the Create PI workstep (left image, Figure 14) at the end of the BS_SVBSurvey Web Process (that is, after all significant worksteps have been completed) to display the workstep’s Properties view (right image, Figure 14).
Figure 14. Defining the PAKCreatePI adapter in an adapter workstep
2. The Performer box of this workstep displays the PAKCreatePI adapter. If this adapter is not displayed:
a. Click the ellipsis button beside the Performer box, launching the Performer dialog box.
b. Click New, to open the Performer dialog box for the Adapter workstep.
c. Enter a name for the Adapter performer in the Name box. Enter the Java class name for the adapter in the Class box. For the PAKCreatePI Adapter, enter com.savvion.BPM Workflow.beans.PAKCreatePI.
Figure 15. Performer dialog box for the PAKCreatePI adapter
The Method box is not enabled. You are only able to use the commit method for BPM Workflow adapters.
d. Click OK, returning to the Properties dialog box. The PAKCreatePI adapter class name is now displayed in the Performer box of the Properties dialog box.
e. Click OK, returning to the process template diagram.
Properties of the PAKCreatePI Adapter used to initialize the process (ptName) and report on errors (error) are presented in PAKCreatePI adapter properties.
If dataslot names are identical in the Web application and the BPM project, then the mapping of dataslots between these applications occurs by default. This is the case for most of the dataslots in the SVBSurvey sample application. Three dataslots, however, are not identical, and these are: PT_NAME, BIZSITE_USER and BIZSITE_PASSWORD.
Important: When using PAKCreatePI Adapter, do not define a user-defined dataslot called ptName, as this is a reserved word that has already been used. Instead, if the name of the WebApp is different than the name of the BP Server application, then you must define another username dataslot of type CHARACTER and map it to ptName when defining the input of PAKCreatePI.
For the PAKCreatePI Adapter to work correctly, the Web application must have dataslots that are mapped to the ptname, bizsite_user and bizsite_password dataslots in the BPM project. To map dataslot names that are not identical, navigate to the Advanced view of the Dataslots tab of the workstep’s Properties view to correctly map the dataslots before using them in the Web/BP Server interaction. Map the dataslots named ptName, bizsite_user, and bizsite_password to PT_NAME, BIZSITE_USER, and BIZSITE_PASSWORD respectively. As a further example, if you have a BPM Workflow CHARACTER dataslot type called myURL that is used to initialize a CHARACTER dataslot type in BP Server called ds1, then you must map myURL to ds1. For more information on mapping dataslots, see OpenEdge Getting Started: Developing BPM Applications with Developer Studio.
When this application is run, the PAKCreatePI Adapter creates a process instance for the user running the application.
3. You can also use the PAKCreatePI Adapter to create a process instance for another user, with the instance appearing in the user’s Task List page in Business Process Portal, by adding two new dataslots to the workstep, as shown in the following steps:
a. Open the Dataslots tab of the Create PI workstep’s Properties view. The "BIZSITE_USER" and "BIZSITE_PASSWORD" dataslots appear in the table on this tab. Make sure these dataslots are shown as Inputs to the adapter.
b. If these dataslots are not present, click Add and then New to open the New Dataslot dialog box.
c. Type BIZSITE_USER in the Name box, and type the user’s name in the Initial Value box.
d. Click OK.
e. Similarly, create the "BIZSITE_PASSWORD" dataslot. In this case, type the user’s password in the Initial Value box. Now, when the application is run, a process instance is created for the user identified in the "BIZSITE_USER" dataslot and the instance appears in this user’s Task List page.