JiwaImportQManager issues after upgrading to 7.1.0  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

JiwaImportQManager issues after upgrading to 7.1.0

Postby JohnO » Mon Dec 18, 2017 11:05 am

I recently upgraded from 7.0.175 and am having problems with the ImportQManager.

I have read the guides but I must not have converted the code correctly because I cannot get XML to import through the ImportQManager without an exception.

Jiwa version 7.1.0, VB.NET, SQL Server 2008

This is the working code for version 7.0.175:
Code: Select all
Manager.Instance.Logon("Path", "DB", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Username", "Password")
Dim importQueueManager As JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItemCollection = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic(Of JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItemCollection)(Nothing)

Dim queueItem As New JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItem
queueItem.TransformedXML = xmlDocString
queueItem.Status = JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItem.ImportQueueItemStatuses.ReadyForImport
importQueueManager.Add(queueItem)
queueItem.Process()

Converted code for version 7.1.0 that throws the exception below:
Code: Select all
Dim man As New JiwaFinancials.Jiwa.JiwaApplication.Manager
man.Logon("Path", "DB", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Username", "Password")
Dim importQueueManager As JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItemCollection = man.BusinessLogicFactory.CreateBusinessLogic(Of JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItemCollection)(Nothing)

Dim queueItem As New JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItem
queueItem.TransformedXML = xmlDocString
queueItem.Status = JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItem.ImportQueueItemStatuses.ReadyForImport
importQueueManager.Add(queueItem)
queueItem.Process()

This is the exception I am getting:
Code: Select all
Type : System.NullReferenceException
Message : Object reference not set to an instance of an object.
Stacktrace :
   at JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItem.iSave()
   at JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItem.Process()
   at kickOffImport(String xmlDocString)

Any help would be greatly appreciated. Thanks.
JohnO
I'm new here
I'm new here
 
Posts: 2
Joined: Fri Dec 15, 2017 12:34 pm

Re: JiwaImportQManager issues after upgrading to 7.1.0  Topic is solved

Postby Mike.Sheen » Mon Dec 18, 2017 12:01 pm

Hi JohnO,

This will cause your issue:
Code: Select all
Dim queueItem As New JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItem


in version 7.1 and later we require you to use our factories to create entities, collections and collection items - in this case the ImportQueueItem is a class inheriting from JiwaCollectionItem, so you should use our CollectionItemFactory to create an instance of that class:

Code: Select all
Dim queueItem As JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItem = man.CollectionItemFactory.CreateCollectionItem(Of JiwaFinancials.Jiwa.JiwaImportQManager.ImportQueueItem)()


Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: JiwaImportQManager issues after upgrading to 7.1.0

Postby JohnO » Mon Dec 18, 2017 12:06 pm

Brilliant, thanks Mike. Worked perfectly.
JohnO
I'm new here
I'm new here
 
Posts: 2
Joined: Fri Dec 15, 2017 12:34 pm


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 32 guests