go to post Neerav Verma · Nov 19, 2018 I think you need to work with this set obj = ##class(%DynamicObject).%New()do obj.Destinations.SetAt("London", counter) Add to this obj your destinations as you would add to an array property and then do ToJson
go to post Neerav Verma · Oct 24, 2018 Step 2 : BPa. Bp gets the topic and json array of json recordsb. It calls the PubsubBo to get all the subscribers for this topicc. It loops through json recordsd. for each records. loops through the targets e. Sends the message to target via the Call activity of the BPPFA : Screenshot of subscribers to a topic Note : This can be moulded as per the requirement. Each json msg can have a topic instead of the topic being outside of array etc.You can use your own messages instead of json too if you need.You can even send messages via the pubsub bo instead of just getting targets. (version attached)I mean all sorts of adjustments can be made as this is very generic and re-usableLink to the CodeDownload CodeAny issues pls email me nv@nv-enterprises.biz
go to post Neerav Verma · Oct 24, 2018 Example I made aims to make a resusable / generic pub-sub model which is passing a generic json message from start to finish and all bp/bo etc then need to transform / parse as per their own need once they receive the json. Do let me know if any queriesSo this is how the flow works . 1. Service a. Read a csv file, loop through all recordsb. In each loop make one json msg and add it to the json array of messages (which is nothing but just an array of text as json is just text)Property RequestJSONArray As array Of %Text(MAXLEN = 10000); Property Topic As %String(MAXLEN = 100);c. End of loop Send the array to the BPThis is few lines of code of Service Class File.BS.FileServiceBS Extends Ens.BusinessService{Parameter ADAPTER = "EnsLib.File.InboundAdapter";Method OnProcessInput(pInput As %FileCharacterStream,pOutput As %RegisteredObject) As %Status{ set DELIMITER = "^" set counter=1 //records read set JSONDynamicBPRequest = ##class(Ent.Library.JSON.BP.JSONDynamicBPRequest).%New() set JSONDynamicBPRequest.Topic = "TESTCSV" while 'pInput.AtEnd { while counter < 3 { set line=pInput.ReadLine() if ( counter > 1 ) { set req = ##class(%DynamicObject).%New() set req.ClaimId = $piece(line,DELIMITER,1) set req.Company = $piece(line,DELIMITER,2)set req.ClaimProvider = $piece(line,DELIMITER,3)set req.PrimaryInsuranceCarrier = $piece(line,DELIMITER,4)set req.EncounterDate = $piece(line,DELIMITER,5)$$$TRACE("req.%ToJSON() "_req.%ToJSON())do JSONDynamicBPRequest.RequestJSONArray.SetAt(req.%ToJSON(), counter) k req } set counter=counter+1 } do ..SendRequestSync("JSONDynamicBP",JSONDynamicBPRequest) $$$TRACE("JSONDynamicBP loaded : " _ (counter - 1)_" "_$ZDATETIME($ZTIMESTAMP,3,1,6)) Quit $$$OK}}
go to post Neerav Verma · Sep 28, 2018 There is a little modification now what I want to do Basicallly I want to read the Event Log (Ens_Util.Log) where type is not in INfo , trace etcand on every new warning, error etc . send the error msg to my BP - (Which is the pubsub bp)Is there any service which continously polls for new additions to this log besides the Sql inbound adapter?
go to post Neerav Verma · Sep 28, 2018 To put pure methods in abstract or not purely depends if it can be overridden. I have never been sure what ProcedureBlock 0 or 1 means in terms of internal procedures. Can you pls put some light on it?
go to post Neerav Verma · Sep 28, 2018 Class Test.RegObjTest Extends %RegisteredObject [ Final ]{ClassMethod NewMethod1() [ Final, NotInheritable ]{ w "Neeravcxfdfd"}}
go to post Neerav Verma · Sep 28, 2018 Will they ever be overridden or are you just calling them Class.Method
go to post Neerav Verma · Sep 19, 2018 set io="c:\temp\test.pdf"open io:("nw")use io write tRequest.HttpResponse.Data.Read()close ioI am creating a pdf file from a http request. Obviously you can change all these
go to post Neerav Verma · Sep 19, 2018 I don't think Business Rules are meant to do the looping. They are more for higher level logic and conditions.For more inner level Transformations and BP's should be used as they have an inbuilt functionality of loops for the same reasonJust my 2 cents.
go to post Neerav Verma · Sep 19, 2018 This is a bug in Sql import & export from Intersystems. There is a quick fix to it. You can call them and ask for it.
go to post Neerav Verma · Sep 19, 2018 Thanx to all and esp to EduardI used a mix of Eduard's code, docs, EnsLib.PubSubOperation and some of my codeFrom my BP - I am calling the PubSubBo with a response of arrays that gives me targets in a string array - BP then sends to all targets from a call inside a loop of targets array. The target of which is set dynamically from context of the loop element.This gives me an extra functionality of putting some extra logic but most importantly in Visual Trace it doesn't look odd if target is a BP.If target is a BP and it is forwarded to, from a normal pubsubBo then in visual trace it shows a backward arrrow which is hard to explain to non tech people as it seems its going backward not forward. So forwarding it to targets from a BP is a better and cleaner option .Can share code to anyone if needed.
go to post Neerav Verma · Sep 17, 2018 Ok. Let me import the full code and take a look. In case you are on skype , add me pls: https://join.skype.com/invite/Nqr7BaOpnh2o
go to post Neerav Verma · Sep 17, 2018 HeyIts really hard to gather any flow or re-use. Did you made any operation that uses Ens.PubSubRouting?
go to post Neerav Verma · Sep 15, 2018 The creation of Namespaces, databases, mappings, roles, cspapps etc needs to be done only via the Mgmt PortalThe issue you are facing is clearly of rights. Start from the scratch by using %All rights to your namespaces, db, apps etcTry to not use a different db for routines for starters
go to post Neerav Verma · Jun 13, 2018 I do not know the answer to above but would like to add that authentication would be over HTTPS not HTTP