• Register Now
  • Forgot Password?
Intalio
  • Product
  • Services
  • Partners
  • Customers
  • Community
  • Company
Print E-mail
Contributed by KJCh Shivanand on Jan 02 2009

zip restconnector 07/01/2009,23:00 22.37 Kb

 

Summary:

This process illustrates how to create Rest Connector in Intalio process.
The REST Connector allows business process designers to easily create a WSDL description and invoke Restful services from business processes.
Before creating rest connector you must have free Blinksale account and  encoded credentials.
The process invokes Rest Connector from ui-fw. The user enters the name and ID in the respective text boxes. After process execution user verify whether rest connector is working fine or not by logging his already created Blinksale account and see that name which you entered in the “Name” text box in ui-fw url is visible in this page . This will verify that your rest connector is working fine.

 

Use Case Dependencies:

1.client.xform.
2.client.xform.xsd
3.client-id.rest.
4.clients.rest.
5.blinksale.xsd

 

Requirements:

1.Intalio BPMS Designer 5.2
2.Intalio BPMS Server 5.2
3.endpoint-configuration.properties.
4.Blinksale account.
5.Encoded credentials.

 

Preconditions:

1.Make sure Intalio|BPMS Server is up and running fine.
2.Make sure the Process Explorer pane does not contain any Intalio|BPMS Business Process Project with same name.

 

Process Download & Import:

1.Download “RestConnector.zip”.
2.Go to File > Import...
3.In Import wizard, select 'Existing Projects into Workspace', click on Next >
4.Select the "Select archive file" radio button.
5.Browse to select the downloaded archive file.
6.Click on Finish.
7.Update project builders by right click on project; go to BPMS Designer Tools > Update BPMS Builders.

 

Steps for remake workflow form:

1.Go to "File” > New > select "Intalio|BPMS Business Process Project”.
2.Provide project name as “RestConnector”, click to finish.
3.Right click on the project select New  > "WorkFlow Form”.
1.Provide File name as  “client” and click on Finish.
2.Click on “Open Perspective” window. Select “Intalio|Designer Form Editor” perspective. It will change your designer perspective to form editor perspective. In this perspective you can create workflow forms.
3.A Intalio| Designer Form Editor is visible on screen. Drag and drop Text Input control from Workflow Palette on form editor
4.Go to Properties window, type “ID:” under “Label Control” > Basic.
5.Again drag and drop Text Input control on the form editor.
6.Go to Properties window, type “Name:” under “Label Control” > Basic.
7.Save the form.

 

Steps for creating Rest Connector:

1.Create your free Blinksale account such as http://myaccount.blinksale.com
2.Provide any credentials for this account. Encode this  credentials by using any online encoders.
Note: The credentials string should be the Base64 - encoded version of the string userid:password. This credentials use with Authorization header with a value like Basic credentials, in every request For example:

Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
3.Right click on project, go to New > New Rest Service Descriptor.
4.Provide file name as “client-id.rest”, click on “Next” button.
5.Provide url  of the resource in the text box “URL”. The URL must in the form of your already created Blinksale account such as http://myaccount.blinksale.com/clients/{client_id}.
Note: If your resource is a set of resources, the variable parts could be specify between curly braces. Each parameter between curly braces will become a part of the message.
6.Select options: “GET”, “PUT” and “DELETE” from the list of  HTTP verbs for accessing the resource.
7.Click on “Finish” button.
8.Now you are viewing “Rest Connector” screen. You also view the message “3 errors detected”.
9.Go to the block “Operation GET”. Under it go to “Response” subblock > “Element” subblock.
10.Click on button next to within “Element” subblock. A new “Schema a XSD element or type” window opens. Expand “RestConnector” > “blinksale.xsd”. Select element “api:client” and click on “OK” button. Now it is showing element “api:client” inside the 'Element” subblock.
11.Now set the content type to “application/vnd.blinksale+xml” within the “Content type” textbox
Note: Default value of text box “Content type” is “text/xml”.
12. Go to the block “Operation POST”. Under it go to first “Response” subblock > “Element” subblock.
13.Click on button next to within “Element” subblock. A new “Schema a XSD element or type” window opens. Expand “RestConnector” > “blinksale.xsd”. Select element “api:client” and click on “OK” button. Now it is showing element “api:client” inside the 'Element” subblock.
14.Now set the content type to “application/vnd.blinksale+xml” within the “Content type” textbox.
15.Now go to second “Response” subblock > “Element” subblock.
16.Click on button next to within “Element” subblock. A new “Schema a XSD element or type” window opens. Expand “RestConnector” > “blinksale.xsd”. Select element “api:client” and click on “OK” button. Now it is showing element “api:client” inside the 'Element” subblock
17.Now set the content type to “application/vnd.blinksale+xml” within the “Content type” textbox..
18.Click on the button “Show advanced properties” right corner of the screen. It is showing “Advanced” block.
19.Click on button “New header” right side of “Advanced” block.
20.Provide “Authorization” as a header within the “Name” text box.
21.Select option “request:” from “Usage” combo box.
22.Provide encoded credentials in the “Default Values” text box.
23.Add another rest service descriptor.
24.Provide another name as “clients.rest”.
25.Provide url  of the resource in the text box “URL”. The URL must in the form of your already created Blinksale account such as http://myaccount.blinksale.com/clients.
26.Select options: “GET” and “POST” from the list of  HTTP verbs for accessing the resource.
27.Click on “Finish” button.
28.Now you are viewing “Rest Connector” screen. You are also view the message “3 errors detected.
29.Repeat steps 9 to 17 only for two operations: “GET” and “POST”.
30.Create a new file called “endpoint-configuration.properties”. This file is used to store the credentials. Add the following properties:
alias.clients_ns=http://example.com/clients.rest
clients_ns.restService.ode.http.default-headers.Authorization=Basic {your encoded credentials}
31.Save the rest connector settings.

 

Steps for remake process:

1.Right click on project, go to New > Business Process Diagram.
2.Provide File name as “RestConnector”, click on Finish button
3.A pool with a task is available in BPMN Editor Pane, name default pool as “Client”.
4.Right click on start pool and select "Set pool non executable".
5.Go to Project, select workflow form “client.xform”, drag and drop this form on the client pool and click on the first option “Use client for People Initiating Process Activity (initProcess)”. It is showing  new task name as “client-init” on Client pool.
6.Again go to Project, select workflow form “client.xform”, drag and drop this form on the client pool and click on the second option “Use client for People Activity (create and complete)”. It is showing  new task name as “client-create” linked with “client-complete” on Client pool.
7.Add new pool by click on BPMN Editor (select "Add Pool" option from pop up menu) and name it as “RestConnector”.
8.Add new pool by click on BPMN Editor (select "Add Pool" option from pop up menu) and name it as “Web Service” and set pool as “non-executable” pool.
9.Focus on “client-init” task; drag outgoing message flow icon to "RestConnector" pool and “Connect to the new Task”, name this new task as “init”..
10.Focus on the “init” task and drag the outgoing message flow icon to “Client” pool and connect to the  ”client-init” task.
11.Focus on the “init” task and drag the outgoing sequence flow icon to "Connect to a new Task", name this new task as "invoke".
12.Go to project and expand “clients.rest” > “httpPort”. Drag and drop “POST” on the “Web Service” pool and select the first option “Provide operation Post bound to port httpPort inside service restService. (single task)”. It is showing new task “POST” on “Web Service” pool.
13.Focus on the “invoke” task and drag the outgoing message flow icon to “Web Service” pool and connect to the  ”POST” task.
14.Focus on the “POST' task drag outgoing message flow icon to "RestConnector" pool and connect to task “invoke”.
15.Focus on the “invoke” task and drag the outgoing sequence flow icon to "Connect to a new Task", name this new task as "Newly Created Client".
16.Focus on the “Newly Created Client” task and drag the outgoing message flow icon to “Client” pool and connect to the  ”client-create” task.
17.Focus on the “client -create” task and drag the outgoing message flow icon to “RestConnector” pool and connect to the  ”Newly Created Client” task.
18.Focus on the “Newly Created Client” task and drag the outgoing sequence flow icon to "Connect to a new Task", name this new task as "Newly Completed Client".
19.Focus on the “client -complete” task and drag the outgoing message flow icon to “RestConnector” pool and connect to the  ”Newly Completed Client” task.
20.Focus on the “Newly Completed Client” task and drag the outgoing message flow icon to “Client” pool and connect to the  ”create-complete” task.
21.Focus on the “Newly Completed Client” task and drag the outgoing sequence flow icon to "Connect to a new Task", name this new task as "Update Client".
22.Go to project and expand “client-id.rest” > “httpPort”. Drag and drop “PUT” on the “Web Service” pool and select the first option “Provide operation PUT bound to port httpPort inside service restService. (single task)”. It is showing new task “PUT” on “Web Service” pool.
23.Focus on the “Update Client” task and drag the outgoing message flow icon to “Web Service” pool and connect to the  ”PUT” task.
24.Focus on the “PUT” task and drag the outgoing message flow icon to “Rest Connector” pool and connect to the  ”Update Client” task.
25.Focus on “Client” pool.
26.Go to Properties window > click on “Workflow” section.
27.Assign role to “examples\manager” within the “Role(s)” text box .
28.Focus on “client-init” task.
29.Go to Properties window > click on “Workflow” section.
30.Provide name “Rest Connector” within the “Description” text box.
31.Focus on “client-create” task.
32.Go to Properties window > click on “Workflow” section.
33.Provide name “Rest Connector” within the “Description” text box.
34.Focus on “Web Service” pool.
35.Go to Properties window > click on “Workflow” section.
36.Assign user to “intalio/admin” within the “User(s)” text box .
37.Similarly assign role to “examples\manager” within the “Role(s)” text box .
38.Save the process.

 

Define Outgoing Mappings:

1.Select “invoke” task.
2.Connect “$client1InitProcessRequestMsg.root” > “taskOutput” > “output”  > “Name” on the left side of the mapper area  “clientsPOSTRequestMsg.body$” > “name” on the right side of the mapper area.
3.Select “ Newly Created Client” task.
4.Go to Window > Show View > select Mapper Palette.
5.Drag Mapper Palette to location from where you can easily dnd any operator onto Mapper Area.
6.Go to Mapper Palette, expand “Functions Based on Substring Matching” and  Dnd "fn:substring-after” into Mapper Area .
7.Go to mapper tool bar, click on "creates a new operator" button available.
Note: The red button is used to create operators and constants.
8.Drag the mouse pointer from the tool bar to work area of mapper and click on it.
9.A textbox will appear in editing mode.
10.Provide “/clients/” in the text box with double quotes.
11.Click on the right edge of the textbox displaying "/clients/” and then click on left edge of textbox displaying "fn:substring-after" function.
12.Connect “$clientsPOSTResponseMsg.response” > “@uri” on the left side of the mapper area with left edge of textbox displaying "fn:substring-after" function.
13.Connect right edge of the textbox  displaying "fn:substring-after" function with “client1CreateTaskRequestMsg.root$” > “taskInput' > “input” > “ID” on the right side of the mapper area.
14.Connect “$clientsPOSTResponseMsg.response” > “name[?]” on the left side of the mapper area with “client1CreateTaskRequestMsg.root$” > “taskInput' > “input” > “Name” on the right side of the mapper area.
15.Select “ Update Client” task.
16.Connect “$client1NotifyTaskCompletionRequestMsg.root” > “taskOutput” > “output” > “Name” on the left side of the mapper area with “client_idPUTRequestMsg.body$” > “[?]name” on the right side of the mapper area.
17.Connect “$client1NotifyTaskCompletionRequestMsg.root” > “taskOutput” > “output” > “ID” on the left side of the mapper area with “client_idPUTRequestMsg.body$” > “client_idPUTRequestMsg.client_id$”on the right side of the mapper area.
18.Save the process.

 

Process Deployment & Execution:

1.Click on Deploy Project to Intalio|BPMS Server button in tool bar.
2.Make sure you select all runtime files while exporting to Intalio|BPMS Server.
3.Click on Finish button.
4.Open a web browser, provide url as: http://localhost:8080/ui-fw which takes to login screen for workflow UI.
5.Login with the following credentials:
username: 'admin' (without quotes).
password: 'changeit' (without quotes).
6.Under Processes tab you should see “Rest Connector” link, click it to view form.
7.The form genetrated displays the two textboxes: “ID” and “Name” .
8.Provide any ID in the “ID” text box say 123.
9.Provide any name in the “Name” text box say John.
10.Click on “Start” button to start the process.
11.Click on “Refresh” and click on “Rest Connector” link available under Tasks Tab.
12.The form displays ID and name.
13.Click on 'Complete' button to complete the process.
14.Login to Blinksale account created previously such as http://myaccount.blinksale.com.
15.Provide username and password to this account.
16.Now you will see that name which you entered in the “Name” text box in ui-fw url is visible in this page . This will verify that your rest connector is working fine.

 

Note:
This sample is an example to educate user on:
1.How to create rest connector in Intalio process.
2.How to invoke created rest connector.









 

Last Updated ( Feb 05 2009 )
 
[ Back ]

Copyright © Intalio, 1999-2012.

  • Copyright Notice |
  • Privacy Policy |
  • User Agreement