This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to get ObjVer in Task Queue?

Hello!

I am trying to loop through all objects in a certain Class with task queues. Currently stuck on how to get the ObjVer inside this method.

public void TestTaskQueue(ITaskProcessingJob<TaskDirective> job)
{}

Is it possible do so? Or is there other alternative?

var transactionalObjVerEx = new ObjVerEx(); ??

Parents
  • The task itself is unconnected to any M-Files event, so there's no "source" object that started this.  That's why there's no ""ObjVerEx" instance on the job or task directive.

    If you want to loop through all objects then I would typically suggest that you run a search within your processor.  The search can be configured to find the items you need, and then you loop through the results.  Have you tried that sort of approach, or won't that work for some reason?

  • No, I have not tried that approach. Do you mean the SearchCondition?

  • I mean something like this:

    public void TestTaskQueue(ITaskProcessingJob<TaskDirective> job)
    {
        var searchBuilder = new MFSearchBuilder(job.Vault);
        searchBuilder.ObjType(0);
        searchBuilder.Deleted(false);
        foreach(var obj in searchBuilder.FindEx())
        {
            // TODO: something.
        }
    }

Reply
  • I mean something like this:

    public void TestTaskQueue(ITaskProcessingJob<TaskDirective> job)
    {
        var searchBuilder = new MFSearchBuilder(job.Vault);
        searchBuilder.ObjType(0);
        searchBuilder.Deleted(false);
        foreach(var obj in searchBuilder.FindEx())
        {
            // TODO: something.
        }
    }

Children