Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
fibretrooper Absent Member.
Absent Member.
344 views

Connect-IT / CIT choose between different webservice based on condition

Jump to solution
Hello,

I created a scenario to create and update records in SM7.10 via webservice.
I need to use different webservices for create and update these records. That is probably simple...?

At the moment I defined two mappings in the mapping box of my scenario. So for each produced document (each record) both mappings are executed one after the other.

Is there a possibility to choose which mapping to use, based on a condition? I would like to check first if the key for the current record already exits in SM7 and only use the update mapping/webservice in that case or use the create mapping/webservice if it doesn't exist.

Any ideas?

best regards
fibretrooper
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.. MTWalsh Absent Member..
Absent Member..

Re: Connect-IT / CIT choose between different webservice based on condition

Jump to solution
You could use that same model, two mappings, and define a pifCreateDynaMapTableFromFmtName() function to define a dynamic maptable in the session start event. You have to define a produced document type on your destination connector with the lookup field (key) and the lookup value you would like to use for your lookup, preferably filtered to reduce the size of the dynamic maptable. You could then do a pifMapValueEx() to do your lookups in memory (probably faster than a pre-query) and either allow the mapped document through or pifIgnoreDocumentMapping() based on the results of your lookup.

View solution in original post

4 Replies
Highlighted
Absent Member.. MTWalsh Absent Member..
Absent Member..

Re: Connect-IT / CIT choose between different webservice based on condition

Jump to solution
You could use that same model, two mappings, and define a pifCreateDynaMapTableFromFmtName() function to define a dynamic maptable in the session start event. You have to define a produced document type on your destination connector with the lookup field (key) and the lookup value you would like to use for your lookup, preferably filtered to reduce the size of the dynamic maptable. You could then do a pifMapValueEx() to do your lookups in memory (probably faster than a pre-query) and either allow the mapped document through or pifIgnoreDocumentMapping() based on the results of your lookup.

View solution in original post

fibretrooper Absent Member.
Absent Member.

Re: Connect-IT / CIT choose between different webservice based on condition

Jump to solution


Hi,
thanks!
As I understand your answer I can create a kind of dynamic collection of all key values in the AdditionalScripts->Sub OpenSession(). The current key value can be compared with contents of this collection. Is that suitable for ~100K keys?
And after the comparison the document can be either processed or rejected.
Then the process would be:
1) compare prior to create mapping
2) process or reject current record
3) compare prior to update mapping
4) process or reject current record
(two runs?)

regards
fibretrooper
0 Likes
Absent Member.. MTWalsh Absent Member..
Absent Member..

Re: Connect-IT / CIT choose between different webservice based on condition

Jump to solution
On whether it is suitable for 100k+ records, are we talking about 100k records in the dynamic maptable or 100k records being processed from your source? Either way, performance might not be spectacular.

I'm curious though why you chose to do this through the webservices interface. I'm not an SM7 expert, but when mapping to previous versions of ServiceCenter, the proceedure was usually to just dump the data in there to SC via their event maps and let the SC folks sort it out (i.e. process each input event and try to reconcile it to an existing CI) from within ServiceCenter.

Don't get me wrong, that approach always drove me nuts, because there really wasn't anything I could do with the data in CIT, and I don't code in SC/SM, so my part of the job was always pretty short...but that was the accepted way of doing it. You needed an SC expert to handle the events...though mostly the work was done for them OOB I think (not that I ever really trusted that the reconciliation was reliable).

That method was fast though, since you weren't really doing any processing with CIT...just pump & dump.

Anyway, not knocking what you are trying to do, like I said, I like the idea of being able to control reconciliation from CIT, but I just wondered if you had considered the other alternative (and if the other alternative is even still available in SM 7.10).

0 Likes
fibretrooper Absent Member.
Absent Member.

Re: Connect-IT / CIT choose between different webservice based on condition

Jump to solution
Unfortunately I have no other option than doing it by webservice. I know it is possible to write the data into SC/SM event.in table and process it from there. Which would probably be the preferred method. But I have no choice.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.