How to be dangerous with PO/PI/XI 7.31 – Or Intro to PI 7.31 using an Enterprise Design Approach – Part 2
This is part 2 of my 2 part blog (part 1 can be found here) with this part focussing on showing you how to very dodgily build the design from scratch in the trial PO Cloud system. It’s mostly just my workings, but hopefully you can follow it too if you’d like to give it a shot. It will probably take a newbie about 4 hours to get through this including creating your PO system in the Cloud.
Setting-up a PO system in the Cloud
To do this simple example, it was far easier for me to delete my previous PO system and create a new one than attempt to delete all the objects I’d created in my previous PO system. So I though I might as well show you the steps required to do this.
We go to developer.sap.com and open up the link to PO within the APPLICATION PLATFORM box.
From there, we sign-up for the the 90-day trial on AWS.
Follow the bouncy ball, making sure you have your Amazon Web Services account number ready…
Wish there was an option to use Australian AWS (Hint Hint)!
After finishing that, you get redirected to Amazon to create your instance. Again, just click next through to the end.
Wait just a few minutes, and refresh and we’ve got ourselves a PO system in the cloud!
End to end this takes under 10 minutes!
When complete, navigate to EC2 from the Services menu:
From the Instances area, you’ll see your system booting up. (note – Green plus Initialising means it’s starting up and ignore my old deleted PO instance)
When ready, you can right click on your systeand select Connect:
FYI – I’ll be deleting this instance hence any URL’s you see won’t actually work…
Login with Lokalfor Adminstrator password (ignore any certificate errors).
Time to start SAP
Lokal again for your password.
Wait about 15 minutes – That’s under 30 minutes from nothing to a running PO system with development tools installed!
Time to build our Scenario
The scenario will be a crazy integration scenario where a Person (Sending Business System 1) wants to change the channel on his TV (Receiving Business System) via a centralised message model (not really a canonical in this example but same concept).
First, we need Software Components so we go to the SLD in IE:
We log in as Administrator – password abcd1234 (It’s a J2EE username not the Windows username)
Select Products from the main menu.
Use New Product and Version
We’ll make Person the Product and their remote control a SWCV of that Person
We’ll keep the technical name the same as the Product name in this case:
Now let’s go to Home and create the Technical and Business systems:
First, select Technical Systems. Create New Third-Party Technical System (again, I warn you again that this is overly simplified, especially when it comes to creating SLD content)
Install the Remote on the RemoteOnCouch Technical System (Turn the Filter On when doing this and search):
Do the same for the Television:
Create the 2 associated Business Systems (try figure this one out yourself – it’s easy).
For reference, I called the Business Systems – MattsRemoteControl and MattsTelevision.
Make sure you associate it with your PO system for the Integration Server step (this is how the landscape transports work for reference but I won’t explain that here).
Okay – We’re done with SLD now – Close the Browser.
Time to start NetWeaver Developer Studio:
Start – accept defaults and close the welcome page. From the menu, choose Window->Open Perspective->Other and select Enterprise Services Registry
Select Connect to ESR:
Using abcd1234 as password.
First steps – Install our SWCV’s within PO.
Import from SLD and bring in all the ones you created in the SLD.
Note – You need to select language (dodgy readonly field that can be changed)
Should look like this when you’re done:
Now let’s create our Global Definition for a Channel.
Double click on MYCOMPANY_GLOBAL and add a namespace for our development:
Now Save and note you have a namespace where you can create objects.
Expand, and right click on Data Types to create our Global Definition:
You’ll be prompted for a change list – this is like a transport in ABAP terms. Create one, or reuse one but be careful not to get dependencies confused.
For this example, I’m just going to add a single attribute of channel of type integer. (definitelynot teaching you best practice right now)
Save and now create the Message Type (call it the same)…
Should now look like this:
Now let’s make our Remote be able to talk Global…
Within REMOTECONTROL – repeat the steps from above using an appropriate namespace for this SWCV. One difference though, within the SWCV – add a dependency to the Global SWCV.
I called this Message Type ChangeChannel since it’s the message type my remote control provides (stick with me here – I know it’s a stupid example).
Now let’s do the mapping. Create a Message Mapping that goes from ChangeChannel to Channel. Trick is to make sure you change the SWCV when selecting the target message type. Note – For some reason – no dependency is required here to select from Global…
Next trick is to do the mapping, found by selecting the lower tab that says Definition.
I’ve just joined the two, but double click on the Fx to do more funky stuff if you like.
Save – Message mapping to Canonical done!
Now let’s activate these changes. Go to the Changelists and try activate. Note – This is where dependencies can be fun! I’ll activate Global first because I know I use it within REMOTECONTROL. I’ll let you figure out how to right-click and activate these J
Okay – Do the same for Canonical to Television within the Television Software Component. (time to see if you can do this on your own).
Time to make the Service Interfaces (must stress how dodgy this will be)…
Within REMOTEControlcreate a new Service Interface
Click on Advanced and make sure the interface is Outbound (from the perspective of the Business System) – e.g. I’m sending the change channel message.
Now set the input message of the Operation ChangeChannel to our Message Type:
Save and We’re done…Do the same for the Inbound Television Service Interface now…
Note – I could add multiple operations here based on the Television design shown here…
Time to define the connection between the two Service Interfaces in our Integration SWCV (the Operation Mapping).
Create a new namespace in the Integration SWCV and add dependencies to RemoteControl and Television.
Create the New Operation Mapping in this newly defined namespace. Add the 2 Service Interfaces appropriately.
Now press the bottom tab called definition (yes it’s hard to remember to find when new to it).
Double click the Fx to add the 2 mappings…
The trick is within the selection of message mappings, to check the include underlying SWCV, then change the filter since source and target message types are different than the operation mappings due to global message type usage.
Save, activate and we’re done in the ESR.
Now for the cool new Integration Flow Modelling
Now change the perspective (window->Open Perspective->Other) to the SAP PI Designer perspective. This bit is really quite cool as it makes life lots easier for newbies though will annoy long time PI developers till it gets more feature rich.
First up – Connect up (again unfortunately) to the PO System by pressing the Connect button in a different position than last time:
Time to import those business systems we created:
Time to create an Integration Flow!
Just press Finish – and we’ll fill the details in on the model directly:
Just select your Sender/Receiver, and their associated Service Interface
Now with precision, right click on the line between the 2 BPMN style message icons and select add mapping:
Select the Mapping and assign your operation mapping.
Last steps are to assign and configure your adapters. This is changing a bit in SPS6 it appears, but in SPS5, you need to create comm channels every time for every integration flow (slightly annoying but SPS6 may address this).
Select the Channel Adapter line then select the lower tab “Channel” (not great usability here buy hey):
Give the Channel a name then browse for your Adapter and select File (not that we’re actually going to test this scenario) then switch to the Adapter-Specific tab to enter the associated details:
Go through each sub-tab to make sure it’s set-up appropriately for you (e.g. poll time is defaulted to 60 seconds). Check out the archive/delete options too.
Do the same for the outbound comm channel, noting it’s outbound so it’s not polling but dropping files into a directory as required.
Once complete, you should see no more warnings, and we’re good to deploy and get it running but for me – that’s where I stop and say – time for you to start playing further.
Anyway, as I said in Part 1 – There’s lots of concepts and other techniques to learn, but really, the easy stuff is….kind of easy. So if you have a spare half a day – and you want to know PI part of PO better – Just go for it. In terms of BPM, it is easy to integrate to/from, but probably up’s the anti in terms of complexity so that will have to wait for another day.