Activity feed entries not registering

cancel
Showing results for 
Search instead for 
Did you mean: 
lex91
Active Member II

Activity feed entries not registering

Jump to solution

Hello,

I posted this question in the Application Development Framework first but got no answers so I will try my luck here.

I've written and installed a repository webscript onto a server running Alfresco Community v5.2.0 (r133656-b12).

When accessed, this webscript displays a table containing activity feed events (file-previewed, file-created, file-added etc.) pertaining to a specific document identified by its nodeRef. It gets the activity events by accessing the alf_activity_feed table directly using: 

Connection db = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);

It seemed to work fine but I recently noticed that sometimes the activity (when I preview a document, for example) doesn't register. If I repeat the same activity, with the same user, on the same unaltered document later (from minutes to hours later), at some point, it registers.

I followed the logs and database when it occured and nothing happens...no errors and the activity doesn't show up in either alf_activity_post or alf_activity_feed tables. While this is happening, other activities, users, documents get registered continuously.

Unfortunately, I'm stumped. I haven't found any predictable pattern to it. I was thinking there may be some sort of limit on the number of entries per user/site/time interval but haven't found anything.

I would greatly apreciate any help, idea that can point me in the right direction.

 

Alex.

1 Solution

Accepted Solutions
lex91
Active Member II

Re: Activity feed entries not registering

Jump to solution

Just thought I'd post this in the unlikely case someone else experiences the same issue. The solution to my problem was rather simple, but not at all obvious.

I knew that alfresco only registered events for documents in sites and for users that are members of those sites. What I didn't know is the link you access to see the document must contain the word "site" and the site name. Because in my alfresco server documents get moved from site to site, the users got emails with custom built links that didn't contain the site name. Altough both links led to the same document, one registered events and the other didn't.

Link that doesn't register:

https://alfresco/share/page/document-details?nodeRef=${nodeRef}

Link that registers:

https://alfresco/share/page/site/${document.siteShortName}/document-details?nodeRef=${nodeRef}

 

Hopefully, this helps.

Alex. 

View solution in original post

6 Replies
yreg
Active Member II

Re: Activity feed entries not registering

Jump to solution

Hi Alex,

First of all, be warned that accessing Alfresco DB directly is an anti-pattern, and is usually a recipe for trouble! You should almost never do that.

With that being said, as far as I remember, those activities are only recorded for sites (so if you access site content through repository webscript URL, you might get slightly different activity recorded or no activity at all) and there is also a couple other limits, namely the maximum duration activities are kept for (I think that defaults to 31 days) and the maximum number of activities recorded (could be bound to a user or a site, not really sure) any how you could configure those limits through : https://docs.alfresco.com/6.0/tasks/adminconsole-activitiesfeed.html you could also checkout the out of the box webscripts providing the activity feeds you are looking for : https://docs.alfresco.com/5.0/references/RESTful-FeedUserfeedGet.html it is probably better to either use those or the underlying APIs...

 

Younes

 
 
 
lex91
Active Member II

Re: Activity feed entries not registering

Jump to solution

Hi Younes,

Thank you for your response. 

I know accessing the db directly isn't recommended and believe me, I have tried to find another way to get all the activities related to one document(identified by nodeRef) but was unsuccessful.

The only activities I am interested in are those recorded normally (uploading, viewing, deleting documents through the site's document library) not by accessing site content through repository webscript URL. All documents tested were in sites and the users accessing the documents were members of said sites.

I have found the limits you mentioned and tweaked them to my usecase but it did not address the issue. I will checkout the ootb webscripts you mentioned but on first glance they seem to be missing the main parameter I need to filter by (the document nodeRef).

Something else did come to mind. Once in a while a document will get stuck as in: cannot be moved, deleted, its properties cannot be altered. I do not know if it is related but as the activity issues I mentioned, the document eventually gets unstuck by itself (haven't been able to identify the actions that cause it to get stuck or unstuck). Does this sound like something you've encountered?

Thank you for your help!

Alex.

ermannorusso
Member II

Re: Activity feed entries not registering

Jump to solution

From what I remember, the activity feed only registers changes done in share from within a site. So if you make changes with REST apis or even with share but from the repository menu and not from the site, those changes won't be part of the feed.

lex91
Active Member II

Re: Activity feed entries not registering

Jump to solution

Yes, I know that. As I mentioned in reply to Younes' post: "The only activities I am interested in are those recorded normally (uploading, viewing, deleting documents through the site's document library) not by accessing site content through repository webscript URL."

The changes I am making are done in share from within a site but still will not register.

 

Alex.

lex91
Active Member II

Re: Activity feed entries not registering

Jump to solution

Just thought I'd post this in the unlikely case someone else experiences the same issue. The solution to my problem was rather simple, but not at all obvious.

I knew that alfresco only registered events for documents in sites and for users that are members of those sites. What I didn't know is the link you access to see the document must contain the word "site" and the site name. Because in my alfresco server documents get moved from site to site, the users got emails with custom built links that didn't contain the site name. Altough both links led to the same document, one registered events and the other didn't.

Link that doesn't register:

https://alfresco/share/page/document-details?nodeRef=${nodeRef}

Link that registers:

https://alfresco/share/page/site/${document.siteShortName}/document-details?nodeRef=${nodeRef}

 

Hopefully, this helps.

Alex. 

View solution in original post

Community Manager
Community Manager

Re: Activity feed entries not registering

Jump to solution

Hi @lex91,

Thanks for posting your update - it really helps other users when solutions are posted. 

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!