Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Why does my Asynchronous Task not start?

 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?

1

0 votes



One answer

Permanent link
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.

1 vote

Comments

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. 

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).

 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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,929

Question asked: May 06 '13, 5:09 p.m.

Question was seen: 5,114 times

Last updated: Jun 28 '13, 8:20 p.m.

Confirmation Cancel Confirm