on 10-30-2013 1:39 PM
All,
I have completed my program in NWDS to read all the channels in an excel...Now I want to take it a step further....how to update the channels...ie read from the excel and update the channels. More so...how to identify the mandatory fields that needs to be provided during the update process for each channel as their is a common method change() for all of them.
Thanks
Hi Vicky,
There are no delta updates with the API, so you need to submit a complete object. I handled this by reading the object first and then only changed the fields I wanted to change. This way you don't have to worry about which fields are required. Everything stays the same except for what you explicitly change. You will need to convert the object to a RestrictedCommunicationChannel object since that's what CommunicationChannelCreateChangeIn expects. I included a method below to help with this part. There is, of course, more to it, but here are the basic steps:
CommunicationChannel cc = << object you read using the API >>
RestrictedCommunicationChannel rcc = createRestricted(cc);
CommunicationChannelCreateChangeIn createIn = new CommunicationChannelCreateChangeIn();
createIn.setChangeListID(changeList.getChangeListID().getChangeListID());
createIn.getCommunicationChannel().add(rcc);
ConfigurationObjectModifyOut out = port.change(createIn);
public static RestrictedCommunicationChannel createRestricted(CommunicationChannel ch) {
RestrictedCommunicationChannel rch = new RestrictedCommunicationChannel();
rch.setAdapterEngineName(ch.getAdapterEngineName());
rch.setAdapterMetadata(ch.getAdapterMetadata());
RestrictedObjectAdministrativeData radmin = new RestrictedObjectAdministrativeData();
//radmin.setFolderPathID(ch.getAdministrativeData().getFolderPathID());
radmin.setResponsibleUserAccountID(ch.getAdministrativeData().getResponsibleUserAccountID());
rch.setAdministrativeData(radmin);
rch.setCommunicationChannelID(ch.getCommunicationChannelID());
rch.setDirection(ch.getDirection());
rch.setMasterLanguage(ch.getMasterLanguage());
rch.setMessageProtocol(ch.getMessageProtocol());
rch.setMessageProtocolVersion(ch.getMessageProtocolVersion());
rch.setModuleProcess(ch.getModuleProcess());
rch.setReceiverIdentifier(ch.getReceiverIdentifier());
rch.setSenderIdentifier(ch.getSenderIdentifier());
rch.setTransportProtocol(ch.getTransportProtocol());
rch.setTransportProtocolVersion(ch.getTransportProtocolVersion());
rch.getAdapterSpecificAttribute().addAll(ch.getAdapterSpecificAttribute());
rch.getAdapterSpecificTableAttribute().addAll(ch.getAdapterSpecificTableAttribute());
rch.getDescription().addAll(ch.getDescription());
return rch;
}
Thanks,
-Russ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
may be you can close this..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.