Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Bug in SaveWorkData?
Brian_Lee
Hi,Wonder if anybody has seen something like this. I wrote an event script to update a workflow attribute with the workflow ID. It works as far as that is concerned.I've now found that if there is another attribute that is a multivalued string, that value gets corrupted after my script runs. Attached are some before and after screenshots ofthe wf attribute data. Also the script. What was once "New" becomes "7824718". Weird.Any input would be welcome.cheers,-Brian
Find more posts tagged with
Comments
Jeff Lang
I haven't seen this exact problem, but I've seen similar ones. The problem is with the work parameter. When that parameter is passed to the callback method from the C++ it references its own data. That work object is used for all the callback operations. If any other callback operation does anything to modify it, then it may end up pointing to the wrong work.When I write event scripts that are going to access the data package I always create my own work variable. It's just safer to do that. You are given the work and subwork ids, so just alloc a work object and then use that WAPIWORK object to access the work package for the workflow in question. Use that work when loading or saving the work package data.hope this helps,jeff
Kai_Chow
Based on the 2 jpegs that you posted, I think the problem has something to do the database encoding format. It could be that the install LL server encoding is different from the database, e.g. using a iso-latin1 LL server to access a UTF-8 database or vice-versa.kai
Brian_Lee
I had two text WF attributes. One user selected, the other updated by my script. Problem was, I was storing an integer value into the text field.When the RecArray was created, a string and an integer datatype were stored in the 'WF_Valstr' column instead of all strings. This column is a varchar in the WFAttributes table. Somehow when the insert statement was executed, the string value was converted into an integer.To fix the problem, I changed the one text field attribute to an integer field attribute. Now it stores the value in the correct column and existing string values are preserved.Thanks everybody!cheers,-Brian