3

I have done some progress in design, setting up a workflow in Tridion. I can run a default workflow and finish it successfully. When I try to implement email functionality to this I am lagging some information on how to achieve this during content creation, approval and finish activities.

I see Tridion live has more details on terminology and basics, but I am looking for some step by step procedure from how to enable logging in each activity and more of a sample workflow setup from end to end as a developer with email activity. Is there any such thing available?

BTW, I am using 2001 SP1 HR#1..

Pls. advise. - Praveen

2 Answers 2

3

The best approach is to move your activity logic to a C# Class Library, attach to the workflow process and debug normally. However, if you don't have Visual Studio or sufficient access to the server you may print logging statements directly from VBScript editor.

Here is an article providing more details: http://www.tridiondeveloper.com/how-to-debug-tridion-workflow

2

Implement an Event System for Workflow Activity Initiated. For each initiated activity, this event will get triggered and you can send the desired email.

You can try something like this:

1) Subscribe to Event as below:

EventSystem.Subscribe<ActivityInstance, FinishActivityEventArgs>(WorkflowNotifyandPublish, EventPhases.Initiated);

2) Write Your desired code in the method:

    private static void WorkflowNotifyandPublish(ActivityInstance subject, FinishActivityEventArgs args, EventPhases phase)
     {
       // Your Code Logic

      // Get the workitems for associated with this workflow item needed
      IEnumerable<WorkItem> workItems = subject.WorkItems;

      // Get Current WorkItems
      WorkItem curWorkItem;
      using (IEnumerator<WorkItem> iter = workItems.GetEnumerator())
            {
                iter.MoveNext();
                curWorkItem = iter.Current;
            }

      // Your Code Logic to Generate the Mail and Send Mail using C# SMTP classes
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.