Saturday, April 24, 2010

ClickAnalyze Insight Agent for all Nightly Reports

You have just configured new ClickSchedule report using the Service Optimization Administration console. Now you need to configure an agent to run the report once a night.

I strongly suggest to use the ClickAnalyze Insight agent for any nightly report, with the cost of the new time table needed for the agent. You can create such table using the following SQL:
create table W6RP_MY_REPORT_TIME(PK_Date date not null,
Date_Name varchar2(50) null,
constraint PK_MY_REPORT_TIME primary key (PK_Date)
using index tablespace USERS) tablespace USERS;
Populate the table with single record for two days ago:
TimeCmd "Provider=OraOLEDB.Oracle;User Id=W6ADMIN;
Password=****;Data Source=CAR_ALIAS"
W6RP_MY_REPORT_TIME en-US -2 -2
Create foreign key relation between the tables:
alter table W6RP_MY_REPORT
add constraint FK_MY_REPORT1 foreign key (Time_Start)
references W6RP_MY_REPORT_TIME;
Now just set a new ClickAnalyze Insight agent setting to process the time table and the report:
Owner:        [Application]
Category:     Agent
Sub Category: Insight
Name:         My Report
Body:
<InsightAgent>
  <Connections>
    <Connection>
      <TargetConnection
        Key="-1">(local)</TargetConnection>
      <TimeTable>W6RP_MY_REPORT_TIME</TimeTable>
      <Culture>en-US</Culture>
      <RelativeTo>-1</RelativeTo>
    </Connection>
  </Connections>
  <Reports>
    <Report>
      <Name>My Report</Name>
    </Report>
  </Reports>
  <Notifications>
    <Notification Active="true">
      <Type>Email</Type>
      <From>click@acme.com</From>
      <To>
        <Recipient>dispatcher@acme.com</Recipient>
      </To>
      <Subject>My Report Execution Result</Subject>
      <Importance>2</Importance>
    </Notification>
  </Notifications>
</InsightAgent>
What you will get is the better error handling of the agent, which rollback partial processing. You can add multiple reports to run in sequence. Just remember, one error will rollback all the reports.

After error, you can try and fix the problem and rerun the agent. If the agent run successfully, then rerun is not going to do any processing, since the time table is already with the processing date.

No comments:

Post a Comment

Please keep comments clean at the ClickDev blog.

 
HTML Hit Counter