Adding a New Service Operation for a Form or a Task
Adding a New Service Operation for a Form or a Task
Select an operation to create an HTML form used for sending a request message to a process. You can also select an operation to add a new service to a process request or task form.
If desired, you can modify an existing form or task form by adding fields and functions generated from service operations. A service operation is a WSDL operation from a Workspace WSDL that represents the endpoint of a BPEL process running in A Process Server. The operation must have a service name associated with it.
When a task or form is open in the Web Page editor, the Participants view, normally displaying process participants, shows only the service operations available for forms, as shown.
There are several use cases for adding new service operations. Here are some examples:
If you have an existing task or form, but the schema for the task or service operation has been updated, you can modify or add the additional fields to your existing form by dragging and dropping them into the form
Enhance the functionality of form fields by calling a service. For example, if the form field is "Select a Country," call a service to provide a list of country names.
If you have a deployed process that contains an operation you want to use, you must import the WSDL service definition into your workspace.
To add a WSDL to the Workspace:
In the Process Console, display the Catalog Service Definitions page.
Select the Service Definition of a deployed process to display the WSDL for the service.
In your project, right-mouse click on Service References.
Select
Import
.
Paste the URL into the field for Enter the URL to import from, and select Finish.
To add a new service operation:
Open a task or form in the Web Page editor.
In the Participants view, right-mouse click on Service Operations, and select
Add Service Operation
.
In the Select Service Operation dialog, select a Port Type and Operation.
Notice that the service name may be unknown, if it does not exist in the process PDD file. Ensure that you add the service name, as described in
Understanding the Process Request Form Template. If the name is unknown, the dialog lets you know, as shown:
Events that happen when you add a new service operation:
A
Send Request
button is added to the bottom of the HTML form for the new operation
A new JavaScript section is appended to the source file. This is the section where you must specify the service name.
The operation and input/output messages are added to the Participants view
To use the new service operation in your form:
Ensure that your form is in focus in the Web Page editor.
In the Participants view, expand an operation to display the input and/or output message.
Drag the operation's input/output message, or a message's part, or a part's element to a location in the Design view.
If you are adding multilingual support for forms, you must manually add multilingual support to the new fields and add the language values to properties files. For details on how to manually update the form, review
Adding MultiLingual Support to Process Central.