Wednesday, April 23, 2014

Building your First Sample in BPMN

In this exercise we will try to create a simple BPMN process and see how exactly the BPMN works.

It will be a simple scenario where in we will accept the input from user and write the data in to file location.

Create a new application



Give it some name



Name your project



Select composite with BPMN process and finish the wizard



Once process is complete it will come up with following page where select Manual process



Say next and Finish.

Now in the left panel Right click on Business Catalogue and create a new module.



give it a name



Now right click on the new module that you have create and create a new business object



Create a business object based on a schema



I am using following schema in my case

<?xml version= '1.0' encoding= 'UTF-8' ?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xmlns.oracle.com/purchase/order"
xmlns:xsd="http://xmlns.oracle.com/purchase/order"
elementFormDefault="qualified">
<element name="PORequest" type="xsd:PORequestType"/>
<complexType name="PORequestType">
<sequence>
<element name="OrderNumber" type="string" minOccurs="1"/>
<element name="ProductName" type="string" minOccurs="0"/>
<element name="ProductDescription" type="string" minOccurs="0"/>
</sequence>
</complexType>
</schema>

Once the data object is created

create a process data object



Give it a name and select type as component and select the business object you have created just now.



Now double click on the user task or right click and say properties and you will get a new ui .

There add a new human task by pressing + button as shown



On the new page give it some name , title and press the + icon in parameter section and drag and drop the data object that you have created

Once it is completed say ok and complete the wizard.



Drag and drop a service activity between the user task and end activity and give it some name



It will have a warning as shown as it is not yet implemented.On the top right side click composite editor and create your file adapter service in composite service swimlane



Drag and drop a file adapter in external reference swinlane and configure it to write to your local directory



Point it to the same schema that we have used earlier



After completion your process should look like this



Go back to your bpmn process and you should be able to see the new adapter that you have created in the services section.

If you can not then just delete the adapter that you have create in the composite and create it from BPMN page.

Right click on services and create a file adapter



Even if it doesn't work just restart your jdeveloper and you should be able to see the service.Now once you can see the service .

Right click on the Services activity and go to implementation tab.

there search of the file adapter service and attach it to the Service activity as shown



Now Click on data association and map the input parameter of Human task to the input of file service.



Now go to your human task created and create auto-generated task form



Validate the page is created for you.



Now we have our process developer the only requirement is to assign user to the process so that it can be processed.

go to organization and open the page.

There click on role and add a member to it



Add a user from the realm



save the project and deploy it to the server.

Now once the process is deployed go to bpm workspace

http://host:/bpm/workspace.

Login with the same user which you have added in the Role.

Go to Applications-->Process tracking

And to your surprise you can not find the process in there.



You log in to em console to validate if the process is deployed



Now click on the human task in the component metrics to validate if the task flow is attached to it.

go to administration tab to validate the same



So you have the end point url too so everything is working fine but still you are not able to see the process in bpmn workspace.

The reason is that the user doesn't have the bpm process role.

Now in order to assign the user proper role go to your em console.

Expand Farm_bpmn_domain -> Application Deployments

right click on your Application and choose

Security -> Application Roles



Choose OracleBPMProcessRolesApp and search



Select your process edit it and add the user to it



Now save the changes and refresh your page for bpm workspace and now you can see the process over there



Pass some dummy input and submit the button

YOu can also click on the HelloWorldProcess in the application box and a new pop up page will come from where you can submit the request



Now you can validate the process completion by logging to em and validation if the process has completed successfully



Validate in your file location if a file is created with the required values.




No comments: