Produced by Araxis Merge on 5/23/2019 1:21:36 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | PATS_R_SourceCode.zip\PATSRIntegrationsCRMOL\VEISStub | Program.cs | Thu Apr 25 16:21:02 2019 UTC |
2 | PATS_R_SourceCode.zip\PATSRIntegrationsCRMOL\VEISStub | Program.cs | Thu May 23 01:30:09 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 740 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | using Iris .VEFT.Mess ages; | |
2 | using Meda llia.VEFT. Messages; | |
3 | using Micr osoft.Xrm. Sdk; | |
4 | using Syst em; | |
5 | using Syst em.Collect ions.Gener ic; | |
6 | using VEIS .Utilities ; | |
7 | using VEIS .Utilities .Models; | |
8 | using VRM. Integratio n.Serviceb us.Extensi ons; | |
9 | using VRMR est.WebApi ; | |
10 | using WHH. VEFT.Messa ges; | |
11 | ||
12 | namespace VEFTStub.D AC | |
13 | { | |
14 | intern al class P rogram | |
15 | { | |
16 | pr ivate stat ic int rec ordCount; | |
17 | ||
18 | pr ivate stat ic string _orgName; | |
19 | ||
20 | pr ivate stat ic Guid _c rmeUserId = Guid.Par se("6FF0CA 08-2FD2-E4 11-B6F7-00 155D5575E0 "); | |
21 | ||
22 | private st atic strin g veisUrl = "https:/ / DNS . URL /"; | |
23 | ||
24 | pr ivate stat ic string clientId = "58d50ca3 -b921-4d9b -ac76-8965 be2eb80b"; | |
25 | ||
26 | pr ivate stat ic string clientSecr et = "4RdV Ddhq8cv/h2 263Ojdy8fD 3JI9OwHcr5 hOkntAwTc= "; | |
27 | ||
28 | pr ivate stat ic string tenantId = "f7c49e36 -971b-42c7 -b244-a88e ed6c0bf6"; | |
29 | ||
30 | pr ivate stat ic string veisOrgNam e = "CRMED EV"; | |
31 | ||
32 | pr ivate stat ic string resourceId = "4a7747 6c-ceed-45 db-ad7e-ac 2bbbc4f72a "; | |
33 | ||
34 | pr ivate stat ic string subscripti onKey = "8 8784cf9396 e41dab087c 90a5da0c2c 1"; | |
35 | ||
36 | pr ivate stat ic string medalliaPa th = "pats r.lob.meda llia/api"; | |
37 | ||
38 | pr ivate stat ic string irisPath = "patsr.lo b.iris/api "; | |
39 | ||
40 | pr ivate stat ic string whhPath = "patsr.lob .whh/api"; | |
41 | ||
42 | pr ivate stat ic void Ma in(string[ ] args) | |
43 | { | |
44 | Console. WriteLine( "***VEFT-M edallia In tegration Stub Tool V3.0 (Iris & WHH Sim ulation)** *"); | |
45 | Console. WriteLine( "Use this tool to au to-generat e Test Dat a in the V EFT CRM re presentati ve of its various in tegration partners." ); | |
46 | Console. WriteLine( "\nThis to ol leverag es the DAC server to create re cords in C RM. It is only usabl e from wit hin the VR MCloud."); | |
47 | Console. WriteLine( "Which int egration p artner are you simul ating data for?\n1. Medallia\n 2. WHH\n3. Iris"); | |
48 | string s = Console .ReadLine( ); | |
49 | int resu lt = 0; | |
50 | bool fla g = false; | |
51 | while (! flag) | |
52 | { | |
53 | if ( int.TryPar se(s, out result)) | |
54 | { | |
55 | if (result == 1 || r esult == 2 || result == 3) | |
56 | { | |
57 | flag = true; | |
58 | } | |
59 | else | |
60 | { | |
61 | Consol e.WriteLin e("Please select 1, 2, or 3"); | |
62 | } | |
63 | } | |
64 | else | |
65 | { | |
66 | Console.Wr iteLine("P lease sele ct 1, 2 or 3"); | |
67 | } | |
68 | } | |
69 | Console. WriteLine( "\nHow man y test rec ords would you like to generat e?"); | |
70 | checkInt eger(Conso le.ReadLin e()); | |
71 | Console. WriteLine( "\nPlease enter the destinatio n CRM Orga nization N ame (organ ization na me ONLY)") ; | |
72 | _orgName = Console .ReadLine( ); | |
73 | DoAction (result); | |
74 | Console. WriteLine( "\nRecord generation complete. "); | |
75 | Console. ReadLine() ; | |
76 | } | |
77 | ||
78 | pr ivate stat ic void ch eckInteger (string in put) | |
79 | { | |
80 | if (!int .TryParse( input, out recordCou nt)) | |
81 | { | |
82 | Cons ole.WriteL ine("Entry must be a valid int eger. Plea se try aga in."); | |
83 | chec kInteger(C onsole.Rea dLine()); | |
84 | } | |
85 | } | |
86 | ||
87 | in ternal sta tic VeisCo nfig Retri eveVeisCon fig(string path) | |
88 | { | |
89 | VeisConf ig config = new Veis Config() | |
90 | { | |
91 | OrgO verride = veisOrgNam e, | |
92 | }; | |
93 | ||
94 | config.O rgName = v eisOrgName ; | |
95 | ||
96 | config.V eisConfigu ration = n ew VeisCon figuration () | |
97 | { | |
98 | CRMA uthInfo = new CRMAut hTokenConf iguration( ) | |
99 | { | |
100 | ClientAppl icationId = clientId , | |
101 | ClientSecr et = clien tSecret, | |
102 | TenantId = tenantId, | |
103 | ResourceId = resourc eId, | |
104 | ||
105 | }, | |
106 | SvcC onfigInfo = new VEIS SvcLOBConf iguration( ) | |
107 | { | |
108 | ApimSubscr iptionKey = subscrip tionKey, | |
109 | } | |
110 | }; | |
111 | ||
112 | config.V eisConfigu ration.Svc ConfigInfo .SvcLOBSer viceUrl = veisUrl + path; | |
113 | return c onfig; | |
114 | } | |
115 | pr ivate stat ic void Do Action(int system) | |
116 | { | |
117 | switch ( system) | |
118 | { | |
119 | case 1: | |
120 | { | |
121 | Random random = new Random (); | |
122 | for (i nt i = 0; i < record Count; i++ ) | |
123 | { | |
124 | st ring conta ctFirstNam e = (Math. Round(rand om.NextDou ble()) != 0.0) ? "Ja ne" : "Joh n"; | |
125 | Cr eateIntera ctionReque st createI nteraction Request = new Create Interactio nRequest | |
126 | { | |
127 | MessageL ogging = n ew Message Logging | |
128 | { | |
129 | Igno reState = false, | |
130 | MaxR etry = -1, | |
131 | Mess ageName = "MedalliaC reateInter actionRequ est", | |
132 | Mess ageType = "LOB", | |
133 | Orga nizationNa me = _orgN ame | |
134 | }, | |
135 | Callback Number = $ "({random. Next(100, 999)}){ran dom.Next(1 00, 999)}- {random.Ne xt(1000, 9 999)}", | |
136 | ContactF irstName = contactFi rstName, | |
137 | ContactL astName = "Doe" + ra ndom.Next( 1, 999).To String(), | |
138 | DateOfBi rth = "12/ 01/1970", | |
139 | DateOfCo ntact = Da teTime.Now .Date.ToSt ring(), | |
140 | Experien ceComments = "LOVE I T", | |
141 | Experien ceScore = random.Nex t(1, 5).To String(), | |
142 | LastFour = random. Next(1000, 9999).ToS tring(), | |
143 | Organiza tionName = _orgName, | |
144 | SurveyID = random. Next(10000 00, 900000 0).ToStrin g(), | |
145 | SurveyLi nk = "WWW. BING.COM", | |
146 | Feedback Type = "Co mpliment", | |
147 | AlertTyp e = "Homel essness", | |
148 | StationI D = "629", | |
149 | SurveyGr oup = "MOC Test" | |
150 | }; | |
151 | cr eateIntera ctionReque st.Contact Email = cr eateIntera ctionReque st.Contact FirstName + "." + cr eateIntera ctionReque st.Contact LastName + "@test.te st"; | |
152 | tr y | |
153 | { | |
154 | VeisConf ig config = Retrieve VeisConfig (medalliaP ath); | |
155 | CreateIn teractionR esponse cr eateIntera ctionRespo nse = WebA piUtility. SendReceiv eVeisReque st<CreateI nteraction Response>( config, "I nteraction ", createI nteraction Request); | |
156 | if (crea teInteract ionRespons e.Exceptio nOccurred) | |
157 | { | |
158 | catc hMethod(cr eateIntera ctionRespo nse.Except ionMessage ); | |
159 | } | |
160 | if (crea teInteract ionRespons e != null && createI nteraction Response.I nteraction ID != null ) | |
161 | { | |
162 | Cons ole.WriteL ine($"Crea ted Intera ction for {createInt eractionRe quest.Cont actFirstNa me} {creat eInteracti onRequest. ContactLas tName}."); | |
163 | } | |
164 | else | |
165 | { | |
166 | Cons ole.WriteL ine("recor d not crea ted. Null response r eturned.") ; | |
167 | } | |
168 | } | |
169 | ca tch (Excep tion ex) | |
170 | { | |
171 | Console. WriteLine( $"Exceptio n Occurred : {ex.Mess age}"); | |
172 | } | |
173 | } | |
174 | Consol e.WriteLin e("Complet e."); | |
175 | Consol e.ReadLine (); | |
176 | return ; | |
177 | } | |
178 | case 2: | |
179 | { | |
180 | Random random2 = new Rando m(); | |
181 | new En tity("inci dent"); | |
182 | List<W HHCreateIn teractionR equest> re quests = n ew List<WH HCreateInt eractionRe quest>(); | |
183 | for (i nt j = 0; j < record Count; j++ ) | |
184 | { | |
185 | st ring first Name = (Ma th.Round(r andom2.Nex tDouble()) != 0.0) ? "Jane" : "John"; | |
186 | Me ssageLoggi ng message Logging = new Messag eLogging | |
187 | { | |
188 | IgnoreSt ate = fals e, | |
189 | MaxRetry = -1, | |
190 | MessageN ame = "WHH CreateInte ractionReq uest", | |
191 | MessageT ype = "LOB ", | |
192 | Organiza tionName = _orgName | |
193 | }; | |
194 | WH HCreateInt eractionRe quest wHHC reateInter actionRequ est = new WHHCreateI nteraction Request | |
195 | { | |
196 | Organiza tionName = _orgName, | |
197 | CaseId = Guid.NewG uid().ToSt ring(), | |
198 | CaseNumb er = rando m2.Next(10 00000, 999 9999), | |
199 | CreatedD ate = Date Time.Now.D ate.ToStri ng(), | |
200 | VIEWS_Fa cility__c = Convert. ToString(6 29), | |
201 | SENSITIV E_WHVAHotl ine_Subjec t__c = "Th is is the subject", | |
202 | WHVAHotl ine_Commen ts__c = "T hese are t he comment s", | |
203 | OCR_Note s = "This is the OCR Notes", | |
204 | WHVAHotl ine_SLA_St art_Date_T im = DateT ime.Now.Da te.AddDays (-3.0).ToS tring(), | |
205 | WHVAHotl ine_SLA_Bu siness_Day s__c = 6, | |
206 | VIEWS_SL A_End_Date _DateTime_ _c = DateT ime.Now.Da te.AddDays (3.0).ToSt ring(), | |
207 | Days_Unt il_SLA_Ove rdue__c = 3, | |
208 | VIEWS_Ti er_1_Compl aint_Categ ory__c = " The compla int catego ry", | |
209 | VIEWS_Co mplaint_Ca tegory_Des cription__ c = "The c omplaint c ategory de scription" , | |
210 | Short_De scription_ _c = "Othe r complain t type", | |
211 | Owner = "The owner ", | |
212 | LastModi fiedBy = " Last Modif ied By", | |
213 | Status = "Status", | |
214 | WHVAHotl ine_Priori ty_One_Hig h__c = "Pr iority One String", | |
215 | Priority One_Indica tor = true , | |
216 | WH_VA_Ho tline_Reas on_Priorit y__c = "", | |
217 | Secondar y_Phone__c = "(123) 234-3456", | |
218 | WHHotlin e_Other_Lo cation__c = "Some ot her facili ty", | |
219 | Views_Ad ministrati on__c = "B oard", | |
220 | Secondar y_Email__c = "test@t est.com", | |
221 | RecordTy pe = "non- complaint" , | |
222 | VIEWS_Ot her_Relati onship_Inf ormtation_ _c = "Othe r Relation ship Infor mation", | |
223 | VIEWS_Re lationship _to_Vetera n_ = "Othe r", | |
224 | Anonymou s__c = fal se, | |
225 | FirstNam e = firstN ame, | |
226 | LastName = "Doe" + random2.N ext(100, 9 99).ToStri ng(), | |
227 | Email = "test@test .test", | |
228 | Phone = "123-123-1 234", | |
229 | Birthdat e = "01/15 /1977", | |
230 | FirstNam e_Proxy = "Another", | |
231 | LastName _Proxy = " Doe", | |
232 | Phone_Pr oxy = "321 -321-3214" , | |
233 | Email_Pr oxy = "thi ng@stuff.n et", | |
234 | Secondar yPhone_Pro xy = "345- 345-3456", | |
235 | Preferre dEmail_Pro xy = "stuf f@thing.ne t", | |
236 | Internal _OCR_DueDa te = "06/0 6/2018", | |
237 | VISN = " 629", | |
238 | Social = "123-12-1 234", | |
239 | ICN = "1 012901147V 954482" | |
240 | }; | |
241 | ||
242 | tr y | |
243 | { | |
244 | VeisConf ig config = Retrieve VeisConfig (whhPath); | |
245 | WHHCreat eInteracti onResponse wHHCreate Interactio nResponse = WebApiUt ility.Send ReceiveVei sRequest<W HHCreateIn teractionR esponse>(c onfig, "In teraction" , wHHCreat eInteracti onRequest) ; | |
246 | ||
247 | if (wHHC reateInter actionResp onse.Excep tionOccurr ed) | |
248 | { | |
249 | catc hMethod(wH HCreateInt eractionRe sponse.Exc eptionMess age); | |
250 | } | |
251 | if (wHHC reateInter actionResp onse != nu ll && wHHC reateInter actionResp onse.Inter actionID ! = null) | |
252 | { | |
253 | Cons ole.WriteL ine($"Crea ted Intera ction for {wHHCreate Interactio nRequest.F irstName} {wHHCreate Interactio nRequest.L astName}." ); | |
254 | requ ests.Add(w HHCreateIn teractionR equest); | |
255 | } | |
256 | else | |
257 | { | |
258 | Cons ole.WriteL ine("recor d not crea ted. Null response r eturned.") ; | |
259 | } | |
260 | } | |
261 | ca tch (Excep tion ex2) | |
262 | { | |
263 | Console. WriteLine( $"Exceptio n Occurred : {ex2.Mes sage}"); | |
264 | } | |
265 | } | |
266 | ||
267 | Consol e.WriteLin e("Would y ou like to resolve a nd accept or reject this case? (1 to res olve and a ccept, 2 t o resolve and reject , otherwis e do nothi ng)"); | |
268 | string resp = Co nsole.Read Line(); | |
269 | if (re sp == "1" || resp == "2") | |
270 | { | |
271 | fo reach (WHH CreateInte ractionReq uest wHHCr eateIntera ctionReque st in requ ests) | |
272 | { | |
273 | WHHResol utionReque st resReq = new WHHR esolutionR equest(); | |
274 | resReq.C aseId = wH HCreateInt eractionRe quest.Case Id; | |
275 | resReq.O rganizatio nName = _o rgName; | |
276 | resReq.A cceptanceN otes = "Th is is the resolution notes"; | |
277 | resReq.A cceptance = (resp == "1"); | |
278 | VeisConf ig config = Retrieve VeisConfig (whhPath); | |
279 | WHHResol utionRespo nse resRes ponse = We bApiUtilit y.SendRece iveVeisReq uest<WHHRe solutionRe sponse>(co nfig, "Res olution", resReq); | |
280 | if (resR esponse.Ex ceptionOcc urred) | |
281 | { | |
282 | catc hMethod(re sResponse. ExceptionM essage); | |
283 | } | |
284 | else | |
285 | { | |
286 | Cons ole.WriteL ine($"The case has b een resolv ed."); | |
287 | } | |
288 | } | |
289 | } | |
290 | ||
291 | Consol e.WriteLin e("Complet e."); | |
292 | Consol e.ReadLine (); | |
293 | return ; | |
294 | } | |
295 | } | |
296 | Random r andom3 = n ew Random( ); | |
297 | new Enti ty("incide nt"); | |
298 | for (int k = 0; k < recordCo unt; k++) | |
299 | { | |
300 | stri ng firstNa me2 = (Mat h.Round(ra ndom3.Next Double()) != 0.0) ? "Jane" : " John"; | |
301 | new MessageLog ging | |
302 | { | |
303 | IgnoreStat e = false, | |
304 | MaxRetry = -1, | |
305 | MessageNam e = "IrisC reateInter actionRequ est", | |
306 | MessageTyp e = "TestS tubMessage ", | |
307 | Organizati onName = _ orgName | |
308 | }; | |
309 | int num = rand om3.Next(1 , 4); | |
310 | stri ng text = ""; | |
311 | stri ng methodO fContactDa ta = ""; | |
312 | swit ch (num) | |
313 | { | |
314 | case 1: | |
315 | text = "Email"; | |
316 | method OfContactD ata = "tes t@test.com "; | |
317 | break; | |
318 | case 2: | |
319 | text = "Phone"; | |
320 | method OfContactD ata = "123 -123-1234" ; | |
321 | break; | |
322 | case 3: | |
323 | text = "US Mail" ; | |
324 | method OfContactD ata = "123 Main Stre et"; | |
325 | break; | |
326 | } | |
327 | Iris CreateInte ractionReq uest irisC reateInter actionRequ est = new IrisCreate Interactio nRequest | |
328 | { | |
329 | organizati onName = _ orgName, | |
330 | incidentNu mber = "12 3456-" + r andom3.Nex t(100000, 999999), | |
331 | firstName = firstNam e2, | |
332 | lastName = "Doe" + r andom3.Nex t(1, 999). ToString() , | |
333 | ssn = "666 551414", | |
334 | issueText = $"Method OfContact: {text} (b ut this is actually where text about the case goes !)", | |
335 | methodOfCo ntact = te xt, | |
336 | methodOfCo ntactData = methodOf ContactDat a, | |
337 | relationTo Vet = "Dau ghter", | |
338 | institutio n = "629", | |
339 | contactDat e = DateTi me.Now.ToS tring(), | |
340 | MessageId = Guid.New Guid().ToS tring() | |
341 | }; | |
342 | try | |
343 | { | |
344 | VeisConfig config = RetrieveVe isConfig(i risPath); | |
345 | IrisCreate Interactio nResponse irisCreate Interactio nResponse = WebApiUt ility.Send ReceiveVei sRequest<I risCreateI nteraction Response>( config, "I nteraction ", irisCre ateInterac tionReques t); | |
346 | if (irisCr eateIntera ctionRespo nse.Except ionOccurre d) | |
347 | { | |
348 | catchM ethod(iris CreateInte ractionRes ponse.Exce ptionMessa ge); | |
349 | } | |
350 | if (irisCr eateIntera ctionRespo nse != nul l && irisC reateInter actionResp onse.Inter actionID ! = null) | |
351 | { | |
352 | Consol e.WriteLin e($"Create d Interact ion for {i risCreateI nteraction Request.fi rstName} { irisCreate Interactio nRequest.l astName}." ); | |
353 | } | |
354 | else | |
355 | { | |
356 | Consol e.WriteLin e("record not create d. Null re sponse ret urned."); | |
357 | } | |
358 | } | |
359 | catc h (Excepti on ex3) | |
360 | { | |
361 | Console.Wr iteLine($" Exception Occurred: {ex3.Messa ge}"); | |
362 | } | |
363 | } | |
364 | } | |
365 | ||
366 | pr ivate stat ic void ca tchMethod( string mes sage) | |
367 | { | |
368 | Console. WriteLine( "Unable to create re cord. Exce ption: " + message); | |
369 | } | |
370 | } | |
371 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.