In this blog I will describe how to set the composite title with a BPM component. I will also describe where this approach matches and where it differs from setting the title with a BPEL or Mediator component.
Lets first start with an overall important match: you need the setCompositeInstanceTitle function. This function sets the composite instance title and returns it. The return value brings us to the biggest difference: the assignment of the return value. In BPMN and BPEL you must assign the return value to a variable. In Mediator you must assign it to a property.
This post shows the BPM approach. In parallel posts I show the BPEL and Mediator approach.
1) Start by creating a new BPM Project.
2) This will start the ‘Create BPM Project’ wizard. Specify a name for the project. I used ‘scaBPM_setCompositeInstanceTitle’ for the name. Make sure that the BPM and SOA technology is selected.
3) In the next step, select the ‘Composite with BPMN Process’ template.
4) After that, the ’Create BPMN Process’ wizard is started. Specify a name for the process. I used ‘setTitle’ for the name.
5) In this step, the process input and output arguments can be specified. As mentioned earlier, in BPM the return value of the ‘setCompositeInstanceTitle’ function must be assigned to a variable. For this reason I specified a ‘String’ output variable with an arbitrary name ‘title’. Normally you would set the title immediately after the creation of the instance and not just before the instance stop running. But in this example there is hardly any difference.
6) At this moment the created composite and process looks like the images below. Nothing special happened yet.
7) Now it is time to set the title. Open the end point of the process by double clicking on it. The Endpoint Properties appear. On the Implementation tab check ‘Use Associations’.
8 ) Open the ‘Data Associations’ editor by clicking the pencil behind the checkbox.
9) Start the expression builder and specify the title expression as shown in the following image.
10) Now the composite title is set and also assigned to the title variable.
11) Deploy the application and test if from the Enterprise Manager Console. The created instance contains the specified title/name.