Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

ExactTarget - What's Your Score
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
The best choice for your web site host, email hosting, and domain registration.
 


  Sponsors  

Meet Our Sponsors

DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Scheduler class is not called
Previous Previous
 
Next Next
New Post 5/16/2008 2:05 PM
Unresolved
User is offline zoran
8 posts
10th Ranked


Scheduler class is not called 

 

Hi Everyone!

I need some help with the scheduler! I can't get it to run. I created a class simular to the sample in the documentation!

That part went well but the scheduler is not running. I will not get any error messages and no history exist.

Obviosly the class that I wrote is not called by the scheduler! Is there something I am missing and how can I debug the scheduler?

My Class:

-------------------------------------------------------

Imports Microsoft.VisualBasic
Imports System.IO

Namespace DotNetNuke.Modules.MoistureSensitiveItems

    Public Class AutoEmailNotification
        Inherits DotNetNuke.Services.Scheduling.SchedulerClient
        Public Sub New(ByVal objScheduleHistoryItem As DotNetNuke.Services.Scheduling.ScheduleHistoryItem)
            MyBase.New()
            Me.ScheduleHistoryItem = objScheduleHistoryItem
        End Sub

        Public Overrides Sub DoWork()
            Try
                Me.Progressing()

                MSINotification()

                Me.ScheduleHistoryItem.Succeeded = True

                Me.ScheduleHistoryItem.AddLogNote("File updated")

            Catch ex As Exception

                Me.ScheduleHistoryItem.Succeeded = False

                Me.ScheduleHistoryItem.AddLogNote("EXEPTION: " + ex.ToString)

                'nootification that we have errored
                Me.Errored(ex)

                'Log the Exception
                LogException(ex)
            End Try
        End Sub

        Private Sub MSINotification()
            'create filename
            Me.Status = "Updating file"
            Dim FILENAME As String = MSI_Global.MSI_FILEPATH_TEMPFOLDER & _
                                     DateTime.Now.Year.ToString() & _
                                     DateTime.Now.Month.ToString() & _
                                     DateTime.Now.Day.ToString() & _
                                     DateTime.Now.Hour.ToString() & _
                                     DateTime.Now.Minute.ToString() & _
                                     DateTime.Now.Second.ToString() & ".txt"

            'create writestream
            Dim objStreamWriter As StreamWriter
            objStreamWriter = File.AppendText(FILENAME)

            objStreamWriter.WriteLine("I'am running -- " + DateTime.Now.ToString)

            'Close the stream
            objStreamWriter.Close()
            Me.Status = "Updating complete"
            Me.ScheduleHistoryItem.AddLogNote("Add new timestamp to file")
            Me.ScheduleHistoryItem.Succeeded = True
        End Sub
    End Class
End Namespace

 
New Post 5/22/2008 4:50 AM
User is offline Paul
2 posts
10th Ranked


Re: Scheduler class is not called 

Hi Zoran,

I have exactly the same problem - no events in the event viewer, no exceptions anywhere, no history, nothing. Did you ever find out any more about how to investigate this further?

Cheers,

Paul

 
New Post 5/22/2008 8:01 AM
User is offline Paul
2 posts
10th Ranked


Re: Scheduler class is not called 

 

Hi Zoran, again, and to answer my own question, this is what I did...

Suspecting that my SchedulerClient class wasn't being constructed at all, I copied some of the code out of the source for DNN Scheduler, and pasted it into the code behind a button on a dummy test module:

Stop
'''''''''''''''''''''''''''''''''''''''''''''''''''
Dim t As Type = System.Web.Compilation.BuildManager.GetType("Idonix.DNN.Modules.EC.MyriadMembership.MyriadMembershipImporter", True, True)
Dim param(0) As DotNetNuke.Services.Scheduling.ScheduleHistoryItem
param(0) = New DotNetNuke.Services.Scheduling.ScheduleHistoryItem
'''''''''''''''''''''''''''''''''''''''''''''''''''
'Get the constructor for the Class
'''''''''''''''''''''''''''''''''''''''''''''''''''
Dim types(0) As Type
types(0) = GetType(DotNetNuke.Services.Scheduling.ScheduleHistoryItem)
Dim objConstructor As System.Reflection.ConstructorInfo
objConstructor = t.GetConstructor(types)
'''''''''''''''''''''''''''''''''''''''''''''''''''
'Return an instance of the class as an object
'''''''''''''''''''''''''''''''''''''''''''''''''''
Dim C as DotNetNuke.Services.Scheduling.SchedulerClient = CType(objConstructor.Invoke(param), DotNetNuke.Services.Scheduling.SchedulerClient)

 

Note the 'stop' at the top that makes debugging/step through of the code possible, so long as the site is on your dev. machine.

Having done this and stepped through the code, I discovered firstly that I had the wrongly formatted AssemblyName/TypeName thing, but being able to experiment in the Immediate window of Visual Studio made it easy to fiddle until it came right.

I then discovered that my SchedulerClient class's constructor 'Public Sub New(item as ScheduleHistoryItem)' was missing (oops!), and so the objConstructor above was returning nothing. Having fixed that up all came good, and my scheduled job took off as expected.

If you put a 'Stop' line in the top of your DoWork() sub, you'll also hit the debugger when the code is at last called.

I hope this is some help.

Cheers,

Paul.

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Scheduler class is not called
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Bring2mind
Document Centric DNN Module Solutions
www.bring2mind.net
WEBPC™ DotNetNuke® sites for Small Business
WEBPC™ are internet consultants and web hosters catering to the small business market.
www.webpc.biz
Perpetual Motion Interactive Systems Inc.
A solutions company specializing in Microsoft enterprise technologies.
www.perpetualmotion.ca

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP