Unable to trigger a job in telligent

Former Member
Former Member

Hi Team,

I unable to trigger job from below code and I got the below exception. My job server is running fine.

I referred this link ,community.telligent.com/.../jobs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telligent.Evolution.Extensibility.Api.Version1;
using Telligent.Evolution.Extensibility.Jobs.Version1;

namespace Telligent.Test.Widget.Extension.Plugin
{
    public class TestJobTemplate : IEvolutionJob, IRecurringEvolutionJobPlugin
    {
        public JobSchedule DefaultSchedule
        {
            get { return JobSchedule.EveryMinutes(1); }
        }

        public Guid JobTypeId
        {
            get { return new Guid("A5F40BA8-7D11-4429-AFE9-8238CE450B73"); }
        }

        public JobContext SupportedContext
        {
            get { return JobContext.Service; }
        }

        public void Execute(JobData jobData)
        {
            var eventLog = Telligent.Common.Services.Get<IEventLog>();

            eventLog.Write(
                "SampleRecurringJob has successfully run",
                new EventLogEntryWriteOptions
                {
                    Category = "Jobs",
                    EventType = "Information"
                });
        }

        public string Description
        {
            get { return "This is a sample recurring job to demonstratoe how the IRecurringEvolutionJobPlugin works"; }
        }

        public void Initialize()
        {
        }

        public string Name
        {
            get { return "Sample Recurring Job"; }
        }
    }
}

Kindly help me resolve this issue, thanks!

Regards,

Kiran Ch.



link upldates
[edited by: kiran at 10:23 AM (GMT 0) on Wed, Aug 18 2021]
Parents Reply
  • Former Member
    0 Former Member in reply to Former Member

    The data you are trying to get out of the JobData object isn't there. If this is a dynamically-called job, you can provide contextual information needed for job completion by populating a JobData object when calling Execute. If this is a scheduled job, the job server handles calling execute and you would typically have all the data needed to run without fetching anything from JobData (i.e., you wouldn't need any context to run a scheduled job).

Children