[Anthill-pro] RE: 3.4.11 and reports [tmon-status: ticketId=1899]
Yanko, Curtis
curt_yanko at uhc.com
Thu Mar 20 11:02:10 CST 2008
Bingo! Thanks.
===
-Curt
W: 860.702.9059
M: 860.881.2050
-----Original Message-----
From: support-bot at urbancode.com [mailto:support-bot at urbancode.com]
Sent: Thursday, March 20, 2008 12:25 PM
To: Yanko, Curtis; anthill-pro at caladin.urbancode.com
Subject: Re: 3.4.11 and reports [tmon-status: ticketId=1899]
Curtis,
We changed the implementation of the getBuildLifeWorkflowSummaries()
series of methods. They do not return inactive build lives now. To
achieve the functionality you had, use the method
getAllBuildLifeWorkflowSummaries().
Ryan
Yanko, Curtis wrote:
>
>
>
>
> Meta-Data:
>
> import com.urbancode.anthill3.domain.project.*;
> import com.urbancode.anthill3.domain.reporting.*;
>
>
> ReportMetaData rmd = new ReportMetaData();
>
> // Add some parameters to the report
> SelectParamMetaData params = new SelectParamMetaData();
>
> Project[] allMyProjectsArray =
> ProjectFactory.getInstance().restoreAllActive();
> String[] labels = new String[allMyProjectsArray.length + 1]; String[]
> values = new String[allMyProjectsArray.length + 1]; for (int i = 0; i
> < allMyProjectsArray.length; i++) {
> labels[i] = allMyProjectsArray[i].getName();
> values[i] = allMyProjectsArray[i].getId().toString();
> }
> labels[allMyProjectsArray.length] = "All";
> values[allMyProjectsArray.length] = "all";
>
> params.setLabels(labels);
> params.setValues(values);
> params.setName("project");
> params.setLabel("Project");
> params.setDescription("Select the project to evaluate successful and
> failed executions of that project. Or select ''All'' to display all
> projects together.");
>
>
> // rmd.addParameter(params);
>
>
> // Configure columns
> rmd.addColumn("Sep");
> rmd.addColumn("Oct");
> rmd.addColumn("Nov");
> rmd.addColumn("Dec");
> rmd.addColumn("Jan 08");
> rmd.addColumn("Feb");
> rmd.addColumn("Mar");
> rmd.addColumn("Apr");
> rmd.addColumn("May");
> rmd.addColumn("Jun");
> rmd.addColumn("Jul");
> rmd.addColumn("Aug");
>
> return rmd;
>
>
> Script:
>
> import com.urbancode.anthill3.dashboard.*;
> import com.urbancode.anthill3.domain.reporting.*;
> import com.urbancode.anthill3.domain.userprofile.*;
> import com.urbancode.anthill3.domain.workflow.WorkflowStatusEnum;
> import java.util.*;
>
> // Get the timezone for the current user TimeZone timeZone =
> UserProfileFactory.getTimeZone(); Calendar cal =
> Calendar.getInstance(timeZone);
>
> //Set up fields for first and last day of the year Calendar cal =
> Calendar.getInstance(); cal.setTime(new Date());
> int firstDay = cal.getMinimum(Calendar.DAY_OF_MONTH);
> int lastDay = cal.getMaximum(Calendar.DAY_OF_MONTH);
> //int year = cal.get(cal.YEAR);
> Date startDate = new java.util.Date(107, Calendar.SEPTEMBER,
firstDay);
> Date endDate = new java.util.Date(108, Calendar.AUGUST, lastDay);
>
> // Get workflows
> BuildLifeWorkflowCaseSummary[] summaries =
> DashboardFactory.getInstance().getBuildLifeWorkflowSummaries(null,
> startDate, endDate);
>
> int janCount = 0;
> int febCount = 0;
> int marCount = 0;
> int aprCount = 0;
> int mayCount = 0;
> int junCount = 0;
> int julCount = 0;
> int augCount = 0;
> int sepCount = 0;
> int octCount = 0;
> int novCount = 0;
> int decCount = 0;
>
>
> int failedJanCount = 0;
> int failedFebCount = 0;
> int failedMarCount = 0;
> int failedAprCount = 0;
> int failedMayCount = 0;
> int failedJunCount = 0;
> int failedJulCount = 0;
> int failedAugCount = 0;
> int failedSepCount = 0;
> int failedOctCount = 0;
> int failedNovCount = 0;
> int failedDecCount = 0;
>
> for (int i = 0; i < summaries.length; i++) {
> Calendar tempCal = (Calendar) cal.clone();
> tempCal.setTime(summaries[i].getEndDate());
> boolean failed = (summaries[i].getStatus() ==
> WorkflowStatusEnum.FAILED || summaries[i].getStatus() ==
> WorkflowStatusEnum.ERROR);
>
> int dow = tempCal.get(Calendar.MONTH);
> switch (dow) {
> case Calendar.JANUARY:
> if (failed) failedJanCount++; else janCount++;
> break;
> case Calendar.FEBRUARY:
> if (failed) failedFebCount++; else febCount++;
> break;
> case Calendar.MARCH:
> if (failed) failedMarCount++; else marCount++;
> break;
> case Calendar.APRIL:
> if (failed) failedAprCount++; else aprCount++;
> break;
> case Calendar.MAY:
> if (failed) failedMayCount++; else mayCount++;
> break;
> case Calendar.JUNE:
> if (failed) failedJunCount++; else junCount++;
> break;
> case Calendar.JULY:
> if (failed) failedJulCount++; else julCount++;
> break;
> case Calendar.AUGUST:
> if (failed) failedAugCount++; else augCount++;
> break;
> case Calendar.SEPTEMBER:
> if (failed) failedSepCount++; else sepCount++;
> break;
> case Calendar.OCTOBER:
> if (failed) failedOctCount++; else octCount++;
> break;
> case Calendar.NOVEMBER:
> if (failed) failedNovCount++; else novCount++;
> break;
> case Calendar.DECEMBER:
> if (failed) failedDecCount++; else decCount++;
> break;
> }
> }
>
> ReportOutput output = new ReportOutput(metaData);
>
>
> ReportRow row = new ReportRow(output, "Failed");
> row.setColumnValue("Jan 08", failedJanCount + "");
> row.setColumnValue("Feb", failedFebCount + "");
> row.setColumnValue("Mar", failedMarCount + "");
> row.setColumnValue("Apr", failedAprCount + "");
> row.setColumnValue("May", failedMayCount + "");
> row.setColumnValue("Jun", failedJunCount + "");
> row.setColumnValue("Jul", failedJulCount + "");
> row.setColumnValue("Aug", failedAugCount + "");
> row.setColumnValue("Sep", failedSepCount + "");
> row.setColumnValue("Oct", failedOctCount + "");
> row.setColumnValue("Nov", failedNovCount + "");
> row.setColumnValue("Dec", failedDecCount + ""); output.addRow(row);
>
> ReportRow row = new ReportRow(output, "Successful");
> row.setColumnValue("Jan 08", janCount + ""); row.setColumnValue("Feb",
> febCount + ""); row.setColumnValue("Mar", marCount + "");
> row.setColumnValue("Apr", aprCount + ""); row.setColumnValue("May",
> mayCount + ""); row.setColumnValue("Jun", junCount + "");
> row.setColumnValue("Jul", julCount + ""); row.setColumnValue("Aug",
> augCount + ""); row.setColumnValue("Sep", sepCount + "");
> row.setColumnValue("Oct", octCount + ""); row.setColumnValue("Nov",
> novCount + ""); row.setColumnValue("Dec", decCount + "");
> output.addRow(row);
>
> return output;
>
>
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity
> to which it is addressed. If the reader of this e-mail is not the
> intended recipient or his or her authorized agent, the reader is
> hereby notified that any dissemination, distribution or copying of
> this e-mail is prohibited. If you have received this e-mail in error,
> please notify the sender by replying to this message and delete this
e-mail immediately.
>
>
--
===========================================================
Ryan Smith. 2044 Euclid Ave., Suite 600
Developer Cleveland, Ohio 44115
Urbancode, Inc.
email: rws at urbancode.com
web: www.urbancode.com phone: 216-858-9000
web: www.anthillpro.com fax: 216-858-9602
===========================================================
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
More information about the Anthill-pro
mailing list