Directory APIs provides many options to access, modify Directory objects. One can find many real-life use cases where manual efforts can be reduced with their use. It can be used for reporting purpose or to automate Mass Configuration Changes.
In this blog I am taking a case and its walkthrough. These 2 blogs will cover logic building and data parsing technique(JAXB) to create such a project.
In this part 1 have discussed, basic understanding of the operations used and the logic construction.
Coding part for the NWDS standalone application please refer Part 2.
To check available list of api’s goto <PI host:port>/wsnavigator . This is a snapshot of some available api for PI 7.31.
Available operations can be checked and tested here.For e.g. below are IntegratedConfiguration & ChangeList API operations. I will be using these 2 API’s in walkthrough to create directory objects through NWDS.
Use Case: Swtich Business System for ICO
There could be real life scenarios to switch particular Business System wherever its used in a PI box. It could be used in n number of ICO’s either as Sender or as Receiver component. While switching Business Component mostly other parameters like Channel names etc remain same(we will be assuming same for this example)
To carry out such changes one only need component name. Using directory api we can automate all such object(ICO) changes.
|List of Existing Business System/Service||List of To Business System/Service|
Based on whether component is Receiver or Sender the operations will be different.
- Business Component is Receiver : change() operation can be used to change Receiver Component(s) in existing ICO
- Business Component is Sender : Sender information of ICO cannot be changed ICO. In this case new ICO has to be created using create() operation.
In both the cases required list of ICO’s can be read, parsed and Component can be modified using directory api.
Informal description of Steps:
Manually create new Business System and Channels
For new Business System objects like Sender interface, Sender/Receiver Channel, Receiver Interface etc all names remains same
Case1: Business Component is Sender
- Use ICO-Query operation to check available ICO objects for a particular Business System
Input: List of From/To Business SystemsOutput: List<MessageHeaderID>.MessageHeaderID comprises of Sender, Interface and Namespace
- Use ICO-ReadOperation to read Configuration data of above ICO query output list
Input: List<MessageHeaderID>Output: IntegratedConfiguration information in JAX-WS tree.List<RestrictedIntegratedConfiguration>Parse through the Change Business System name in Inbound Processing and MessageHeader section. Create ICO objects using parsed data.
- Changelist-Create option to provide a Logical desription to Changelist ID (Optional)
- ICO-Create operation to create all ICO’s for new Sender Component.
Input: List<RestrictedIntegratedConfiguration>Output: Objects created in Integration Directory.
Case 2: Business Component is Receiver
- Use ICO-query operation to find all available ICO’s.
- ICO-read to fetch all information and find where Component is Receiver.
- Use ICO-change operation to change appropriate Receiver information.
Output – Created ICO for new Business System
At last Manually Review and Activate objects in Changelist. This can also be automated using Changelist-Activate operation.
Coding part(standalone NWDS project) of Case1 is explained in Part 2