on ‎2019 Apr 03 4:39 PM
Hello Experts,
What is difference b\w Job vs AbstractJobPerformable in Cronjobs? When we will go with JobModel or AbstractJobPerformable.
Thanks,
Request clarification before answering.
The class extending AbstractJobPerformable (which implements JobPerformable) contains the logic to be executed when a CronJob runs. During the phase of essential data creation, for each Spring definition of a class implementing the JobPerformable, a ServicelayerJob instance gets created and the springId attribute of ServicelayerJob is set to reference the Spring bean. Given below is the definition of ServicelayerJob:
<itemtype code="ServicelayerJob"
extends="Job"
jaloclass="de.hybris.platform.servicelayer.internal.jalo.ServicelayerJob"
autocreate="true"
generate="true">
<attributes>
<attribute qualifier="springId" type="java.lang.String" autocreate="true">
<persistence type="property"/>
<modifiers read="true" write="true" search="true" initial="true" optional="false"/>
</attribute>
<attribute qualifier="springIdCronJobFactory" type="java.lang.String" autocreate="true">
<persistence type="property"/>
<modifiers read="true" write="true" search="true" initial="true" optional="true"/>
</attribute>
</attributes>
</itemtype>
In summary, the CronJob executes the logic contained in the class extending AbstractJobPerformable through the reference ( springId) provided by ServicelayerJob( which extends Job ) .
Note: The id of the Spring bean (extending AbstractJobPerformable) is set to the code attribute as well (in addition to the springId attribute). You can execute SELECT * FROM {ServicelayerJob} FS Query to check this.
You can also check my another answer, https://answers.sap.com/questions/12771589/cronjob-creation.html?childToView=12805403#answer-1280540... on this topic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.