AnsweredAssumed Answered

Simple JavaScript???

Question asked by peterstb on Feb 23, 2010
Latest reply on Feb 24, 2010 by peterstb

I'm struggling with something that feels like it should be as simple javascripting exercise, and am not able to derive any help from the JavaScript API reference or the JavaScript API Cookbook.  Although both are good documents, I seem to be struggling with context, specifically related to getting handles and executing workflow steps on documents that are not the documents that have initiated an action ("execute script").

I have draft, review, heartbeat, and live folders/spaces defined, and want to execute a script, when an approver approves a document from the review space.  There is a simple workflow rule defined to allow an approver to approve or reject an item in the revew folder.  Approval moves the item to the live space.  I have a rule defined on the live space to "execute a script". 

My desired functionality is that when a document lands in live, a heartbeat file (simple .txt file) is updated (in the heartbeat space), perhaps with something like a timestamp.  This file will be used by an external process to determine if the entire live space needs to be checked for new content, in order to support a simple caching strategy we have in mind.

This seems like it should be an easy task, but I'm really struggling!  Does anyone have any sample JavaScript they could provide to help me achieve this?  I'll also take alternative suggestions for accomplishing the same objective…