BackgroundJob.Execute onWrite Catalog Module

How to enrich your business applications with extra functionality offered by 1C:Standard Subsystems Library

#1
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

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.

 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Alexey!

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

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

 
#3
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

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();

Edited: Alexey Gerasimov - May 22, 2014 12:40 AM
 
#4
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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.

 
#5
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

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.

 
#6
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.