Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Creating DotNetNuke Scheduled JobsCreating DotNetNuke Scheduled Jobs
Previous
 
Next
New Post
8/12/2013 6:21 PM
 
hello
I tried to plan a task on  the scheduler I created the class library and I put the .dll file in the bin directory, but it does not work.
That's what I did

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotNetNuke.Services.Scheduling;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using System.Web;
using System.Xml.Serialization;

namespace Save_DataBase.Module
{
    public class Xml_Save_DataBase : DotNetNuke.Services.Scheduling.SchedulingClient
    {

        public Xml_Save_DataBase(DotNetNuke.Services.Scheduling.SchedulingHistoryItem objScheduleHistoryItem)
            : base()
        {
            this.ScheduleHistoryItem = objScheduleHistoryItem;
        }

        public override void DoWork()
        {
            try
            {
                this.Progressing();

Save_DataBase(); //my job
                this.ScheduleHistoryItem.AddLogNote(" Save_DataBase Service Start. Success.");
                this.ScheduleHistoryItem.Succeeded = true;
            }
            catch (Exception Ex)
            {
                this.ScheduleHistoryItem.Succeeded = false;
                this.ScheduleHistoryItem.AddLogNote(" Save_DataBase Service Start. Failed. " + Ex.ToString());
                this.Errored(ref Ex);
            }
        }

        public void Save_DataBase ()
        {
          //my code
        }
      
    }
}


using System;
namespace DotNetNuke.Services.Scheduling
{

    public class SchedulingClient
    {
        protected SchedulingHistoryItem ScheduleHistoryItem;
        public virtual void DoWork()
        {
        }
        public void Errored(ref Exception Ex)
        {

        }
        public void Progressing()
        {
        }

    }

}


using System;
namespace DotNetNuke.Services.Scheduling
{
    public class SchedulingHistoryItem
    {


        internal void AddLogNote(string p)
        {
            throw new NotImplementedException();
        }

        public bool Succeeded { get; set; }
    }
}


in Schedule Status:

ID Task Name Next Start Overdue
(seconds)
Time Remaining (seconds) Object Dependencies Triggered By Thread Servers
3 Purge Schedule History 8/13/2013 1:36:41 AM 12470 ScheduleHistory STARTED_FROM_BEGIN_REQUEST -1
6 Search Engine Scheduler 8/12/2013 10:35:09 PM 1578 SearchEngine STARTED_FROM_BEGIN_REQUEST 11
29 Save_DataBase 8/12/2013 10:05:26 PM 0 STARTED_FROM_BEGIN_REQUEST -1
10 Purge Module Cache 8/12/2013 10:09:38 PM 47 ModuleCache STARTED_FROM_BEGIN_REQUEST 1
11 Messaging Dispatch 8/12/2013 10:09:38 PM 47 Messaging STARTED_FROM_BEGIN_REQUEST 21


 
New Post
8/12/2013 10:47 PM
 
Your schedule job code should work. We have similar source code which runs successfully. Please click "Host - Schedule", edit your schedule item, check to see if it is correct. You can also try click "Host - Host Settings - Other settings", change "Scheduler Mode" to "Timer Mode" to debug your schedule job more convenience.

Over 20 + professional dnn modules for News Article, Store, Video Gallery, Photo Gallery, Ultra Flash Player,YouTube Video, Image Slide show, Skin Chameleon and much more from DnnModule.com
 
New Post
8/13/2013 1:39 AM
 
this is what I have if I click edit schedule

Friendly Name:     Save_DataBase
Full Class Name and Assembly: Save_DataBase.Module.Xml_Save_DataBase,Xml_Save_DataBase
Schedule Enabled:  checked
Time Lapse:  1 Minutes
Retry Frequency: 25 Seconds
Retain Schedule History: 100
Run on Event: None
Catch Up Enabled: checked
Object Dependencies:
Run on Servers:

I  changed "Scheduler Mode" to "Timer Method" but I don't know how to debug my schedule job


 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Creating DotNetNuke Scheduled JobsCreating DotNetNuke Scheduled Jobs


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out