It's all about the answers!

Ask a question

Why does my Asynchronous Task not start?


0
1
Andrew Soloninka (5511924) | asked May 06 '13, 5:09 p.m.
 I have created an Asynchronous Task and am attempting to test it. However, the task does not appear to start. I set the fixed delay to 10 mins. I started the server and launched the client and waited for over 15 mins the breakpoint to stop the application but it never happened. I checked the component status and found that the component was not listed. 

  • I used the com.ibm.team.repository.service.Asyncronous Task extension point
  • I added the plugin to the Debug/Run Configuration.
  • The class in the plugin extended AbstractAutoScheduledTask
Is there something I missed?

One answer



permanent link
Jorge Diaz (8664434) | answered May 12 '13, 5:33 p.m.
JAZZ DEVELOPER
edited May 13 '13, 10:56 a.m.
Hi Andrew,

in general what you mention sounds right. I assume you specified the delay using a task configuration property, am I right? Just in case, the following is a skeleton for an asyncTask extension declaration to make it run every 30 seconds:


<extension
           point="com.ibm.team.repository.service.asynchronousTask">
       <asynchronousTask
                taskId="myTaskID">
          <extensionService
                 componentId="com.ibm.team.repository"
                 implementationClass="myClass">
               <prerequisites>
                     <configurationProperties>
                             <configurationProperty 
                                        accessPolicy="OPEN"
                                        default="30"
                                        description="Desc"
                                        displayableName="Name"
                                        name="myTaskID.fixedDelay"
                                        required="true"
                                        type="LONG"
                                        updatePolicy="FRAMEWORK_RESTART_REQUIRED">
                           </configurationProperty>
                    <configurationProperties>
            </prerequisites>
       </extensionService>
    </asynchronousTask>
</extension>

 

With a component declaration as the example above, the method "runTask()" in the task implementation class <myClass> will be called every 30 seconds. This should give you a clue of what is not working in your implementation.

Note that normally the actual logic is carried out by a repository service and the task will be used to trigger the service in your timely defined manner. As such the service will have to be declared in the prerrequisites section as well.

Regards,

Jorge.


Comments
Andrew Soloninka commented May 14 '13, 12:14 p.m.

Jorge 


Thanks for the template. I made sure my plugin.xml matched the template. I also added the service: com.ibm.team.repository.service.IRepositoryItemService. However, the task still does not start. 


Jorge Diaz commented May 20 '13, 4:18 a.m.
JAZZ DEVELOPER

Andrew, note that the sample skeleton defines a task belonging to repository component. If you are defining a task of your own component, make sure it's referring to an actual declared component ("com.ibm.team.repository.common.components" extension point).


Andrew Soloninka commented Jun 28 '13, 8:19 p.m. | edited Jun 28 '13, 8:20 p.m.

 This is an update for this question. 


Jorge, I took your advice and removed all required services and found that the Task started but errorred. I then began adding back in each of the required services until I came across a service that caused the Task not to start. In my testing I found that services could only be represented by interfaces not classes. I corrected 2 services that were represented by classes. Currently I am having problem with a service based on IQueryCommon. If I add IQueryCommon as a required service the Task doesn't start. I am using IQueryCommon in another Task and that Task is running fine. 

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.