Desktop version

Main > Forum > Applications > 1C:Standard Subsystems Library (SSL) > BackgroundJob.Execute onWrite Catalog Module

Forum

Search UsersRules
BackgroundJob.Execute onWrite Catalog Module
#1
Interested
Points:: 15
Joined:: Oct 27, 2011

I have put backgroundjob execute command in onWrite section of catalog object module, but I have got an error:

Quote
Error running processor - 'OnWrite'
because:
{Catalog.Nomenclatura.ObjectModule(41)}: Error calling context method (Execute)
BackgroundJobs.Execute("GeneralFunctions.UpdateFullTextSearch",,,"Nomenclatura full text search update");
because:
Job manager is not active.

Do I have to intilize something? Or are there any restrictions for compatibility mode?

Without this Full text serach for catalogs is almost useless, because nobody would like to hit update full text serach button before continue to work. If I do not use backround job I could run into probles if the index was not updated for a long time.

Profile
#2
Guest
Points::
Joined::

Hello, Alexey!

1C:Enterprise platform 8.3 executes background jobs in file mode automatically.

To execute background jobs in previous versions use ProcessJobs() function.

Profile
#3
Interested
Points:: 15
Joined:: Oct 27, 2011

Could you please helpme with example or documentation. I can not find any reference to ProcessJobs function.

Currently we use 8.3.4 for development but with 8.2 compatibility mode. We are in process of passing all our clients to 8.3.

I need to update Full text search every time I made some changes to Nomenclatura catalog. Do I need to write something like this?

Code
Procedure OnWrite(Cancel)
   BackgroundJobs.Execute("GeneralFunctions.UpdateFullTextSearch",,,"Nomenclatura full search update");
   ProcessJobs();
EndProcedure

The function called is basically just one line
Code
FullTextSearch.UpdateIndex();

Profile
#4
Guest
Points::
Joined::

It is better to embed 1C:Subsystems Library 2.0 into your application. There is the Scheduled and background jobs data processor that is designed to start separate sessions for job processing and more.

Profile
#5
Interested
Points:: 15
Joined:: Oct 27, 2011

If I need to just run asincronius process? 1C:SL is a lot of code to mantain in the project, so I would like to have an alternative. I do not care if it fails, I do not care when it finish. I just want to run it without interrupting user work.

Profile
#6
Guest
Points::
Joined::

There are two ways: to perform scheduled jobs that you added and to execute procedures without making them background. If you make direct call of procedures that are designed to be background, users will feel that the application works slow. Plus web browsers will try to interrupt scripts that are waiting for too long.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.