Skip to main content
Nintex Community Menu Bar

How to load a K2 5 kprx into a Persistable Object?

  • July 17, 2018
  • 1 reply
  • 7 views
  • Translate

Hi,

Anyone have idea to load K2 5 kprx into PersistableObject?

 

I have try to get a PersistableOject using "Load" method of  SourceCode.Framework.SerializationInfoProvider  with memory Stream of K2 Five kprx.  see below source code.

static void Main(string[] args){       byte[] x = GetProcessSource(@"C:Usersk2adminDocumentsK2 5 kprxKprxUpdateSubSiteByGetRefProcess_K2Five.kprx");using (var serializer = new SerializationInfoProvider())            using (var stream = new MemoryStream(x))            {                if (stream != null)                {                                       PersistableObject pot =(PersistableObject)serializer.Load(stream);                                   }            }} public static byte[] GetProcessSource(string fileName)        {            try            {                // Read the file as byte                byte[] kprxBytes = File.ReadAllBytes(fileName);                // Return the KPRX bytes                return kprxBytes;            }            catch            {                throw;            }        }

I am getting  following Exception on

 

PersistableObject pot =(PersistableObject)serializer.Load(stream);

above line.

 

Exception : "Exception has been thrown by the target of an invocation."

12339iF2CECEB945565DE3.png


Note : Above Sourcecode is successfully works for K2 4.7 kprx.  but not working for K2 5 kprx.


Any one have Idea regarding this?

Thanks & Best regards
Kajan

Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+7
  • 25 replies
  • August 21, 2019

Hi Kajan_Ceymplon,


 


Thanks for asking this question here on the community forum. I realize it's been a while since you asked this question, but I guess the community was pretty stumped with the question you asked.


 


Did you manage to resolve your issue in the meantime by other means?


 


If not, then in order to help you here, I'd just like to get some clarity on the issue you describe.


 


Why are you trying to "Load" a K2 Five Workflow KPRX file into a C# application using the PersistableObject class?


 


What is the end result of this project supposed to be? Do you want to automate the deployment of workflows somehow? Does this have to do with keeping track of Version Control like in TFS/Git?


 


Maybe adding some screenshots to this post would help clarify what you're trying to do.


 


Thanks and kind regards,
ChrisW

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings