You are viewing limited content. For full access, please sign in.

Question

Question

How do I get the workflow subscriber interested in FolderInfo events via the SDK ?

asked on May 10, 2016

I expected this:

FolderInfo NewFolder = new FolderInfo(s);
NewFolder.Create(FolderPath, EntryNameOption.AutoRename);
NewFolder.Dispose();

to fire the Entry Created event, but I don't see it in the Subscriber Tracer. It does create the folder in the repository, which is nice, but I'd like Workflow to know that I created it so it can do more fancy things after.

Similarly, I tried this:

NewFolder.Lock(LockType.Exclusive);
NewFolder.SetTemplate(TemplateName);
NewFolder.SetFieldValues(MetaFieldValues);
NewFolder.Save();
NewFolder.Unlock();

hoping for the Entry Changed event, but only found disappointment. Again, the folder metadata is updated successfully, but the Workflow will never fire. 

I'm using version 9.2. 

 

What am I doing wrong?

0 0

Answer

SELECTED ANSWER
replied on May 10, 2016

@Andrew: do you have starting rules for Entry Created events? The Subscriber will ignore event types it does not have rules for. If you need to check whether the notification was generated, you can use the "Laserfiche Live Event Viewer" available from the Subscribers node in the WF Admin Console.

@Scott: that's not quite correct. The SDK documentation describes how a custom application that wishes to get notifications could subscribe to them. The events are always written to the activity log by the LFServer, but your custom application needs to subscribe to them in order to receive them. An SDK application performing actions in Laserfiche will automatically generate events in the activity log, there is no need or way to specifically tell it to generate them.

2 0
replied on May 10, 2016

Removed my prior post so that I don't confuse/mislead anyone who happens to see this thread later. Thanks for the clarification... that's what I get for skimming the documentation.

0 0
replied on May 11, 2016

Thanks Miruna, that helps. 

Can I create a folder with metadata and a template, or do I need to create it, then set the template and field values?

0 0
replied on May 11, 2016

You have to do them separately. Per SDK Documentation, this is the crreation method in RA:

Folder.Create(Path as String, Volume as String, EntryNameOption, Session)    

0 0
replied on May 11, 2016

Ok, thanks!

0 0

Replies

You are not allowed to reply in this post.
replied on May 10, 2016

The SDK does not automatically trigger notification events. You have to explicity generate the notifications in your code. Check your SDK documentation under Tutorial: Notifications And the Activity Log... there is a sample code snippet that may help you involving the use of the NotificationManager object.

You are not allowed to follow up in this post.

Sign in to reply to this post.