AIMDOCS
AIMDOCS
AIMDOCS
Module PortfolioModelQuery
Module PortfolioModelRules
Module PortfolioModelQuery
Deprecated Methods
Method Comments
Module PortfolioModelRules
Deprecated Interfaces
Interface Comments
Deprecated Classes
Class Comments
Deprecated Methods
Method Comments
The ComponentsHelper is ready to use strings instead of the old SoftwareType / ComponentType objects.
If you want to adapt your rules, just import Types class and replace Software.SoftwareType / Component.ComponentType with
Types.SoftwareType / Types.ComponentType.
It is possible that these types were used in comparisons: you need to change == by equals():
Example
// replace:
if (candidateWin.getComponentType () == Types.ComponentType.WINDOW) ...
// by:
if (Types.ComponentType.WINDOW.equals (candidateWin.getComponentType ())) ...
Relations
There is only one type of relationship: ApmRelation. Change all the uses of **Relation to *ApmRelation (this class is in the same
package).
Entities
The meta-model entities (Software, Component, Person, Unit ..) are now interfaces, so the main difference with the old version is that
they cannot be instantiated directly.
Many search methods have been now removed from these interfaces, and some have been maintained, moved to
com.optimyth.apm.util.queries package.
Example
calledFNG.getChildComponents()
Softwares.getChildComponents(calledFNG)
Collections (IMPORTANT)
This is the most frequent use, and - as you can see - this is just java5 makeup.
Anyway this is an important change, you don't have size() method anymore. For those cases where is absolutely unavoidable, you can
use count* methods:
ApmEntity.countLinks();
ApmEntity.countOutgoingLinks();
ApmEntity.countIncomingLinks();
IQueryEngine.countLinkedEntities();
IQueryEngine.countDirectLinks();
PropertyDefinitions
Creating entities
As before, all rule callbacks (RuleCallback class) have a getter getHelper() which provides you with a ComponentHelper, the main
class for entities creation in any AIM model.
This last note is very important: try reusing the existing methods will give the final model a semantic much easier to
understand: using general concepts as program fits with a javascript snippet or a cobol application, and is reused in
AIM product's rules. In this example, language property will be enough to distinguish those programs. Another
example would be c#, c++ and java classes: they are all class components.
A normal tendency would be calling web page "webPage". Instead, this is modeled as "page". The concept of "page"
can be re-used by any other document-oriented language... in the same way, "window" is general enough to model
oracle forms, visual basic forms or abap screens. This makes querying with AQL much easier, because it's more
intuitive filtering datasets than aggregating.
Of course all these considerations on model's semantic are just a suggestion given by Optimyth's experience, but they
can be adapted to the customer's needs.
As Component is now an interface, you cannot use new Component(...) anymore... so, thi would be the low-level translation of "new
Component", using IApmModelFactory:
Example
if (dataArea == null) {
dataArea = new Component(key, dataAreaName);
dataArea.setDescription("Data area "+dataAreaName);
dataArea.setComponentType(DB_OBJECT);\\
getBuilderContext().getPortfolioModel().addComponent(dataArea);\\
} else {
purgeRelations(dataArea);
}
return dataArea;
}
} else {
purgeRelations(dataArea);
}
return dataArea;
}
IMPORTANT
As a general rule, you SHOULD NOT use low-level entity creation (modelFactory.createEntity()) which is documented
here, try to use ComponentsHelper methods whenever is possible.
Properties
PropertyDefinition(s) are created in the same way (via constructor), with the only change that PID (first argument) has been
removed (the property name is now the property's key).
That is:
Creating PropertyDefinition...
As Property is now an interface, you must use a factory (IApmModelFactory) to create it:
Creating Property...
IMPORTANT
As property values??, you must use only primitive types (strings, int, etc...) or arrays of primitive types.
Tags
Good practice
Wherever you can, use ComponentsHelper methods:
Set<String> tag (ApmEntity entity, String tag)
Set<String> tag (ApmEntity entity, String ... tags)
For more complex operations, there is a utility com.optimyth.apm.util.TagUtils containing methods for dealing with these
Set<String> of tags.
Artifacts
The class Artifacts has been removed, artifacts are now stored in List<String>. There is also an utility
com.optimyth.apm.util.ArtifactsUtil, which offers some methods to deal with filepaths, normalization etc...
Good practice
Wherever you can, use these ComponentsHelper() methods
Removing Artifacts instantiations
Home
Navigation
checKing AIM provides a corporate view of an enterprise’s software assets allowing this information to be accessed at different levels.
From a single program or file up to the IT infrastructure resource usage level. checKing AIM helps customers to understand the
complexity of their software systems and their relationships, simplify its management and to make the best tactical and strategic
decisions.
Through its advanced technology, checKing AIM builds the foundation for modernisation initiatives imposed by external forces such as:
Automatically build a map of the software systems in hierarchical form, from an organisational level down to the lowest level software
component;
Understand in real time the correlation between the software components;
Execute impact analysis for regular maintenance activities (planning, change requests and implementation of new functionalities)
based on factors such as costs, resources and technical complexity etc;
Evaluate the effects associated with the implementation of new specifications;
Offer several alternatives to the systems change requests;
Analyse cost mitigation;
Establish cost/benefit analysis that allows project or application comparisons based on either predesigned Quality Models or the
customer’s own models;
Help simplify and consolidate the IT environment whilst identifying the value areas within the application portfolio.
Risk Management: The huge variety of technologies, architectures, languages and systems that make up the enterprise application
portfolio are recognised and documented thus reducing the risks associated with changes and updates;
Simplicity: checKing AIM helps reduce the complexity of the application portfolio and of the applications themselves;
Assets Classification: checKing AIM enables the classification of software assets helping to align the applications with the business
process and the business units that depend on them;
Productivity: checKing AIM increases the productivity during the development and maintenance stages;
Outsourcing Management: checKing AIM offers the ability to efficiently manage the knowledge transfer process. It can generate,
consolidate and provide the documentation of the complexity and the value of the applications thus reducing unexpected difficulties;
Change Management: checKing AIM offers impact analysis to determine which systems will be affected by changes and to
drastically reduce regression issues.
Introduction
checKing AIM consists of a collection of plug-ins and JNLP. They are as follows:
APMMETRICS plug-in: This plug-in computes metrics on APPMAP models extracted using rules that will navigate the model and
derive measures for different metrics. These metrics can be viewed with specific panels in checKing. See the APMMETRICS plug-in
manual for further details;
APPMAP Browser: A JNPL application launched from a panel that creates a global view modelling relationship among different
concepts within a corporation. See the APPMAP Browser manual.
checKing AIM creates a global view modelling relationship among different concepts within a corporation: logical structures (programs,
applications, routines and web services etc.) and physical structure (organisational units, departments and staff etc.). All these elements
are graphically represented, so that the user can easily use this model for the purpose of impact analysis. Which web service is related
to which business process? What will cause a change in a specified element in the company's structure?
Moreover, checKing AIM assigns different tags to these modelled concepts. Thus, the user can differentiate between owners and other
categories. These tags can be propagated, by the user automatically, from certain artifacts by specified rules.
The model is displayed in tree and graphical form, see figure 1. The Model tree shows a hierarchy of relationship among different
concepts within a corporation while the Node's Graph and Properties shows a graphical representation of the node/entity selected from
the Model tree and the entities connected to that node.
The icons used to represent the entities in the Node's Graph and Properties are customisable.
Application Discovery
The Application Discovery and Inventory Management technologies of checKing AIM enables automatic validation of predefined or
proprietary architecture through its customisable rules extraction engine. It also offers software system information capture and
correlation such as:
checKing AIM creates a global view which models relationships among different concepts within a corporation. These concepts are
physical structures such as programs, applications, routines and web services and logical structures such as organisational units,
departments and staff. All these structures are represented graphically, thus making it easy to generate a model for the purpose of
impact analysis.
checKing AIM assigns different tags to each modelled concepts, allowing the user to differentiate between owners and other categories.
These tags can be propagated to different elements within the model automatically, based on specified rules.
APPMAP provides a dependency analysis script that can be scheduled or launched from the checKing administration interface. The
script uses a set of configuration files (based on the Spring framework) that specifies the extraction, tagging and validation rules (and
their configuration) applicable, the filters on source files, and the source directories to analyse.
The outputs from the analysis script are a dependency model and a report. The report shows the artifacts and dependencies, and the
classification tags for each matching artifact. Details of architectural validations are also shown. Output is generated in the directory
$CHECKING_HOME/plugindata/appmap/PROJECT.
Analysis rules
The analysis rules are a set of rules that are applied in each analysis and they are configurable by Spring files. There are two types of
rules, defined by their scope:
Local rules
Local rules are invoked on every source code artifact processed (that matches the rule filter). The rule operates locally, deriving
model entities and relationships from parsed representation (AST) of source code.
The rule logic is normally implemented in the void visit(BuilderContext) method.
Global rules
Global rules operate once all the source code files are processed (by local rules), in order to resolve global dependencies that
require that the artifacts are resolved by local rules. For example, inheritance dependencies need to know the component for
supertypes.
The rule logic is normally implemented in the void postProcess(BuilderContext) method.
There are four kinds of rules according to their purpose: extraction rules, validation rules, tagging rules and export rules.
Extraction rules
These rules are defined in an XML file that is firstly referenced in the apm-modelbuilder.xml file. A suggested name for the XML file is
apm-rules-extraction.xml. The purpose of the extraction rules is to analyses the source code in order to identify and insert into the
model all components (artifacts) and relationships (dependencies).
Validation rules
These global rules analyse the full model in order to identify architectural violations and to generate an HTML report with all violations
found. These rules are defined in the file apm-rules-check.xml.
Tagging rules
Such rules bear responsibility for propagating the classification tags to elements. These rules are defined in the apm-rules-tagging.xml
file.
Export rules
Such rules export a CSV file with useful information extracted from the model. These rules are defined in the apm-rules-tagging.xml
file.
Model tree
The Model tree is a representation of the modelled structure. Figure 2 shows an example of this structure.
Analysis Workflow
The dependency analyser operates according to the following workflow, see figure 3:
1. Configuration is loaded.
a. The initial model (if specified, for example in delta analysis) is loaded by persistence managers. If no initial model is
specified. An empty model is created.
2. Every rule is initialised (invoking its initialize(BuilderContext) method).
3. For each rule matching its filter, the visit(BuillderContext) method is invoked.
4. The postProcess(BuilderContext) on each rule is invoked.
5. The output reports (HTML, XML and TXT) are generated and the model built is persisted using the registered persistence manager,
see the section The Persistence Model.
Containers, entities and relationships are ApmAtom, the top-most type in APPMAP model. ApmAtom may have arbitrary Property
beans. There are some special properties: Artifacts (models the files that make-up a portfolio entity), and Tags (multi-valued sets of
‘attributes’ that classify any entity in the model). Every entity in the model has a unique key (unique name, DN)
Figure 4: Appmap meta model
One ApmRelation bean for any (two-fold) relationship between two entities (left and right). Containers, entities and relationship are
ApmAtom, the top-most type in APPMAP model.
How to map any item in your organisation or software architecture to a meta-model bean, and their dependencies as meta-model
relationships
What namespace to use for defining the unique key
What properties shall be added to the entities
How to map software artifacts to entities
How to add tags for classifying entities
Once the model is defined, you can proceed with other tasks:
Rules Development
Rules are developed for application portfolio extraction from code and other artifacts. The Application Portfolio provides an extensible
framework for automated extraction of entities (software-related and organisational) and their relationships, for compilation of an
application map, to be used by different checKing plug-ins.
The framework is based on a set of BuilderRules, that may perform different tasks:
To create portfolio entities (software-related or organisational) and resolve their mutual relationships;
To check if the software artifacts are compliant with architectural standards;
To detect potential architectural antipatterns (‘smells’);
To resolve the group of code artifacts that are logically related to software entities in the application map, for later analysis.
A BuilderRule is a unit of logic that may perform any of the above tasks.
Useful manuals
Manual Description
XXX DESC
Glossary of terms
Artifacts models the files that make-up a portfolio entity The persistence The model that persists the data.
model
Tags multi-valued sets of ‘attributes’ that classify any BuilderRules The builder rules are used to extract data from the
entity in the model code and other artefacts.
DN A unique key that every entity is given. Meta Model The meta model models the organisational structure
and its entities.
APPMAP plugin
Purpose
How it works
Installation
Scripts
Panels
Purpose
This plug-in creates a global view modelling the relationships among different entities within a corporation: logical structures (programs,
applications, routines and web services, etc.) and physical structure (organisational units, departments and staff, etc.). All those
elements are represented graphically, so the user can request this model to make impact analysis. Which web service is related to which
business process? What effects will cause a change in a certain element in the company's structure?
How it works
There is a general generic model which is used as framework to develop a custom model builder for each company. Each company has
different ways to provide the necessary information needed to build the global model. This includes: organizational model (XML files),
code (java classes, jar files, Cobol programs and SQL scripts, etc.). Specific "extracting rules" are designed for each client and a final
custom library is given along with the plug-in. The analyse script will build the model each time the administrator wants to reflect changes
in the organisation.
You can learn more about AQL in the APPMAP Query Language (AQL) manual.
Installation
First of all, you need to deploy APPMAP following the standard instructions from checKing Plug-in's Installation Guide.
This plug-in is configured by default with the company's specific characteristics, as each company has a different organisational structure
or business requirements. It is supposed that the plug-in will be fully functional when deployed within client's distribution.
However there are a certain amount of configuration files that might be edited to reflect changes in the company (e.g. addition of new
folders and changes in databases etc).
Scripts
Once you have installed APPMAP and the configuration files are ready to use, you would typically want to perform an analysis of your
system.
The script APPMAP/script/analyze analyses the organisation and their applications, extracting entities and relationships between
them. The rules defined in configuration files decide which entities should be included and their structure. Finally, an APPMAP model
is built and saved. Check on its own page for details.
Or if you already have an APPMAP model built, you may want to update the checKing projects tree with information about all software
entities found by this plug-in.
The script APPMAP/script/syncSoftware synchronise software elements contained in the APPMAP model with checKing current
projects, creating and/or updating when necessary. Check on its own page for details.
The script APPMAP/script/exec launches an AppMap script: APPMAP scripts can execute a query, a model transformation, a
validation or a model update. This checKing script is a wrapper for executing them under the checKing system. Parameters are:
operation - The name of the script to execute.
model - A list of models launched previously is shown. Select one.
properties - Input properties to be passed to the script, in format String with PROP=VALUE pairs separated by '|' (pipe)
characters.
configFile - Path of configuration file with properties that will be searched for.
Note: If you want to select a model, please specify only relative path from CHECKING_DATA/plugindata/appmap. For
example: /Name_of_Project/Name_of_Model.
To launch the script diff from checKing interface, enter the second model as a property:
secondModel=/Name_of_Project/Name_of_secondModel.
Before executing AIM TASK - Analyze, you may generate automatically a configuration using the AIM TASK - Configuration
discovery, which could be used as a starting point for a proper configuration for model building.
Panels
This plug-in currently shows one panel with two links for each project being analysed. The first one launches theApplication map
Browser with the selected model, while the second opens a report with the statistics found during the model building process.
Please note that the browser link will open a JNLP application to be run on the client side, and that this might use a large amount of
memory. Check more information in the Application map Browser manual.
Additionally, from the summary link you can open a detailed HTML report with the architectural problems found during the construction of
the application model and a brief summary with specific statistics of the company that is using this plug-in.
Furthermore, Panels APPMAP allows you to open a JNLP application running on the client side without loading any appmap model, by
clicking in visualization link.
APMMETRICS plugin
APMMETRICS Plug-in
Purpose
How it works
Scripts
APMMETRICS/script/analyze
APMMETRICS/script/purge
Panels
Artefacts count table
Artefact count comparison
Pie chart Unresolved / Unreferenced
Pie char for multivalued criteria
Artefacts by Container
Artefacts by Criterium
Time evolution of artefacts
Time evolution for metric
Time evolution of artefacts by criteria
Metric list
Architecture compliance evolution
Architecture compliance index
Architecture compliance table
Architecture violation distribution
Architecture violation evolution
Architecture violations table
Architecture violations, compared
Time evolution of artifacts
Dependencies
Change log
Appendix A - How to add a new metric based on dependencies model
Steps summary
Define the metric and the panels that will convey the information that the metric represents.
Create metric values table(s)
Implement a metric computation rule
Implement metric DAO (and optional querybuilder if needed when metric uses the "tuplets" scheme)
Create panels for rendering data for the new metrics
Deploy your customisations
Appendix B - How to define thresholds for global metrics
Purpose
This plug-in computes metrics on APPMAP models extracted using rules that will navigate the model and derive measures for different
metrics. These metrics can be viewed with specific panels in checKing.
How it works
The plug-in analyze script will execute a metrics computation engine that will perform the following work flow:
The metric provided is Artefacts count, that counts the number of artefacts in an AppModel classified by tuples (set of three) of criteria in
a specific time.
Scripts
This plug-in has two scripts, defined in the plugin-scripts.xml configuration file:
APMMETRICS/script/analyze
This script analyses the specified AppModel, applies the rules defined, obtains the metric Artefact count and saves them within the
persistence manager. It has the following parameters:
project The name of the checKing project associated to an AppModel with the same name. Must be a valid /ChecKing
checKing project.
model.name The name of the AppModel used to count artefacts. If it is not supplied then appmap.model is assumed appModel
APMMETRICS/script/purge
Deletes all data contained in the AppMetrics tables in the checKing database. It does not require any parameters.
Panels
The APPMetrics can display eight different panels that provide a friendly and useful way to show metrics to the user. These are the
available panels:
This panel shows a table with counts of current artefacts for selected model, by specified criteria:
Criteria Description
If a criterion is not specified, it will not be taken into account for filter/grouping. If a criterion is specified as '*', it will be selected for
grouping. If a criterion is specified as a value, it will be selected for filtering on the selected value.
For example, to get the artefact counts for type 'program' grouped by classification tags, select TYPE = 'program', TAGS = '*'
To get the artefact counts grouped by classification tags and type, select TYPE = '', TAGS = ''
In this panel you can see the number of artefacts where the language is Java and grouped by their container. In this type of panel the
first column always shows the total number of artefacts and the second is the relative percent.
This panel shows a spider graph that compares two different models by a defined criteria. This comparison is always made with the
counted metrics in the last execution of the analysing script. It can be used to compare two models of different environments. In this
panel you must specify the two models you want to compare and a comparison criteria (tags, type, subtype and etc.).
This example shows a comparison between two models and the criteria used to compare is type.
In this panel you can see a pie chart showing the relationship between unresolved/unreferenced artefacts with all artefacts of the
specified model. You have to select the model and the criteria (unresolved or unreferenced).
This panel shows the relation between artefacts unresolved and all artefacts for a given model.
This panel shows a pie chart for a selected model where you can see the relationship between artefacts classified by a multivalued
criteria (tags, type and subtype etc. except unresolved and unreferenced). Each slice represents a set of artefacts grouped by the criteria
value.
In this panel you can see how the artefacts are grouped by a specific criteria (in this case the criteria is TYPE)
Artefacts by Container
This chart groups all artefacts by the container criteria and shows all sets as a pie chart.
Here are shown the artefacts grouped by their container
Artefacts by Criterium
This chart groups all artefacts by a previously defined criterium defined in the panel properties.The CRITERIUM property is included in a
list where you can select one grouping CRITERIUM.
In this panel you can see how a model varies its artefacts count over time. To see this chart you have to specify the model you want, the
criteria count and the time range.
In this example the panel shows the evolution of the number of artefacts by language over two days.
In this panel you can see how global metric (a metric that computes a single value for a specific model) varies over time. To see this
chart you have to specify the model you want, the metric and the time range.
In this example you can see the evolution of metric "Architecture Compliance" in the last week.
In this panel you can see how a model varies its artefacts count over time. You can filter the results for a series of criteria that are loaded
dynamically.
In this example you can see the panel and the dynamic properties.
Metric list
In this panel you can see for a given model the last values for global metrics. Some global metrics can have a description that can be
accessed clicking on the icon close to metric name. Some global metrics can have a detailed report that can be shown by clicking on the
metric value.
For some metrics you can define a thresholds value so for metric values outside from those thresholds the value is shown with red color.
This panel shows a graphic for architecture compliance evolution for a model pattern. For each model that matchs with the given model
pattern a line for this evolution is shown.
This panel shows the architecture compliance index for selected model.
Architecture compliance table
This panel shows a table with architecture compliance index for all models that match with the given model pattern.
This panel shows a graph whit architecture violation distribution for selected model and grouped by the selected criterium.
Architecture violation evolution
This panel shows a graph for architecture violations temporal evolution for a selected model, grouped by a criteria and restricted by the
selected data range (if there is no data range, dashboard data range will be used instead).
This panel renders an architecture violations count table for the selected model and filtered by criteria.
Architecture violations, compared
This panel shows a pie chart to compare architecture violatios for two models grouped by selected criteria.
This panel renders a line chart showing time evolution of artefacts, for specified model, grouping by criterium, in the selected date range
(if date range is not explicit, the dashboard date range will be used).
Dependencies
This plug-in needs AppMap plug-in in order to work properly because the artefacts counted are extracted from the models generated
with the AppMap plug-in.
Change log
Version 1.1: First release. Creation of the plug-in to count artefacts and display panels.
This section describes the steps needed to add a new metric derived from dependencies model, using a sample metric for illustration
purposes.
Steps summary
1. Define the metric that you want added to the system, and the panels that will show the measures computed on such metric.
2. Create one or more details table(s) in which to store the historical measures derived for the metric.
3. Implement a metric computation rule, that will compute current metric values for current dependencies model/analysis reports.
Register it under the metrics-rules.xml descriptor.
4. Implement a DAO class for storing/deleting the data values and for fetching data matching defined criteria, and register it under
metrics-persistence.xml descriptor.
5. Create panels to show the metric values filtered/grouped by user parameters, and add them to the plugin-panels.xml
descriptor.
It is recommended to separate custom bean definitions from the plug-in's included configuration. You may use a
metric-custom.xml descriptor for rule, metric definition and DAO configurations (for metric computation engine),
and plugin-custom.xml descriptor for panels, views and datasets (for panel rendering).
This separation facilitates upgrading the plug-in without overwriting your custom metric configurations.
We use the following use-case: "Add support for a model violations count metric" in what follows.
Define the metric and the panels that will convey the information that the metric represents.
To count the number of violations of architecture-validation rules emitted during analysis, categorised by violation type and severity.
The metric computation will evaluate a global index that will show the compliance level with the architectural rules defined for the
analysis.
Panels will show the number of violations, grouped by severity and/or violation type:
Current values for a specified model (for a system, application and environment etc.), and the global compliance factor.
Time-evolution of the metric for a specified model, grouped by severity and/or violation type.
Comparison of the metric for two models, again grouped by severity and/or violation type.
Similar panels for the derived compliance level metric.
Compliance factor will be computed as the density of violations weighted by its severity and divided by the number of artefacts in the
model. It will be computed by the formula:
Remember that the master table APMMETRICS_EXECS contains a row for each metrics analysis on the given MODEL at EXEC_DATE. Its
primary key ID_EXEC will be used by the metric table to refer to the execution of the metric computation rules for the given MODEL and
EXEC_DATE.
We want to store for the analysis execution ID_EXEC both the index (compliance factor, a number) and the violation counts, by rule, type
and severity. Such information can be conveyed in the following tables and auxiliary views:
Table definitions for the metric
Database normalisation issues aside, the example defines two tables for storing the confidence factor and the violations count
decomposed into rule, rule category and rule severity, and two views to simplify getting current (last) values for both confidence factors
and violations count grouped by category and severity.
For the example metric the computation logic will use the following strategy:
1. From the input parameters (project, model.name and environment), it parses the analysis report (XML file) that conveys the
violations detected by the dependencies validation rules;
2.
2. Counts each violation in a bin made-up by a tuplet (RULE, CATEGORY, SEVERITY);
3. Counts the components number from the model (or from the report itself);
4. Evaluates the index using the computation formulae;
5. Adds the two measure types (a single MetricValue for the index and one MetricValue for each bin counting the violations count).
Rule ViolationsMetricRule.java
/**
* checKing - Scorecard for software development processes
* [C] Optimyth Software Technologies, 2009
* Created by: lrodriguez Date: Jan 26, 2010 10:18:54 PM
*/
package com.zurich.apm.aimmetrics.rules;
import com.optimyth.checking.plugin.aimmetrics.rule.MetricRule;
import com.optimyth.checking.plugin.aimmetrics.engine.MetricBuildContext;
import com.optimyth.checking.plugin.aimmetrics.model.Tuple;
import com.optimyth.checking.plugin.aimmetrics.model.MetricValue;
import com.optimyth.checking.plugin.aimmetrics.model.MetricDefinition;
import com.optimyth.checking.plugin.aimmetrics.MetricConstants;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.Collection;
import java.io.File;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
/**
* ViolationsMetricRule - Computes values for two metrics: violationCount (grouped by RULE,
CATEGORY, PRIORITY)
* and complianceIndex (a 0-100 index measuring the global compliance).
*
* @author <a href="mailto:lrodriguez@optimyth.org">lrodriguez</a>
* @version 26-01-2010
*/
public class ViolationsMetricRule implements MetricRule {
/**
* Parses the build-generated XML report to fetch the violations detected in last model
analysis.
* Produce multi-valued measures for violationCountMetric (one value for each tuple
{RULE,CATEGORY,PRIORITY})
* and a single-valued measure for complianceIndexMetric.
*
* @param ctx
*/
public void fetch(MetricBuildContext ctx) {
Map<Tuple, MetricValue> metrics = new HashMap<Tuple, MetricValue>(100);
try {
Document doc = parseReport(ctx);
int numComponents = ctx.getModel().getPortfolioModel().getComponents().size();
@SuppressWarnings({"unchecked"})
List<Element> violations = (List<Element>)doc.getRootElement().element("archvViolations"
).elements("violation");
countViolations(violations, metrics);
double complianceIndex = computeComplianceIndex(metrics.values(), numComponents);
} catch(DocumentException de) {
throw new IllegalArgumentException("Report file for model "+ctx.getModelPath()+" does not
exist");
}
Implement metric DAO (and optional querybuilder if needed when metric uses the "tuplets" scheme)
Sample ViolationsMetricDao
/**
* ViolationsMetricDao - Inserts/deletes violatonsCount measures on APMMETRIC_VIOL_DETAIL
*
* @author <a href="mailto:lrodriguez@optimyth.org">lrodriguez</a>
* @version 27-01-2010
*/
public class ViolationsMetricDao extends AbstractMetricDao {
private static final String SQL_INSERT = "INSERT INTO APMMETRIC_VIOL_DETAIL
(ID_EXEC,RULE,CATEGORY,SEVERITY,NUM_VIOL) VALUES (?,?,?,?,?)";
private static final String SQL_DELETE_WITH_FILTER = "DELETE FROM APMMETRIC_VIOL_DETAIL WHERE
ID_EXEC IN (SELECT ID_EXEC FROM APMMETRICS_EXECS WHERE ";
private static final String SQL_DELETE_WITH_ID = "DELETE FROM APMMETRIC_VIOL_DETAIL WHERE
ID_EXEC = ?";
public void insert(MetricValue value, int execId, JdbcTemplate tpl) throws DaoException {
if( accept(value.getDefinition()) ) {
Tuple tuple = value.getTuple();
tpl.update(SQL_INSERT, new Object[] {execId, tuple.getProperty("RULE"), tuple.getProperty(
"CATEGORY"), Integer.parseInt((String)tuple.getProperty("SEVERITY")), (int)value.getValue()});
}
}
public void delete(String filter, Object[] parameters, JdbcTemplate tpl) throws DaoException {
tpl.update(SQL_DELETE_WITH_FILTER + filter + ")", parameters);
}
To register the new metrics (here we call them violationsCount and complianceIndex):
Configure the metric definitions, DAOs and computation rule in the metrics-custom.xml descriptor:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
</beans>
You should declare your panels (and supporting datasets/views) according to the [checKing plug-ins development guide] provided with
checKing.
As an example, we show how to configure a tabular panel (for the violationsCount metric) and a meter panel (for the
complianceIndex metric):
Place your implementation classes in a JAR under PLUGIN_DIR/lib, plugin-custom.xml in PLUGIN_DIR and
metrics-custom.xml in PLUGIN_DIR/scripts/resources, and restart the plug-in (using the administrative plug-in tab).
Now you may launch the analysis script (that will execute your custom metric rules), and place your custom panels in checKing
dashboards.
In order to define the thresholds you have to define a metafile whith the format:
beanName.*.*:operator value
the characters .*.*: that follows the bean name are mandatory.
APMMETRICS/metric/stabilityIndex.*.*:>95.00
APMMETRICS/metric/fragilityIndex.*.*:>95.00
APMMETRICS/metric/stabilityIndex.*.*:>97.00
This example establish the normal values for each metric. For example, if the fragility index for a model takes a value equals 90.0, it's
out of the normal value (>95.00) so it should be rendered in a different formal, usually in red color:
And in your metric_models.xml you have to be defined the above metrics, as you can see in the following example
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean name="APMMETRICS/metric/stabilityIndex" class=
"com.optimyth.checking.plugin.aimmetrics.model.MetricDefinition">
<property name="name" value="Stability Index for model / components" />
<property name="description" value="% of incoming relations from other software components"
/>
</bean>
</beans>
At last in metric_rules.xml you can define the rules that computes the metrics:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
</beans>
Overview
The APPMAP Analyse Task launches the ANT script that invokes the whole process of model-building. If the script is properly configured
it also inserts the results of the global analysis in the DBMS (if the database scheme has been created).
Configuration
Configuration is done in the apm-modelbuilder.xml file and all its dependencies use the configuration files mentioned before as
templates for your own configuration and upload them as project's configuration files (check the process in the APPMAP plugin manual).
However, a few features are customisable via the task properties.
Task properties
Name Description
project The checKing project name. This will be used to set the output model location and to retrieve the associated
configuration files. It is the only mandatory parameter because the task must retrieve the configuration from the
checKing project.
src.dir Use this property to set several paths containing the files to analyse, using semi-colons to separate the list of files. If you
leave this field blank, the source paths will be taken from the configuration files. If neither this field is filled nor the
configuration files have source paths set, the task will use checKing project's path property instead.
model.name With this property you can set the serialised model file name.
environment Represents the project environment. This environment will be set as AppMap models. Its name will be used to retrieve
the correct configuration files and it will be appended to the end of the file model.name task property.
initial Set this property if you want to perform an incremental build using an initial serialised model. Entities and dependencies
discovered will be added to and/or updated in that model. The initial model's full name will be resolved following the
same process as for the final model built.
noBackup Whether enable or disable backup of the model (default value is false). NB: Be aware this won't generate model
backup, so user is responsible of any impact on the processes on final users
delta Whether incremental update is strictly incremental, or it should be looking for components removed (default value is
false).
scm Behaves like delta analysis (and alternative to it), but requires a changelog file: scm.changelog.xml. See
Incremental analysis
encoding Default encoding to use when loading files for analysis. You can define a specific encoding for a particular
QakingFileParserAdapter (apm-modelbuilder.xml). The priority is the following:
1. If defined, the encoding specified in the apm-modelbuilder.xml will apply, ignoring this task configuration.
2. If defined, the encoding of this task will apply.
3. If none is defined, UTF-8 will be the default value.
configuration You can choose one of the configurations previously generated through the auto-discovery feature (see ChecKing's
Manual for further information).
Configurations generated through the auto-discovery feature (configuration parameter) prevails over manual
configurations (configuration files associated to project).
The initial serialised model's have to be on the same project.path of the final model. This fact will prevent from errors
building incremental model.
Be aware that if noBackup is enabled it won't generate any model backup, so user is responsible of any impact on the
processes on final users. Also be aware if user try to work in local mode.
To customize properties of the APPMAP plugin JKQA will copy the file qaking.configuration.properties in the
directory ${CHECKING_DATA}/config/plugins/APPMAP and modify the properties that it deems appropriate.
In case that this file does not exist, the file that is loaded by default is what is found in ${JKQA_HOME}/bin
Results
You can now launch the AppMap Browser and navigate through the model, perform queries or impact analysis (see AppMap Browser),
or launch the synchronisation script (see APPMAP/script/syncSoftware script).
Incremental analysis
Incremental analysis has three different modes: none, delta and scm, with slightly different implementations.
If you don't specify delta nor scm (in the task's panel this is indicated by delta.mode=- ), the most simple incremental analysis is
performed.
The initialModel is copied, and all src.dirs are analyzed, adding those changes to model. No component of the original model is
removed.
This mode is meant to split the analysis of a big software with repeated sub-model. Let's call it a " spacial increment".
Note Please take into consideration that src.dir must not be contained in the initial analysis directory, and use a
different location for sourcode to be analized on this incremental analysis.
Example: there is a project, composed by three big isolated applications A, B and C, plus a shared database D.
A common approach for modeling this situation is preparing D as a standalone model (normal analysis), and then create an incremental
analysis for each application, resulting in the following models: A+D, B+D, C+D.
If we know that the applications are isolated (a part from the use of shared resources such as a database), this is the suggested
approach, because we can see all the important dependencies, while reducing the volume of the final models. The tradeoff is that any
impact analysis starting from a shared object (belonging to D), must be repeated in every model (A+D, B+D and C+D).
Delta
If you specify delta=true (delta.mode=delta in the task's panel), the initialModel is copied, and all src.dirs are analyzed,
applying those changes to the model. This mode is suitable for adding those differences to an existing model, performing a "increment in
time" analysis.
1. (optional) If present, all deleted files found in scm.changelog.xml, will be first removed from the model
2. All new files are added to the model
3. For those re-analyzed component, outgoing relations are updated, removing those that are not present anymore and adding new
ones.
Example: A big application 'A', is analyzed once, creating an initial model. Every night, every change that has been made during that
day is added to a <YYYYMMDD> folder by an automated script. That folder contains then only the changed files.
YYYYMMDD is the src.dir of that day, and the initial model is the previous day's model.
Note that is is different from incremental mode, because while there we had a spacial partition (every analysis is
meant to be just additive), here we have a timeline, therefore we can (and usually do) analyze the same file which has
changed in time.
Note change log file must be named scm.changelog.xml, and must be placed on analysis directory src.dirs.
Please see example of changelog file below.
SCM
You can specify the scm=true parameter, allowing a different approach to AIM file analysis. If you use a source control management
system, you are used to have your local source replaced by the revision you want to work on. Well, here we're talking about the same
philosopy.
Using checking's SCM plugin, you can update your local copy, and then analyze it with AIM. A special changelog file (
scm.changelog.xml) will be produced by that plugin under project's root dir, and the files under analysis will be just those indicated
by that changelog.
Note also that src.dir is ignored if it is the same as above: the AIM model knows which are the base directories, and
this task re-analyzes them, taking in consideration scm.changelog.xml
Note change log file must be named scm.changelog.xml, and must be placed on analysis directory src.dirs.
Please see example of changelog file below.
Example of SCM change log file
Purpose
This document is a quick guide to understanding and customising the synchronization between APPMAP plug-in and checKing. This
task is meant to export all the information from the APPMAP model to checKing projects.
Upon selection of this task in the checKing scheduler, the usual panel will pop up. Properties for this task are:
appmapModel: The path of the APPMAP serialised model to be synchronized. The default value is
${plugindata.dir}/appmap.h2.db;
updateExisting: Indicates whether synchronization must update existing checKing projects or not. The default value is false;
copyFiles: Indicates whether the APPMAP artefacts must be copied or not. The default value is false;
targetPath: If copyFiles is set to true, this will be the path folder into which the APPMAP artefacts will be copied. The default
value is ${CHECKING_SRC}.
synchronization scripts
There are two main scripts which configure synchronization, run-apm-synchronization.xml and apm-synchronizer.xml, both of them are
located in the ${plugin.dir}/scripts folder.
This script can be executed from both checKing tasks scheduler, as explained before, and from the command line. To execute from the
command line just launch the script as a normal Ant script. You can specify your own arguments using the -D option.
Example:
Memory requirements
Because the APPMAP model might need a lot of memory, you can modify this script to be executed in a forked JVM with your own
memory restrictions (this is the default configuration). The <sync.task> argument fork lets you decide between the same JVM or a
new one, and <jvmarg> elements control the memory restrictions:
run-apm-synchronization.xml
[CHKM:...]
<sync.task
appmapModel="@{appmapModel}"
targetDir="@{targetDir}"
updateExisting="@{updateExisting}"
copyFiles="@{copyFiles}"
classpathref="sync.classpath"
fork="yes"
>
<jvmarg value="-Xms192m"/>
<jvmarg value="-Xmx192m"/>
<jvmarg value="-Xss256k"/>
</sync.task>
[CHKM:...]
</project>
A persistence manager.
An item DAO (Database Access Object).
A project converter.
This element is used to retrieve and load an APPMAP model. The default manager loads the model and deserialises it from the file set
as the file bean property.
This element is used to retrieve the projects from checKing. The default item DAO is the XML implementation.
com.als.checking.model.project.XmlItemDao
com.optimyth.checking.plugin.appmap.script.BasicProjectConverter
com.optimyth.checking.plugin.appmap.script.HierarchicalProjectConverter
Project converters
The project converter selected in apm-synchronizer.xml defines how the synchronization will behave when an APPMAP software entity
is found. There are several cases:
Default strategy for mapping between APPMAP software entities ("bean" in what follows) and checKing (software) items ("item" in what
follows).
If flag updateExisting is true, existing items will be updated with bean information (if false, existing items will be kept
unmodified).
appmapKey and swType properties will be added to item as user properties from the bean's key and softwareType
properties.
The item mailing list will be extracted from the Person's email p where p is each Person related to a bean.
The path property will be derived from a bean's artefacts property, as concatenation of
/BASEDIR_PATH/RELATIVE_PATH, where BASEDIR_PATH is one of the directories where the APPMAP analysis started,
and RELATIVE_PATH is the largest path substring not containing wildcards .
If copyFiles is true, the item path will be targetPath/projectPath/RELATIVE_PATH, where targetDir is specified in task
configuration, projectPath is an item's name and RELATIVE_PATH is computed as before. Files matching the item pattern will be
copied from the APPMAP analysis area to the item path.
In order to load the APPMAP model, appmapModel argument will be used to set the ApmPersistenceManager's file using reflection. If
the manager does not use a file, its own behaviour would take place instead.
For each piece of software found in the APPMAP model, it uses only its own artefacts. If that software does not have any, then the
checKing project will not have files associated either.
For each piece of software found in the APPMAP model, it uses its own artefacts just in case there were not any available. Otherwise, it
collects all the artefacts from its component entities directly associated to it and from its child software entities applying this process
recursively. In other words, a software artefact prevails over those of its components, but the last ones are used in case the software
does not have any.
Overview
APPMAP Browser is a tool used to show an overall view of a certain company. As its name states, it is an application map containing
information about both organizational and logical entities, allowing the execution of queries against the model as well as impact analysis
(e.g. in what way are entities within the model affected by modifying other entities? ).
When clicking on the browser's link in the APPMAP panel, a JNLP application is launched.
JDK version
Since version 2.5.1, the JNLP file specifies that java 1.6+ is required on client side to launch APPMAP browser. This is
the supported and tested version, but this is not strictly necessary: you can try to configure it back to 1.5+, but this is
not the default mode and could originate some minor graphical glitches.
Models from different companies share the meta-model specified in APPMAP. The meta-model structure is the following:
The main container, ApmModel is divided in two secondary containers and contain all the relations between them. Those containers
are:
OrganizationalModel: Contains all the organizational entities and relations between themselves. Represents all the
company's organizational information, like divisions or staff. Those entities are:
Organization: Represents an organization, a company, as its name states; it might be the client's own company or
other partners.
Unit: A type of Organization, each one could represent a company's division or department.
Person: Represents each person of the company's staff, or maybe managers, developers or contacts from other
companies.
PortfolioModel: Contains all the logical entities and relations between them. Represents the company's software
information. Those entities are:
Software: They could be applications or modules used within the company, created by it or by third-parties.
Component: Represents business entities like business processes or business objects etc.
LogicalModel: Contains groups (explicit and dynamic) and their membership relations:
DynamicGroup: A group containing aql or groovy expressions for filter and grouping entities. An ApmEntity can
belong or not to a group. Membership relations are not serialized and must be recalculated every time the model
changes ("classify" operation).
ExplicitGroup: A group where all its members are explicitly specified by the user. Memberships to these groups
are not calculated, so they are stored into the model as "GroupRelation".
Organization - Unit: These relations could be containment relations, because an organization might be divided into several units.
Organization - Person: These relations could be containment relations, because an organization is made up of staff.
Person - Unit: These relations are special relations between a person and a unit (e.g. its manager).
Person - Person: These relations are between people for example between manager, supervisor or partner etc.
Software - Software: These relations are typically a software entity formed by many modules.
Software - Component: These relations may be formed of several components (e.g. database tables and methods), or they are used
in different ways.
Component - Component: These relations relate to components which can be split into other components, or they might
use/call/invoke each other.
Organization - Software: These relations relate to organizations that develop, use or take care of different applications.
Person - Software: However it might be a specific person instead of an organization that is developing, using or taking care of it.
Organizational entity - Component: The same is true of components.
GroupEntity - ApmEntity: These are group membership relations.
Main Elements
APPMAP actions are accesible via the menu bar located at the top of the screen (1), a tool bar located just below the menu bar (2),
and a pop-up menu that is activated by right-clicking on different elements of the browser (tree nodes, table rows or graph's vertices and
edges). A statusbar at the bottom of the window (3) informs about major changes in the state of the browser. Users have at all times a
tree view of current model loaded at his/her disposition (4), which is highly customizable and offers different functionality based on
central tab shown at that time. Central tabbed panel (5) contain main browser's functionality, like navigating through dependencies
graph and performing queries or impact analyses. Each central tab typically has one or more associated tabs located in south tabbed
panel (6).
Central tabs names are editable, just double-click on it, enter a new name and click intro. In addition, you can close
them by pressing the little button next to their name.
Menu Bar
File:
Load Model...: Retrieves available APPMAP models, either from checKing if working in server mode, or from client's file
system if working in local mode.
Work Offline: When working with server models, this option is available in order to download the model and work
autonomously from that moment on.
Preferences: Shows a few customizable options.
Output Console: Shows the application's default output stream.
Disconnect / Connect: If connection with server is available, commutes between server and local (without conection)
working modes.
Quit: Exits the browser.
View:
New Pivotal Graph: Adds new pivotal graph tab.
Properties Table: If tab currently selected is a pivotal graph tab, adds properties tab to its south panel, or shows it already
exists.
Relations Table: If tab currently selected is a pivotal graph tab, adds relations tab to its south panel, or shows it already
exists.
Search:
New Query: Adds new query tab.
New Impact Analysis: Adds new impact analysis tab.
Help:
Help Contents: Opens the PDF documentation in an external reader.
About APM: Shows application's basic information.
Shortcuts
Almost all actions have a combination of key associated, shown right next to its label. Pressing that combination will
trigger its action.
Tools Bar
The main toolbar is just below the menu bar. It contains the following buttons:
Work Offline
This option might interest you because download the model to work offline would mean that you will no longer depend
on server availability.
You can always load the original model at the server again.
Tree View
This view is accessible from anywhere in the browser. It offers a hierarchical view of current model and basic interaction with central
tabbed panel tabs.
The tree tab has its own toolbar, from which you can access some actions related with tree navigation:
Expand all This button will expand all tree paths, showing all its nodes (disabled for big
models for efficiency purposes).
Collapse all This button will collapse all tree nodes expanded at that moment.
Update When toggled down, tree selection will change automatically if navigating
selection through graph.
Sort Sorts the tree alphabetically or logically (default mode, based on the XML
alphabetically configuration file used to render the tree model).
Change view There is a pulldown menu where you can select which view must apply.
pulldown Available views are either collected from client's file system (previously
applied views) if working in local mode, in which case you can add new
views too, or from checKing if working in server mode.
Add to impact analysis. If central tab shown is an Impact Analysis tab, this action add nodes currently selected as impact analysis
sources.
Artifacts. If model's entity has artifacts (source files) associated, this option let you choose one and open it in code viewer (only
available in server mode). See Code Viewer section for further information.
Status Bar
Located at the bottom of the browser's window, this bar will show information about important changes in browser's state. More
specifically, its main function is to show changes in browser's connection state with checKing server.
A Pivotal Graph tab is created by default on browser start-up. You can add several more though the corresponding action of the menu
bar or the tools bar. This kind of tab shows a pivotal entity and its direct relations with other entities.
If you select an entity in the tree view, the tab will display a graph of that entity showing all those entities directly related to it. This can be
configured through graph filters. By double clicking on a node in the graph you can navigate through the model.
The Pivotal Graph tab has its own toolbar, from which you can access some actions related with graph:
Auto-fit Forces zoom on graph in order to see it completely, and take advantage of all space available.
graph
Change Commutes between picking and transforming modes. See picking mode and transforming mode sections for
mode further information.
Apply filter... Create, apply, load or save a graph filter. See this section for further information.
Save graph Pulldown menu that let you export current graph to a image format.
Update When toggled down, graph is updated selection will change automatically if navigating through graph.
graph
Graphs can be filtered, showing only those entities of relevance. In the tools bar you will see a pulldown menu like this one:
A list of preset graph filters will follow, use the pulldown menu to select one:
Second level components: components directly related to current entity (presumably a class), and those directly related to them.
Class hierarchy: up to five levels of inheritance, in both directions, with current entity.
Calls between classes: up to five levels of calls from/to current entity (presumably a class).
Table usages: components performing SELECT, INSERT or UPDATE directly or indirectly on current entity (presumably a database
table).
Graph filter: Allows you to refine the data displayed in the graph.
Go to previous node: Navigates to the previous node in the hierarchy.
Picking mode: Allows the nodes to be moved around the screen.
Transforming mode: Allows the entire graph to be moved.
Show legend: Displays the legend box.
Show graph options: Displays a window detailing the keyboard short cuts for the picking and transform mode.
Artifacts: When right-clicked on an entity, let the user select one if its artifacts to show it in Code Viewer.
This option lets you decide which types of entities and relations are relevant, and the graph's depth (longest path length). A dialogue box
like the following one will be shown:
Entity types: This list contains the entity types discovered within the current model. Select those allowed in the query results.
Relation types: This list contains relation types discovered within the current model. The query results will be those entities with at
least one incident relation whose type were selected in the list.
Depth: This element lets the user decide how far the search should go into entities not related directly with the selected one (the
length of the longest path from the pivot entity to any other one). Since searching too far would cause too much delay, and the graph
would be too big, the number should be chosen with care.
The Activate filter button must be activated and customized filter selected from the preset graph filters drop down
on the toolbar.
Go to previous node
Navigation from one entity to another is stored. By selecting this option the graph will render the last entity seen.
Picking Mode
This option allows the nodes to be moved around the screen. When you click on this option no pop-up is displayed, however the way you
can rearrange the way the graph is displayed does change. This is the default mode.
The nodes can be repositioned within the panel by selecting a node with the mouse pointer and dragging it to the desired position. The
possible actions are:
Transforming Mode
This mode allows the user to apply some basic transformations to the entire graph. The possible actions are:
Drag & Drop: Moves the whole graph to the desired position.
Show legend
Artifacts
If graph's entity has artifacts (source files) associated, this option let you choose one and open it in code viewer (only available in server
mode). See Code Viewer section for further information.
Code Viewer
This viewer is only available when you right-click on an entity in the graph, in the model tree or in the query results, and select the option
Artifacts. It requires working in server mode, too.
Allows the user to see the artifact(s) (source files) associated with that entity. When you chose this option for a portfolio entity (software
or component) which has artifacts associated, a dialogue box will be shown from which you can choose one of them:
Chose whichever artifact you want to see and accept. This will open a new dialogue box showing the desired artifact, with syntax
highlighting if its language and/or file extension is within those supported (the language prevails over file extension):
Remember that only specific artifact locations can be used to retrieve artifacts. Those declared as a file pattern will be
ignored.
Selecting a node in the model tree will show its properties, relations and metrics (if the model has metrics) at the bottom of the main
window as two tables. Both of them are sortable left-clicking on each column header (rotating between A-Z, Z-A, and original order).
Furthermore, columns shown in all tables can be customized. You can right-click on the header and a list of available columns will be
shown. Check/uncheck each one in order to show/hide it.
It is possible to export table's information to a CSV file by right-clicking on the table and selecting that option.
Collapsed Node Tab
If there are too many entities to paint in a graph, entities of the same type are collapsed into one node in order to reduce their numbers.
Double-clicking on a collapsed node opens a new tab in the south panel. This tab contains a table with all collapsed entities:
To query the model select New Query from the menu bar or the tools bar. You can have as many new query tabs as you wish
simultaneosly. This kind of tabs allows the user to search for entities in the model with specific characteristics.
Query tab has its own toolbar, from which you can access some actions related with query management:
Run Start query execution and display results in the lower panel.
query
Reset Reset query parameters and remove the last results panel.
Load Options are: from local file system, search and select the properties file; or from server, a combo box will be shown with
query queries stored in checKing, select one. The state of that tab search criteria (wizards and AQL expression textfields) will
be restored to match the query data.
Save Options are to local file system or in server. In both cases insert name and description (optional) in the dialogue box to
query save it. If saved to local file, location of the file will be requested, too. The state of that tab search criteria (wizards and
AQL expression textfields) will be stored into a properties file.
Queries Wizard
The wizard provides an easy way to make a query. To do so, follow these steps:
It is not necessary to enter an entity name nor select an entity type or relation type. However the search may take a
long time and return an unmanageable quantity of results.
AQL tab
Users familiar with AQL expressions are recommended to use one in AppMap Query Language tab. See the manual
APPMAP Query Language for more information on how to build AQL expressions.
Results of a query created either by the wizard or by entering an AQL statement are shown in table form. Columns are sortable
left-clicking on each one's header (rotating between A-Z, Z-A, and original order). Furthermore, you can right-click on the header and a
list of available columns will be shown. Check/uncheck each one in order to show/hide it.
Right-clicking on any row will show a pop-up menu with the following actions:
Export to CSV: saves the results to a CSV formatted (semi-colon separated) file (note that only shown columns are exported).
Artifacts: if row is an entity, and it has artifacts associated, let the user select an artifact and shows it in Code Viewer.
Double-clicking on a row opens a new Pivotal Graph tab with that entity as pivot node.
Impact analysis shows the impact of changing one or more entities in the model. Perhaps you wish to remove an entity, or refactor some
module of your application, and need to determine the impact of such a decision. The impact analysis tool can be used for this purpose.
Impact analysis tab has its own toolbar, giving you access to actions related with this analysis management:
Run Start query execution and display results in the lower panel.
impact
analysis
Reset Reset analysis parameters and remove the last results panel.
Auto-fit Forces zoom on impact graph, in order to see it completely, and take advantage of all space available.
graph
Load Options are: from local file system, search and select the properties file; or from server, a combo box will be shown
query with queries stored in checKing, select one. The state of that tab search criteria (wizards and AQL expression
textfields) will be restored to match the query data.
Save Options are to local file system or in server. In both cases insert name and description (optional) in the dialogue box to
query save it. If saved to local file, location of the file will be requested, too. The state of that tab search criteria (wizards and
AQL expression textfields) will be stored into a properties file.
Export Saves an HTML report of the last impact analysis performed and shows it in a panel.
HTML
Report
This wizard is divided in two sections: sources and targets. While sources is a list of entities used as the starting point of analysis,
targets represents the criteria of the analysis, in other words, which kind of entities we care for.
Sources
This list contains all the entities that will be used as sources for the impact analysis. This list can be filled by:
Drag & Drop a (multiple) selection from the tree view to the sources list.
Right-click on selected entities in tree view -> Add to impact analysis
Sources Wizard: opened with (from the tools bar), or Add Source entry on the right-click popup menu. This wizard lets you
specify source entities' name pattern and/or type and fill the sources list with matching elements.
AQL tab
Users familiar with AQL expressions are recommended to use one in AppMap Query Language tab. See the manual
APPMAP Query Language for more information on how to build AQL expressions.
Targets
This panel contains a wizard to set the entities' name pattern, type, direction and/or depth (see Appendix B for further information about
directions in wizards). These criteria will apply to analysis in order to collect target entities.
AQL tab
Users familiar with AQL expressions are recommended to use one in AppMap Query Language tab. See the manual
APPMAP Query Language for more information on how to build AQL expressions.
Targets tab
If impact analysis execution is successfully completed, an All targets tab will be shown as a result, containing all the entities that were
resolved as targets by the impact analysis.
As well as the final targets, APPMAP browser will compute all the possible paths between sources and targets.
Along with targets tab, an Path summary tab will be shown to express how may paths can be found between each pair source - target.
Path Limits
Founding all-pairs between software components is a complex task, so some limitations are applied. Please, take them
into consideration when reading paths:
An AQL traverses the subgraph until we reach desired targets. The algorithm will stop at some point. The
maximum depth (D) reached by the AQL algorithm is taken into account when calculating paths, so that all those
paths longer than this limit will not be shown.
The intermediate nodes between sources and targets are limited to those traversed by AQL.
The relations taken in consideration are more than those traversed by AQL: actually, they are ALL the relations
between the intermediate nodes.
contains relation, on the other hand, are NOT considered.
Right-clicking on any row will show a pop-up menu with the following actions:
Export to CSV: saves the results to a CSV formatted (semi-colon separated) file (note that only shown columns are exported).
Artifacts: if selected target has artifacts associated, let the user select an artifact and shows it in Code Viewer.
Double-clicking on a row opens a new Pivotal Graph tab with that target as pivot node.
Preferences
User is allowed to customise some application preferences, grouped by category. The following actions apply over all categories:
Connection preferences
Configurable options:
Proxy Host: if client's machine is accessing checKing server through proxy, type here the URL where proxy host is located;
Proxy Port: the port to access the proxy host;
Username: if proxy host requires authentication, fill this field with your username;
Password: if proxy host requires authentication, fill this field with your password;
Scheme: proxy authentication scheme, this will set the scheme to be used. NTLMv2 is not supported.
Cookies policy: provides corresponding cookie management interface for a given type or version of cookie.
Query server: if proxy is set, query server can work in two different modes.
If you have direct connection to the server (no firewalls, you're using a web proxy for caching purposes), use direct
(Direct Connection)
If you do not have direct connection to the server (e.g. a firewall is blocking you), use proxy (Always offline). This
will downlaod a copy of the model, and it will open it locally.
Available actions:
Test connection: checks if current configuration actually works (note that it does not save anything).
Load default: restore all connection preferences to their default values.
The APPMAP Browser makes intensive use of the APM Query Language (AQL) expressions, so it is important to be familiar with this
language. See APPMAP Query Language (AQL) for full details.
The company defined model entities are shown in the model tree in order to be able to navigate through the model or to choose the
sources of the impact analysis. Different tree configurations can be loaded with Tree view... menu button. You can write your own
configuration following its DTD file (located at
${CHECKING_HOME}/WEB-INF/plugins/plugin-APPMAP/scripts/resources/TreeView.dtd) and typing in the proper AQL
expression (or groovy closures) in the CDATA sections that would match desired nodes. It is also possible to specify one icon of those
packed with APPMAP plug-in for each element, see Appendix C: Icons available.
There are basically three types of elements: userDefined, systemDefined and group. You can combine and nest them in order to define
the configuration desired.
It is advisable to modify or create a view creating a new view, i.e., a new file in the directory view ${CHECKING_DATA}
\plugindata\appmap\treeConfig. This is because future updates of view may result in loss of existing in the view
changes by defect in the product.
This node has a name attribute which indicates the name of the view and that is the name that will be displayed in the browser.
Description
<description>
Default Tree View. You may simply activate / deactivate blocks (with the active attributes),
change parameters, reorder view elements, etc.
</description>
Imports section
Import other xml files. For example:
Definition of macros
It is possible to define macros for reuse in different blocks of the body from view.
A macro can contain:
Body with part of the view where the elements are: userDefined, systemDefined and group.
<macrodef name="cpp.classes">
<description>C++ classes, grouped by namespace</description>
<body>
<group iconPath="/resources/icons/@{classIcon}.png">
<groupFilter resolver="groovyFilter" iconPath="/resources/icons/@{namespaceIcon}.png">
<![CDATA[def name = o.name; if (name==null) return '<default>'; int lastPoint =
name.lastIndexOf(':'); return lastPoint!=-1 ? name.substring(0, lastPoint-1) : '<default>'; ]]>
</groupFilter>
<entityFilter><![CDATA[o.subType == 'class' && (@{languageFilter})]]></entityFilter>
<toString>
def name = o.name; if (name==null) return 'UNKNOWN'; int lastPoint = name.lastIndexOf(':');
return lastPoint!=-1 ? name.substring(lastPoint+1) : name;
</toString>
<systemDefined iconPath="/resources/icons/@{methodIcon}.png">
<filter><![CDATA[ o.type=='component' && o.subType=='operation' ]]></filter>
</systemDefined>
</group>
</body>
</macrodef>
<macro name="my.macro">
<arg name="param1" value="value1"/>
<arg name="param2" value="value2"/>
</macro>
This means that the part of the view defined in the body of the macro with parameters that are defined will be inserted.
The view
The last part of the view is the view itself that contains elements of type userDefined, systemDefined and group.
userDefined elements
Description
Use this element if you want to define an artificial container in to which you can drop other elements.
Attributes
Subelements
userDefined, _systemDefined _ or _group _: As the simplest element possible, the only subelements allowed are these ones.
Example
systemDefined elements
Description
This element lets you decide current entity's children (initially, ApmModel) to decide which ones must be added as a swing tree node's
child.
Attributes
resolver: This value must be one of aqlFilter or groovyFilter, the first one being the default value if you do not specify it.
iconPath: Swing tree node's icon for each matching entity.
Subelements
filter: It contains a CDATA element with the AQL or Groovy expression to apply as the filter of current entity's children. This means
that within the current set of child entities, filter is going to be applied in order to know if the filter expression matchs or not, so this
filter expression must return a boolean value. If there were several filter subelements, only the first one is used, but you must specify
at least one.
selector: (optional) It contains a CDATA element with the AQL expression to retrieve a set of child entitites within current context.
In this way we may want to skip some levels on model in order to retrieve some entities from children of the current direct children.
(i.e.: if we have 'programs -> queries -> tables' and we want to show on tree 'programs -> tables' avoiding to include query entities
on tree). After retrieve a subset, we may filtering those elements applying previous subelement filter on it. (i.e.: filter only those
entities that matchs name starts with 'M').
userDefined, _systemDefined _ or _group _: Nest them as you wish.
Example
group elements
Description
Finally, group elements are handy in order to classify the current entity's children in different groups. It is very similar to checKing
project's portfolio grouping.
Attributes
This element has one sole attribute: type, which indicates whether interpret or not subtrees.
type: (optional) May be "entity" or "subtree". The first one (entity) is the default mode: all entities belonging to a group are nested
under the group node. On the other way, subtree allows nesting userDefined, systemDefined or group elements.
Subelements
groupFilter: This contains a CDATA element with an AQL expression that collects the group names.
Attribute iconPath: A Swing tree node's icon for each matching entity.
Attribute resolver: This value must be one of aqlFilter or groovyFilter, being the second one the default value if you do not
specify it.
Attribute preset: You can use a preset filter instead of typing the code yourself.
groupType Uses each entity type as a group. Groups 'software' and 'component'
discovered
groupSubtype Uses each entity subtype (softwareType, componentType, Groups 'layer', 'module' and 'program'
etc.) as a group. discovered
groupTag Each tag group discovered will be used as a group. Groups 'TAG1', 'TAG2' and 'TAG3'
discovered
groupPackage Thought for object oriented components (e.g.: Java classes), Groups 'com.apm', 'com.apm.gui',
which full names include its package name, uses each 'com.apm.rules' and
package as a group. 'com.apm.builder' discovered
entitySelector: (optional) It contains a CDATA element with the AQL expression to retrieve a set of child entitites within current
context. In this way we may want to skip some levels on model in order to retrieve some entities from children of the current direct
children. (i.e.: if we have 'programs -> queries -> tables' and we want to show on tree 'programs -> tables' avoiding to include query
entities on tree). After retrieve a subset, we may filtering those elements applying below subelement entityFilter on it. (i.e.: filter only
those entities that matchs name starts with 'M').
entityFilter: This contains a CDATA element with the AQL or Groovy expression to apply as the filter of the current entity's children,
classifying them into the groups discovered before. This means that within the current set of child entities, entityFilter is going to be
applied in order to know if the filter expression matchs or not, so this filter expression must return a boolean value. When filling the
groups, each appearance of #group# placeholder in that expression will be replaced with the current group's name.
Attribute iconPath: The Swing tree node's icon for each matching entity.
Attribute resolver: This value must be one of aqlFilter or groovyFilter, being the first one the default value if you do not
specify it.
Attribute preset: You can use a preset filter instead of typing the code yourself.
Name Description
toString: This contains a CDATA element with Groovy code that transforms an entity (a variable called 'o' in the code) into a proper
string for tree node's name. This element is optional, if it is not set, the entity's name will be used.
Attribute preset: You can use a preset filter instead of typing the code yourself.
toStringShortname Transform the entity's name into a substring after its last point. com.apm.Class -> Class
Example
<group type="subtree">
<groupFilter iconPath="/resources/icons/application.png">
<![CDATA[ def af = o.getPropertyByName("area"); return af ==
com.optimyth.apm.model.Property.NULL ? "UNRESOLVED" : af.value ]]>
</groupFilter>
<toString preset="toStringShortname" />
<!-- Put here as many userDefined, systemDefined or group elements as you want -->
<userDefined name="Cobol programs" iconPath="/resources/icons/layer.png" active="true">
<systemDefined iconPath="/resources/icons/program.png" resolver="groovyFilter">
<filter/>
<selector>
<![CDATA[ //program[@area='#group#' and @language='cobol'] ]]>
</selector>
</systemDefined>
</userDefined>
</group>
Since the purpose of each possible value might be hard to comprehend at first, we will illustrate them with a graphic example (figures B1
and B2). The following image shows how the whole graph looks without filtering (just setting depth to 2).
Depth:
Figure B1: Unfiltered entity relations
Any element: All entities will be shown. This direction is not filtered.
Outgoing: Shows entities accessed through relations going out of the selected entity. If there are several levels, apply this
same direction to other relations.
Incoming: Shows entities accessed through relations coming into the selected entity. If there are several levels, apply this
same direction to other relations.
Outgoing & Incoming: It combines both outgoing and incoming options by showing their node groups.
Outgoing Incoming
Figure B2: Entity relations filtered by direction
/resources/icons/application.png /resources/icons/beans.png
/resources/icons/building.png /resources/icons/business_object.png
/resources/icons/business_process.png /resources/icons/business_service.png
/resources/icons/cascade.png /resources/icons/cloud.png
/resources/icons/computer.png /resources/icons/configuration.png
/resources/icons/cplusplus.png /resources/icons/csharp.png
/resources/icons/css.png /resources/icons/database.png
/resources/icons/databases.png /resources/icons/excel.png
/resources/icons/flash.png /resources/icons/flow.png
/resources/icons/helper.png /resources/icons/html.png
/resources/icons/image.png /resources/icons/java.png
/resources/icons/key.png /resources/icons/layer.png
/resources/icons/lock.png /resources/icons/module.png
/resources/icons/monitor.png /resources/icons/organisation.png
/resources/icons/panel.png /resources/icons/pdf.png
/resources/icons/person.png /resources/icons/php.png
/resources/icons/plugin.png /resources/icons/program.png
/resources/icons/report.png /resources/icons/ruby.png
/resources/icons/sap.png /resources/icons/script.png
/resources/icons/server.png /resources/icons/shield.png
/resources/icons/table.png /resources/icons/terminal.png
/resources/icons/tux.png /resources/icons/unit.png
/resources/icons/url_mapper.png /resources/icons/validation.png
/resources/icons/view.png /resources/icons/visualstudio.png
/resources/icons/web_service.png /resources/icons/xhtml.png
/resources/icons/folder.png
Appendix D: How to configure time consuming AQL queries
The browser warns the user when he tries to execute a time-consuming AQL query. This is achieved with a list of regular expressions
that identify these dangerous queries.
Each line represents a regular expression that has to match the entire AQL query.
Some actions in the browser can be limited to some roles. These can be configured with a special path in the standard checking
permissions system. Configurable actions include:
Description
We can extend default product icons used in the browser, customizing new ones once we want to browse models. Through a ZIP file we
can setup new PNG icons with a descriptor of them.
First of all is to package all PNG icons with custom relative paths within a ZIP file. Also we need to add an XML descriptor file with
relative paths of each icon within the ZIP file.
custom-icons.xml
icon-path\icon1.png
...
icon-path\iconoN.png
Icons descriptor file is an XML file with same format as used in the original product file.
It is mandatory that filename of the icons descriptor XML must be custom-icons.xml, but relative paths pointing to the
icons could be modified.
Example
<?xml version="1.0" encoding="UTF-8"?>
<icons>
<icon id="1" file="/resources/icons/a.png" />
<icon id="2" file="/resources/icons/d.png" />
<icon id="3" file="/resources/icons/p.png" />
<icon id="4" file="/resources/icons/r.png" />
<icon id="5" file="/resources/icons/s.png" />
<icon id="6" file="/resources/icons/sp.png" />
</icons>
id: a sequence to be used as identification of each icon. May starts at 1, it does not overwrite default product icon sequence.
file: relative path pointing to the icon within ZIP file.
AIM - Scripting
APPMAP Scripting
Overview
How it works
Configuration
How to execute APPMAP scripts
From command line
Scheduled execution
Script reference
Diff
Groovy
ImpactAnalysis
Query
Tag
Validation
Table
Propagation
Overview
APPMAP Scripting provide a "batch" interface (complementary to the AIM - Application map Browser) based on "command-line" oriented
logic that can be scheduled or executed on demand.
There are scripts for different purposes, which typically belong to one of the following groups:
Query: Looks for entities/relationships matching certain criteria, in an existing APPMAP model. An impact analysis is a special kind
of query, that looks for dependencies between a set of source entities matching an AQL query, and a set of targets with dependency
paths from the sources matching another AQL query.
Diff: Finds the differences (either at enties, relations or property values) between two (similar) models. The typical use case is when
a software evolved in time and it is needed to understand the differences between two versions.
Tagging: Tag entities in a model according to certain conditions and tag operations.
Validation: Checks if entities and relationships in an existing APPMAP model follow certain rules (architecture rules, dependency
patterns and so on).
Propagation: Executes a Propagation Analysis that analyze model dependencies for different usages (dead-code detection,
tagging, model dependencies validation).
For building an APPMAP model from source code and a model build configuration, see AIM TASK - Analyze.
How it works
In what follows, $APPMAP_PLUGINDIR will stand for the directory where APPMAP plug-in is installed (e.g.
CHECKING_HOME/WEB-INF/plugins/plugin-APPMAP), and $APPMAP_EXTDIR will stand for the plugin configuration directory,
e.g. CHECKING_DATA/config/plugins/APPMAP.
Each script uses the AIM Query Service to connect to a remote AIM system. Scripts could be invoked programmatically, using the Script
API, via command-line using provided ANT scripts, or via the APPMAP plugin APPMAP/scripts/exec analyzer.
Configuration
To use Scripting funcionalities, you must activate xmlrpc in your checking server. Set xmlrpc.active=true in your
checking configuration properties tab.
The file AimScript.properties contain global configuration parameters. When executing scripts from checKing web interface, it is
recommended to place and edit this file in the APPMAP plugin extensions directory CHECKING_DATA/config/plugins/APPMAP. The
most important parameter is the connection url to the query service.
Default AimScript.properties
# Configuration properties for AIM Scripting# Configuration properties for AIM Scripting
# Paths to libraries
# This dirs exist when client is in the checKing machine.
# Copy jars (see classpath in AimScript.xml) to local machine and change, if necessary
# Directory with AIM libraries
lib.dir.aim=${env.CHECKING_HOME}/WEB-INF/plugins/plugin-APPMAP/lib
# Directory with ChecKing libraries
lib.dir.chk=${env.CHECKING_HOME}/WEB-INF/lib
# File with Groovy code for the Groovy script (redefine in script invocation)
code.resource=
forked=true
When invoking a script either from command-line or from web interface, you may provide a different value for any of the
above properties. that will take precedence over the value in this AimScript.properties file.
The scripts could be executed from command line (as a set of ANT scripts) or as a checKing job provided by the APPMAP plugin.
Where each script property (model.input etc.) (see Script reference) is passed to the Ant script as Java properties, -DPARAM=VALUE.
If no TARGET is specified, help is assumed, and a short description of script usage will be displayed.
Note that command-line args could be quoted to avoid shell metacharacter expansion issues.
Apache Ant is required by checKing, and the host where the checKing product is installed will typically have the ant
command available for certain accounts on the checKing host. Your system administrator may help you to configure
your user account in checKing host with access to Ant tool.
Scheduled execution
The APPMAP/script/exec is a wrapper that permits the execution of any of the "local" scripts as a checKing analyser: It may be
executed or scheduled from the web admin job scheduling tab.
Script properties:
model Software item path (used only for Select one model /my/project/MyModel
resolving configFile )
properties Input properties for script String with PROP=VALUE pairs model.input=MODELFILE|
separated by '|' (pipe) characters query=//table|report=MyReport.xml
configFile Path of configuration file with properties Properties file with PROP=VALUE query.properties
that will be searched for
NOTE: One of the configFile or properties should be specified. When both properties and configFile are specified, values specified in the
properties parameter takes precedence over values with same name in the configFile. If you need a value including vertical bars (|)
characters, prepend them with
(backslash).
If configFile is specified but cannot be located relative to plugin extension dir, execution terminates with error.
Script reference
ImpactAnalysis Query Performs impact analysis on model, using AQL sources.query for selecting source entities and
AQL query for path between matched sources to targets
Diff
Performs diff between model and secondModel, generating output in report (or in console).
Differences could be: New or removed entities, relations (dependencies), and properties; or properties with different values.
Parameters:
Output:
Formatted report at report or standard output.
NOTE: If desired, a Groovy template may be set in the "template.diff" property (a resource path available from script execution
classpath). By default, the /resources/templates/diff.xml.template for XML output is used. If desired, you may provide
your own template in order to customise report output.
Usage:
Groovy
Executes groovy code, which can access to the remote query service.
Parameters:
ImpactAnalysis
Performs impact analysis on model, using sources.query and query, and saving results in report.
Parameters:
NOTE: To use your own template, you may configure it in the template.impact parameter. The default template (
/resources/templates/impactAnalysis.xml.template) will produce a simple XML report with all matched entities (in
source and target sets) and their properties. You may provide a different template in the APPMAP plugin extension dir.
Example:
Query
Performs a query on model, using AQL query language, and saves the output into a report (or standard output if not specified).
Parameters:
Output:
Report with matched entities / relationships / scalars is dumped to report (or in standard output).
Usage:
Example:
A (too simple) "dead code" detector.
Tag
Parameters:
model - (Mandatory) model location
start.aql - (Mandatory) AQL query for selecting "starter entities" to tag.
start.tagop - CSV-encoded tag operation on (see below).
start.tagop.file - File with the CSV-encoded tag operation (see below).
propagation.aql - (Optional) Relative AQL query for selecting "propagation" entities from starter entities.
propagation.tagop - (Optional) CSV-encoded tag operation on "propagation" entities.
propagation.tagop.file - (Optional) File with the CSV-encoded tag operation (see below).
1. Action: One of A (add tags), V (add tags from value closure), R (remove tags), M (replace tags), P (add property)
2. Values to add: comma-separated list of tags to add (A, M), groovy closure returning a string with tags to add (V), or groovy closure
returning the property value (P). Unused for R.
3. Values to remove: comma-separated list of tags to remove (R,M), or property name (P). Unused for A and V.
4. filter: (optional) groovy condition on each entity to alter (use o as argument). Example: o.componentType=='x'
Example:
A|FirstTag,SecondTag||o.subtype=='class'
A|ThirdTag||o.subType='table'
R||OtherTag|
M|FirstTag:ejb|FirstTag|o.subType='class' && o.getPropertyByName('j2eeType')?.value = 'ejb'
V|VarTag:o.subType||
P|o.type + '/' + o.subType|myProperty|
With the above, first tag op means setting FirstTag and SecondTag tag values to every class, setting ThirdTag to every table,
removing OtherTag unconditionally, modifying tags for ejb classes by removing FirstTag and setting FirstTag.ejb, setting a
variable tag VarTag value based on the element subtype, and setting a myProperty property by concatenating the type and subType
properties.
Output:
Model under model location will have all entities retagged by the tagging rules, accoding to the following algorithm:
Entities matched by start.aql ("starter entities") will be tagged by the tag operation provided in either start.tagop or
start.tagop.file.
If propagation.aql is provided, it is executed with starter entities as initial context for the AQL query. The tag operation provided
by either propagation.tagop or propagation.tagop.file are applied on matched entities.
Usage:
Example:
To tag tables in model with incident relations from classes with "programTable":
Validation
A validation rule is focused on emitting "violations" where certain conditions are met in the dependencies model, and typically
represent deviations from architecture standards.
You may specify arquitecture validations in the APPMAP Dependencies Validation Language, directly in the code property, or as a
file in the codeFile property.
Alternatively, you may specify the path to a server-side Spring descriptor (descriptor) that configures validation rules, and
optionally the name of the rule/ruleset bean (beanName) to execute (if not given, the first ruleset found will be used).
See provided APPMAP API documentation (in javadoc format) for implementing your own validation rules.
Parameters:
Output:
Formatted violations report in report, or in standard output when not specified.
NOTE: If desired, a Groovy template may be set in the template.validation property in file AimScript.properties (a
resource path available from script execution classpath). By default, resources/templates/validation.xml.template is
used. If desired, you may provide your own template in order to customise the report output.
Usage:
Example:
Table
Performs queries for tabular data (using AQL) on a remote model. An absolute query selects a set of target entities, and additional AQL
expressions produce additional results related to each matched entity. The first column in the results table is the matched entity.
This feature is useful to compute dependency metrics or to find values relative to entities of interest.
By default, result is rendered in comma-separated values (CSV) format, unless renderCode or template.table properties are
specified.
Usage:
ant -f Table.xml table -Dmodel=MODEL
{-Dquery=QUERY | -Dquery.file=FILE} -Dheader=COLNAME,COLNAME... -DtoString=FORMAT_SPEC
{"-Dcolumn.queries=COLQUERY,COLQUERY..." | -Dcolumn.queries.file=FILE}
[-Dcolumns.toString=FORMAT_SPEC,FORMAT_SPEC... | -Dcolumns.toString.file=FILE]
[-Dreport=REPORTFILE] [-DrenderCode=RENDERCODE] [-Dtemplate.table=TEMPLATE]
Where:
Output:
Formatted tabular report, written in report file or standard output.
Examples:
1. To show, for each table in the selected model, the list of incident components and its count ( fan-in):
2. Trivial dead-code report (not very much accurate, see Propagation Analysis for a more robust alternative):
with deadcode.txt containing the "trivial dead-code" queries for each entity kind in each application:
class[empty(in:component)]
table[empty(in:component)]
program[empty(in:component)]
Propagation
Executes a Propagation Analysis that analyze model dependencies for different usages (dead-code detection, tagging, model
dependencies validation). See Propagation script for full details on how to use the Propagation.xml script.
For query / impact analysis / APM inventory filtering and other usages, expressions may be written in the APM Query Language.
APPMAP browser, APPMAP scripts and other tools use AQL as their expression language for such usages. This document describes
the language syntax.
Purpose
AQL is a simple declarative language that performs queries, filtering, impact analysis and other operations on an APM model.
AQL is based on expressions that declare a model traversal: think of the APM model as a (directed) object graph where nodes are the
entities (organisational or logical) and their containers, and edges are the relationships between the nodes (for example, if Cobol
program P uses table T, a "uses" relationship links P and T). AQL expressions operate on an initial context node, and apply a sequence
of steps to traverse the model from initial context nodes to a nodeset of reached nodes.
Syntax
APM Query Language (AQL) is an expression language for traversing the APM entities/relationships, similar to XPath (XPath is focused
on finding nodes in XML trees, while AQL is focused on finding entities in APM object graphs).
An AQL program is made by zero or more variable declarations, followed by an AQL expression.
An AQL expression is a sequence of steps, followed by zero or more predicates.
Types in AQL
Conversion rules
AQL elements
Comments
Block comments in AQL use the same delimiters as in XML:
Location paths
A location path is a sequence of steps (separated by /), where each step is a navigation route from current context nodeset, with optional
predicates between [ and ] that will be checked for on navigated items: if a navigated item match the predicates, it will be added to the
next context nodeset.
/portfolioModel (where all the components and software entities are stored)
/organizationalModel (reflects the organization model (person, unit etc...)
/logicalModel (contains groups and membership relations)
Axis
A step can start with an axis specification
Relationships
You may add a percent sign followed by one or more relationship names between the axis and the entity types in order to restrict
resulting nodeset to those entities reached through one of the relationships specified.
Function calls
Functions may be specified both in steps and predicates. See AQL functions section.
Cobol Programs that reference two or more tables
Code blocks
For programmatic operations, a block of Groovy code could be specified as a code block between # (a code block is treated as a _step,
see above).
/portfolioModel/component[#o.componentType == 'businessProcess'#]
$progs/in:software | $tables/in:software
Substitution macros
A query can be parametric (bind variables), so that during execution, for example from AIM - Application map Browser), a popup window
will automatically ask for those parameters.
A MACRO_DESCRIPTOR has the following syntax: NAME[:TYPE][:val1;val2;...] where NAME is the parameter name, TYPE could
be one of text, textarea, combo, list, checkbox, radio (text is the default), and val1;val2;... are a ;-separated list of possible values
(for combo, list, checkbox or radio) or a single textual value (for text and textarea). Default values are those placed first in the list.
The values (taken from user) will replaced the macros defined. Examples of parameterized AQL queries:
<!-- Child components of element typed in SOURCE macro, whose language is either java, cobol or
jcl -->
dn('@{SOURCE}')/component[@language='@{LANGUAGE:combo:java;cobol;jcl}']
<!-- TYPE1 is one of *, component or software, while TYPE2 can be component, software, or both
(comma-separated) -->
/*/@{TYPE1:radio:*;component;software}/@{TYPE1}/(@{TYPE2:list:component;software})
<!-- Entities of type TYPE (default value is component) contained in CONTAINER
(organizationalModel, portfolioModel or both)-->
/(@{CONTAINER:checkbox:organizationalModel;portfolioModel})/@{TYPE:textarea:component}
Examples
<!-- All components (using relative path from portfolio model) -->
portfolioModel/component
<!-- Get all components one and two links away from a certain business object -->
dn('sys=MYAPP,bo=MyBusObj')/inout[<3]:component
<!-- Get all outgoing elements from current context nodes -->
out[*]:*
<!-- The expressions below look for top-level business process components -->
/portfolioModel/component[#o.componentType=='businessProcess'#]
/portfolioModel/#o.components.find{ it.componentType=='businessProcess'}#
<!-- Impact analysis: get any component that depends on context node (recursively) -->
./in[*]:component
<!-- Impact analysis: get any program or class that use tables with names starting with MYTABS,
in application MYAPP -->
//databaseObject[match('^MYTABS', @name)]/in[*]:(program,class)[in:software/@name='MYAPP']
AQL functions
Function Meaning
number count(arg,...) Counts the total number of nodes in each nodeset arg, or the total number of non false values
for non-nodeset args
boolean empty(arg) Returns true if the arg, evaluated as a nodeset, contains one or more elements, false
otherwise
nodeset difference(nodeset, Returns the set difference of the input args, evaluated as nodesets
nodeset)
nodeset dn Returns a nodeset with all entities matched by key in the model
(string|nodeset,...)
boolean match(regexp, Returns boolean true if the string value for all arguments (2..N) match the regular expression
values...) given as first argument
boolean tags(string, arg, Boolean function that returns true if tags for ALL nodes in args(2..N) implies all tags in first arg
...)
nodeset union(nodeset,...) Returns the union of the input args, evaluated as nodesets
Function count()
Counts the total number of nodes in each nodeset arg, or the total number of non false values for non-nodeset args.
number count(arg,...)
Function empty()
Returns true if the arg, evaluated as a nodeset, contains zero elements, false otherwise. Typically used in AQL predicates, similar to
count(arg)=0.
boolean empty(arg).
Function difference()
Return a nodeset with all entities matched by key in the model. This is similar to the id() XPath function (this function is aliased as
id() for compatibility).
nodeset dn(string|nodeset,...)
nodeset id(string|nodeset,...)
The string value of each argument is evaluated, and used as a key for direct search in the model. If the argument is a nodeset, for each
node the string value is evaluated and used as a key.
Examples:
dn('my key')/component - Return outgoing components for the specified entity matching 'my key'
dn(component/@referenced) - Return entities with a key in the attribute 'referenced' in components from context node
Function intersection()
Examples:
Function match()
Returns boolean true if the string value of the arguments (2..N) match the regular expression given as the first argument. A submatch will
be checked (see Java java.util.regex.Matcher.find() for details).
Properties:
regexp - Regular expression (the arg is converted to a string)
values - One or more value arg. If value is a nodeset, the string value for each node in the nodeset is matched against regexp; if non
match, false is returned. Else, value is converted to string and matched against regexp. ALL values must match the regexp if.
Examples:
match('((\.java)|(\.cob))$', @artifact) - True if the artefact property for ALL context nodes is set and ends with .java
or .cob
match('(java)|(cobol)', component/@language) - True if the language property for ALL component outgoing nodes from
context nodes is set and contains java or cobol
match('^com\.optimyth\.', #o.getPropertyByName('class')#, in:component/@package) - True if the class for
context nodes and the package for all their incoming components starts with 'com.optimyth.'
match('anything') - False, nothing to match
Function tags()
Boolean function that returns true if tags for ALL nodes in args(2..N) implies all tags in the first arg.
First arg could be a string arg (that evaluates to comma-separated list of tags to be implied), or a non-empty nodeset with at least one
node, that could be an entity or property with Tags value.
args(2..N) could be nodesets of entities or property of Tags type.
Examples:
tags('t1,t2', .) - Returns true if context node is ApmEntity or Property of type Tags, and its tags imply 't1' and 't2' tags.
tags('t1,t2', out:component) - Return true if tags in ALL outward components implies t1 and t2 tags.
tags(@tags, out:component) - Return true if tags in ALL outward components implies tags in context node.
tags('t1,t2') - Returns false
tags() - Returns false
Function union()
nodeset union(nodeset,...)
If an arg is an "scalar" (string, number, boolean), it is converted to a nodeset with a single node for performing the union.
AQL API
1) Using AQL programmatically (for example to construct your own query logic in your Java programs).
2) Extending AQL by adding custom functions.
Using AQL in your own Java programs
or, if don't need reusing the result set, and you want just to iterate once over it (like a ResultSet), you can use the more efficient
executeAsIterable method:
Overview
DEPendencies VAlidation Language (DEPVAL) is a high-level declarative language for specifying checking conditions on a software
architecture. DEPVAL uses rules based on AQL to decide if entities defined in the model follow architecture compliance rules, emitting
violations when an entity in the model violates an architecture rule.
Rules are organized in groups (rulesets) that could be nested. For all entities in APPMAP model, each entity (denoted context entity in
what follows) is checked against the top-level ruleset, and violatios emitted if the rules find non-allowed dependencies from context
entity.
Language Structure
A top-level ruleset element should be defined (a ruleset may have nested rulesets and rules).
ruleset
description string explanation of the ruleset 'Avoid SQL code in presentation/business artifacts'
message string template for rendering detailed message '${rule.description}: ${source} -> ${target}'
Properties priority, category, description and message are inherited from parent ruleset. In this way, you may give a value to
the ruleset and all rulesets/rules enclosed inherit the value if they do not specify any.
The default value for priority is 'info'; the default value for active is true.
message receives the following objects, that could be used in ${...} expressions:
Sample ruleset
rule
checkEntity Groovy Closure Logic for check on model entities (see below)
rule may have the following children:
subset, Zero or more filters based on a pattern. Only entities matching at least one of the subject specified will be checked by
the ruleset/rule
allow/deny, sequence of "what can be done" and "what should be avoided" in logical architecture.
pattern
A pattern is a named group of entities matching certain include/exclude conditions. They typically represent a layer, a module, a
transaction, or any logical entity that could be defined using AQL predicates.
Example:
// A pattern with all components of languages cobol, jcl, or java and having "datalayer" in its
name.
pattern(name:'backend layer') {
exclude(aql: ".[@type != 'component']")
include(aql: ".[@language = 'cobol' or @language = 'jcl']")
include(aql: ".[@language = 'java' and match('.*datalayer.*', @name)]")
}
pattern could be referenced in a subset, a from/to, or an include/exclude. The logical conditions expressed by the pattern will
be used in the referring element.
Pattern definitions are reachable from later references. Scope rules are similar to local variables in common
programming languages.
For example:
ruleset(name:'A') {
subset(pattern: 'P_A') // Error, P_A is not defined yet
pattern(name:'P_A')
ruleset(name: 'A.1') {
pattern(name: 'P_A.1')
rule(...) {
subset(pattern: 'P_A') // OK, references P_A pattern in A
subset(pattern: 'P_A.1') // OK, references P_A.1 pattern in A.1
...
}
}
ruleset(name: 'B') {
pattern(name:'P_A')
ruleset(name: 'B.1') {
rule(...) {
subset(pattern: 'P_A') // OK, references P_A pattern in B (NOT A)
subset(pattern: 'P_A.1') // Error, P_A.1 is not defined in B.1, B or A (rule
ancestors)
...
}
}
}
}
subset
A subset is a filter that applies to its enclosing rule or ruleset. subset may reference an existing pattern, or specify an explicit
checkEntity parameter:
checkEntity Groovy closure Code that will check its ApmEntity argument
{e ->
e.name.contains('dataaccess')}
Examples:
When one or more subset are placed in a rule, they are executed in sequence for the first that responds with an accept or reject
value. If first tells to accept the entity currently examined, allow/deny conditions in rule will be applied. If first tells to reject the entity,
allow/deny conditions will not be checked. If no subset match the current entity, rule is ignored.
When one or more subset are placed in a ruleset, the same behaviour is applied, so enclosed rules/rulesets will be checked if
first matching subset tells to accept the entity, else nested rules/rulesets are ignored for current entity.
allow/deny
They are conditions that typically express accepted or forbidden dependencies for currently examined entity.
allow/deny can be placed in any rule. It has no parameters, and may have optional from and to children (at most one of each).
Please note that order of allow/deny in a rule is important. If an allow condition was first matched, entity dependencies are
considered OK and the rest of the conditions are not checked. If an deny condition is matched (with no previous accept condition
matching the entity), a violation is emitted but following accept/deny are checked following the same behaviour.
Examples:
allow { from(pattern: 'ignorable') } // This could be used for ignoring entities matched by
_ignorable_ pattern
deny {
// Illegal business -> presentation dependency
from(pattern: 'business')
to(aql: "component[${PRESENTATION}]")
}
deny {
// Illegal backend -> business/presentation dependency
from(pattern: 'backend')
to(aql: "component[${PRESENTATION} or ${BUSINESS}]")
}
deny {
// Illegal presentation -> backend dependency
from(pattern: 'presentation')
to(aql: "component[${BACKEND}]")
}
from/to
Describe a dependency filter flowing from a source entity (matched from context entity in from) to a target entity (incoming or outgoing
dependencies from context entity, as specified in to).
Please note that from and to roles are conventional. to typically use AQL expressions or patterns that define outgoing
dependencies, but they could be based as well in incoming dependencies.
Parameters:
checkEntity Groovy closure Code that will check its ApmEntity argument
{e ->
e.name.contains('dataaccess')}
Only one of them should be specified. If not specified, nested include/exclude filters should be specified.
include/exclude
Basic condition for including / excluding context entity in its containing element (which could be from, to, or pattern).
matcher property
For simple conditions, a matcher could be specified instead of defining conditions using AQL queries or patterns.
An instantiated matcher could also be assigned directly to the matcher property if desired:
Examples
Rules on tags
// Checks if any component tagged CO uses any component tagged as BU-specific, which is
forbidden by architecture rules
rule(name: 'CO2CO', description: 'CO artefact calling BU-specific artefact is forbidden') {
deny {
from(aql: ".['CO' == @tags]");
// See how to ignore outgoing usages of a set of components
to(aql: "component[#!['app=MODULE,prog=IS.D'].contains(o.key)#][@tags and @tags != 'CO']")
}
}
// Checks if any BU-specific component uses any component tagged for a different BU, which is
forbidden by architecture rules
rule(name: 'BU2sameOrCO', description: 'BU-specific artefact using other BU artefact is
forbidden') {
deny {
from(aql: ".[@tags and @tags != 'CO']");
to(aql: "\$tag = ./@tags; component[@tags and @tags != 'CO' and @tags != \$tag]")
}
}
// Checks for COPYs that are not included in any other program. Uses specific Groovy logic
(checkEntity)
rule(name: 'Unused COPY', description: 'Every COPY should have incoming deps from Cobol
programs',
message: '${rule.description}: ${source}',
checkEntity: { entity, ctx, rule ->
def progType = entity.getPropertyByName('programType').value;
if('COPY' == progType) {
// If no incoming usages from other programs: 'dead code' COPY
return null == entity.parentComponents.find{ parent -> 'program' == parent.componentType.name }
}
return false;
}
)
}
Cycle detections
Another simple example is cycle detection, like A calls> B -> ... -> A:
In a DEPVAL program you may define Groovy variables, and include the variables in AQL code below. This enables defining predicates
that could be used in pattern, from/to conditions, and generally in any AQL query.
tags('business', in:software)
could be used to specify a logical condition that components should have, and embed that condition as part of AQL queries later, using
${...} substitution. For example:
Layered architectures
Layered architectures are common in software systems. Typically components in a layer are allowed to use components in the
immediate lower layer, but other dependencies are forbidden. To check for dependencies in a layered architecture, you may define
patterns for each layer and specify deny for not allowed usages.
As an example, imagine that the model defines software entities that are tagged according to the layer they belong to. The following
DEPVAL code may detect forbidden dependencies across layers:
ruleset(name: 'architecture', severity: 'warning', message:'${rule.description}: ${source} ->
${target}' ) {
// Predicates for matching each layer. Assumes that containing software has a tag according to
its layer
String PRESENTATION = "tags('presentation', in:software)"
String BUSINESS = "tags('business', in:software)"
String BACKEND = "tags('dataAccess', in:software) or tags('host', in:software)"
rule(name: 'layering', description: 'A component in a layer may call only components in other
layers (or infrastructure)') {
subset(pattern:'component') // Only interested in components
deny {
// Illegal business -> presentation dependency
from(pattern: 'business')
to(aql: "component[${PRESENTATION}]")
}
deny {
// Illegal backend -> business/presentation dependency
from(pattern: 'backend')
to(aql: "component[${PRESENTATION} or ${BUSINESS}]")
}
deny {
// Illegal presentation -> backend dependency
from(pattern: 'presentation')
to(aql: "component[${BACKEND}]")
}
}
}
It is common practice to use, in artifacts implemented in object-oriented languages, to use namespaces for qualifying the artifact in
business or technical groups. For example, in Java the package could be used like this:
In other languages, like Cobol, other naming conventions could be used in program name to classify the artifact. Rules may be encoded
following the particular naming conventions obeyed by software artifacts.
You may use matchers (e.g. namePattern) for defining filters based on entity names:
Propagation analysis
Once the software map is build (an AIM model is produced after analyzing software artifacts), it could be analyzed under different usage
scenarios:
Dead (Unused) Code Detection. Software has certain 'entry points' (programs executed, initial transactions, batch jobs, web
application front-end elements, input web services...) that are called from the external world. Such 'entry points' (starters set in
propagation analysis terms) have outgoing dependencies that reference other software entities (outgoing dependencies on other
entities make the target entities as used from a static point of view). The set of entities reached transitively by outward dependencies
propagated from starters is named propagated set. An entity in the software of interest is considered potential 'dead code' if it is
neither in the starters set nor in the propagated set.
Classification of model entities. If you want to partition the entities in the software map following certain criteria (like technology,
platform, business / functional area, etc., potential classification criteria could be almost anything), it could be possible to start from a
set of entities where that classification is known (starters set), and then propagate the classification using the dependencies in the
map to other related entities (propagated set). Mapping each entity (in either the starters or the propagated set) to the proper
"logical" group could be done by tagging (e.g. setting a tag value, or an entity property with the name of the logical group where each
classified entity belongs). That way, the tag could be used later in AQL searches to find the components that belong to a certain
"logical" group.
Dependencies validation. Certain kind of entities in software must obey certain (architectural or design) norms that limit the type of
allowed dependencies in software. If a software map is built, that architecture / design norms (either positive i.e. "what is allowed", or
negative i.e. "what is forbidden") could be also checked by looking if certain software entities (propagated set) in the model are
reached from certain source entities (starters set). That means that e.g. entities in the starters set have dependencies "banned" by
certain architecture / design norms.
This is named Propagation Analysis. AIM enable propagation analysis with the following interfaces:
(Java) API
Command-line script: either aim-propagation.xml or Propagation.xml for launching propagation program either in the
checKing host, or remotely via Query Service.
Model builder rules (like DeadCodeRule}) or {{TaggingRule that launch the configured propagation program.
You may write your own propagation analysis programs where filters for starters and propagated entities from starters are declared.
Additionally, you may specify actions (like setting a property or a tag value) that will apply either to the starter entities, propagated
entities, or both. You may use the sample programs provided under PLUGINDIR/scripts/propagation as initial examples that you
may extend to fit your particular needs.
Once the propagation analysis program is built, you may execute it using any of the available interfaces, as shown below.
Script
Local execution
To execute a propagation analysis over an AIM model, the aim-propagation.xml Ant script (located under APPMAP plugin's
scripts directory) could be launched from command-line (locally, in checKing host).
The model should not be opened by AIM QueryService. This "local" script is intended to be executed immediately after
model building, and before other clients access the model. Use the remote script instead if the model could be opened
by Query Service when the script is about to be launched.
Syntax:
Where:
Note: Executing deadcode analysis with none report format will not render the unused components anywhere.
Examples:
Detects dead code and generates a CSV report on given file, with the given properties:
Please note that default properties in the aim-propagation.properties could be overridden from command-line parameters, as
shown above with deadcode.report.csv.properties.
Tags model entities according to the given propagation rules, and dump to MyModel_Tags.txt report file:
Debug the propagation rules in program. Entities reached (as starters or propagated) are displayed in the script output (standard output
in the example).
Sample propagation programs for these usages could be found in the PLUGINDIR/scripts/propagation directory.
# --------------------------------
# Dead-code analysis configuration
# --------------------------------
# If true, dead-code analysis will only check entities in the software layer (portfolio model)
# If false, dead-code analysis will check any model entity
deadcode.onlyCheckSoftwareEntities=true
# ------------------------------
# Tagging analysis configuration
# ------------------------------
# If true, cells in CSV are quoted (set to true if any property value may contain the CSV field
separator character)
# If false, no value is quoted
tagging.report.csv.quoted=true
# ----------------------------------------------
# Dependencies validation analysis configuration
# ----------------------------------------------
# If set, sources of illegal dependencies are tagged, using this prefix concatenated with the
propagation key.
validation.tagPrefix=
Remote execution
The Propagation.xml script, located under APPMAP plugin's scripts/remoteScripts directory or in the distribution media, could
be used for execution propagation analysis in a remote node (not necessarily the checKing host). It uses Query Service to launch the
analysis, the result report could be dumped in standard output or in a report file.
Usage:
Where:
Edit configuration file AimScript.properties for default properties (connection url, templates, etc.).
Such properties could be provided also via command-line properties (-Dprop=value).
Examples:
Find dead code using the propagation/DeadCode.xml propagation analysis (in server-side, using classpath).
Report the results in a CSV file, and mark each unused component in model with the DEADCODE tag:
Find entities with outgoing illegal dependencies, according to the propagation/ArchitectureValidation.xml program:
Dump entities in starter and propagated sets for each rule, for debugging rule definitions:
Rules
There are two builder rules provided, that could be added to a builder configuration:
Rule Classname Purpose
Full documentation could be found in the AIM Rules API or in the rules JavaDoc.
A Java API is provided, in order to use propagation analysis in AIM custom extensions. See Propagation Analysis API for details on how
to use this API.
Main structure
Each propagation analysis is coded in an XML file with the following structure:
<program name=''>
<macros>
<macro name='MACRO'>VALUE</macro>
...
<macros>
<starterCondition>
CONDITION
</starterCondition>
<rules>
<rule name=''>
<starter name=''>
<filter>EXPR</filter>
<propagation name=''>PROPAGATION_EX</propagation>
</starter>
...
</rule>
...
</rules>
<checkCondition>
CONDITION
</checkCondition>
<actions>
<actionBlock name=''>
<match pattern='' on='starter|propagation|all'>
OPERATION
</match>
</actionBlock>
</actions>
</program>
The full syntax could be seen in the PLUGIN_DIR/scripts/resources/PropagationProgram.dtd. You may use this DTD
file in your favourite XML Editor to help creating your own propagation analysis programs with the right syntax.
The propagation analysis engine will execute each rule starter's (<starter> elements in sequence, as they appear in the program). For
each starter it will fetch matched model entities, applying the actions that match the rule and starter, notifying each registered listener
(here is where the starters could be remembered or processed elsewhere according to the target usage of the propagation analysis),
and then each starter's <propagation> is executed using the matched starters set as relative context. For each element in the
propagated set computed, actions are executed (if any) and the analysis listener is notified.
Please note that when using AQL, filter in <starter> use typically absolute AQL expressions (like //component[PREDICATE]), while
filter in <propagation> use typically relative AQL expressions (like out[*]:component).
Most of the items have an active attribute (with true or false values) that could be used to deactivate the element.
This way you may activate/deactivate a rule, an actionBlock, a starter etc. selectively.
Macros
In the <macros> block, substitution macros are defined. They are replaced in other parts of the propagation analysis descriptor using the
${MACRONAME} reference. Use macros for values that may change between executions to ease maintenance of the propagation
program.
Examples:
<macros>
<macro name='MODULES'>'App1', 'App2'</macro>
<macro name='COND_ACTIVE' value='true'/>
<macro name='MODULES_FILTER'>//software[#o.name in [${MODULES}]#]</macro>
...
</macros>
...
<!-- Macros are substituted -->
<condition type='groovy' active='${COND_ACTIVE}'>o.software?.name in [${MODULES}]</condition>
Please note that a macro could have in its value another previous macro substituted.
A condition match a single entity under certain criteria. Conditions appear in <starterCondition> and <checkCondition>.
An atomic condition (<condition> element). Conditions could be composed by boolean connectors (and, or and not) to form a composed
condition.
An atomic condition has the following syntax (first option for enumerated attributes is the default):
All attributes are optional, except one of VALUE or RESOURCE that should be provided.
groovy: VALUE is a Groovy expression using 'o' as the variable that contains the AIM entity to check.
aql: VALUE is an AQL expression, relative to the entity to check (example:
.[in:software[match('pattern', @name)]]
).
Examples:
<and>
<!-- default condition type is 'groovy' -->
<condition id='app_filter' active='true'>o.software?.name in [${MODULES}]</condition>
<!-- IGNORE = comma-separated list of names to ignore -->
<not><condition type='byName'>${IGNORE}</condition></not>
</and>
...
<or>
<and>
<condition ref='app_filter'/>
<condition type='byType'>${APP_TYPES_TO_CHECK}</condition>
</and>
<and active='true'>
<condition type='byType'>${DB_TYPES_TO_CHECK}</condition>
<condition type='inDatabase' caseSensitive='true'>${SCHEMAS_TO_CHECK}</condition>
</and>
</or>
A filter navigates from a certain context (the full model in the <starter> filter, or the starter set in the <propagation>) to find a set of model
entities matching certain conditions. A <propagation> element is essentially a filter that builds the propagated set from the starters set.
Syntax:
<filter
id='ID' ref='REF'
type='aql|groovy|byType|byKey|byName|byProperty'
description='DESCR' value='VALUE' resource='RESOURCE'
caseSensitive='false|true' property='PROPNAME'>VALUE</filter>
Note: Typically, starter filters and propagation filters use AQL. It is recommended to use AQL whenever possible, particularly in starter
filters, as the other filters must iterate on all model entities.
Actions
When a single model entity is found as starter, or propagated from starters, in one rule starter, the registered actions are executed on
that entity.
The optional <actions> element contain zero or more <actionBlock> (with active flag). Each <actionBlock> has zero or more <match>
subelements. Each <match> element (also with optional active flag) could have zero or more actions.
When the current rule / starter / propagation names match the <match> pattern and on attributes, the contained actions in the
<match> element are executed. pattern is a regular expression for checking the current propagation (
ruleName.starterName[.propagationName]) and on could be starter, propagated or all for matching entities in the starter or
propagated sets, or both cases.
Current actions implemented and supported in the XML are:
Note: Value could be coded either in a value attribute, or as text in the action element.
Actions have a type flag with two possibilities: fixed (the default) so the action value is taken as a literal, or dynamic so the action
value is considered a Groovy expression that will be executed to compute the value for the action.
First example is a simple dead code detection. Finds typical software 'entry points', and follow from them dependencies that mark
reached entities as used. At the end, entities of interest that are not reachable from the entry points are reported as "dead" (unused)
code.
<program name='DeadCode'>
<macros>
<macro name='MODULES'>'/ArchitectureViolations'</macro>
<macro name='NORMAL_PROPAGATION'>out[*]:component</macro>
<macro name='CLASS_PROPAGATION'>
out[*]:component |
in[*]%inherits:class/out[*]:component |
out[*]:component/in[*]%inherits:class/out[*]:component
</macro>
<macro name='APP_TYPES_TO_CHECK'>class,program,element,operation</macro>
<macro name='DB_TYPES_TO_CHECK'>table,view,sequence,storedProcedure,function</macro>
<macro name='SCHEMAS_TO_CHECK'>ArchitectureViolationsDB.*</macro>
</macros>
<starterCondition>
<description>Global filter that affects to every starter condition</description>
<condition id='app_filter' type='groovy'>o.software?.name in [${MODULES}]</condition>
</starterCondition>
<rules>
<rule name='j2ee'>
<starter name='ejb'>
<description>Any component used from an EJB's implementation class is used</description>
<filter>$var = //element[@j2eeType='ejb']; $var | $var/in:class</filter>
<propagation name='used from implementation class' active='true
'>${CLASS_PROPAGATION}</propagation>
</starter>
<starter name='webXml'>
<description>Any component used from J2EE elements (servlets, filters,
listeners)</description>
<filter>//configuration[@j2eeType='web.descriptor']/(class,element,page)</filter>
<propagation name='used from implementation class' active='true
'>${CLASS_PROPAGATION}</propagation>
</starter>
</rule>
<rule name='webService'>
<starter name='webService'>
<description>Anything used from a web service is used</description>
<filter>//webService</filter>
<propagation>${CLASS_PROPAGATION}</propagation>
</starter>
<starter name='webService operations'>
<description>Anything used from a web service operation is used</description>
<filter>//webService/operation</filter>
<propagation>${CLASS_PROPAGATION}</propagation>
</starter>
</rule>
<rule name='host'>
<starter name='jcl'>
<description>JCLs are considered entry-points here</description>
<filter>//program[@language='jcl' and @programType='script']</filter>
<propagation>${NORMAL_PROPAGATION}</propagation>
</starter>
</rule>
</rules>
<checkCondition>
<description>Which components in model to check for usages</description>
<or>
<and>
<condition ref='app_filter'/><!-- reuse filter -->
<condition type='byType'>${APP_TYPES_TO_CHECK}</condition>
</and>
<and>
<condition type='byType'>${DB_TYPES_TO_CHECK}</condition>
<condition type='inDatabase' caseSensitive='true'>${SCHEMAS_TO_CHECK}</condition>
</and>
</or>
</checkCondition>
</program>
Please note above the CLASS_PROPAGATION AQL traverse expression. Due to polymorphism in O-O languages, a
client class may reference another class using an interface, not the real implementation class. The client class may
receive a reference on the implementation to use via e.g. inversion-of-control (IoC) framework (Spring is a common
example of this IoC frameworks). This design pattern ("refer to interfaces, not to implementations") complicates
dead-code detection, as the implementation class may be used by another "client" class but there are no references to
the runtime implementation class in the client code. With IoC or certain object factories that dependencies on
implementation classes are hidden (this is one of the goals for IoC !). For dead-code analysis, it is conservative to
examine outward dependencies on subclasses that extend / implement a used interface or abstract class.
This shows how difficult may result traversing potential usages in software.
Example 2: Tagging
Classification of software entities (applications) according to the technology of the components they contain.
Classification of software entities into functional areas, and propagating the functional area to the contained components.
<program name='Tagging'>
<description>
Tagging propagation program example. You may define your own tagging rules
following the sample rules below.
</description>
<macros>
<!-- Replace -->
<macro name='APPS_TYPE_1'>'/ArchitectureViolations', 'app2', 'app3'</macro>
<macro name='APPS_TYPE_2'>'app4', 'app5'</macro>
<macro name='HOST_LANGUAGES'>'cobol','jcl','cl400','natural'</macro>
</macros>
<!-- You may optionally declare starter condition for tagging only part of the model -->
<rules>
<rule name='cleanup' active='true'>
<description>Trick: for cleaning previous businessArea and technology tags</description>
<starter name='cleanup'><filter>//software | //component</filter></starter>
</rule>
<rule name='technology'>
<description>Classify applications according to the technology it contains</description>
<starter name='java'><filter>//component[@language='java']</filter>
<propagation>in:software</propagation>
</starter>
<starter name='dotnet'><filter>//component[@language='csharp' or
@language='vbnet']</filter>
<propagation>in:software</propagation>
</starter>
</rule>
</rules>
<actions>
<actionBlock name='classify software' active='true'>
<match pattern='cleanup.cleanup' on='starter' active='true'>
<deleteTag pattern='businessArea:.*' /><!-- First clean previous tag values for business
area -->
<deleteTag pattern='technology:.*' /><!-- First clean previous tag values for technology
-->
</match>
The effect of the program is to give a businessArea:AREA tag to each software (and contained components) according to software
name, and a technnology:TECH tag / property to each software based on the type of components it contains.
Remember that rules are executed in sequence, and for each rule all propagation is done before processing the next
rule. The first cleanup.cleanup starter (and matching <match pattern='cleanup.cleanup' on='starter'>) are used to
removing tags and properties that will be recalculated later in the rest of the rules.
Imagine that, in a software system, there is a "layered architecture" divided in three layers: front-end, service and data access. The
architecture norms state that each component in a layer can only use components in the immediate lower layer. So front-end cannot
access data access, service cannot access front-end, and data access cannot access neither service nor front-end.
The dependencies in the AIM model could be examined following the above norms using this simple propagation program:
<program name="ArchitectureValidation">
<description>
Sample architecture norms that define illegal dependencies that should not appear in AIM
model.
At the end, detected illegal dependencies are reported. Additionally, illegal
dependencies could be marked in the model (property validation.tagPrefix).
</description>
<macros>
<macro name="PKG_BASE" value="com.optimyth.myapp."/>
<macro name="PKG_DAO" value="${PKG_BASE}dao."/>
<macro name="PKG_SERVICE" value="${PKG_BASE}service."/>
<rules>
<!--
NOTE: It is essential to use onEach=true for propagation elements below,
to process propagation on each starter entity individually.
-->
<rule name="layering">
<description>Describe illegal dependencies in the 3-level layer model</description>
<starter name="frontEnd">
<filter>${layer.frontEnd}</filter>
<propagation onEach="true" name="dataAccess" description="Illegal frontEnd -> dataAccess"
>
${usage.dataAccess}
</propagation>
</starter>
<starter name="service">
<filter>${layer.service}</filter>
<propagation onEach="true" name="frontEnd" description="Illegal service -> frontEnd">
${usage.frontEnd}
</propagation>
</starter>
<starter name="dataAccess">
<filter>${layer.dataAccess}</filter>
<propagation onEach="true" name="frontEnd" description="Illegal dataAccess -> frontEnd">
${usage.frontEnd}
</propagation>
<propagation onEach="true" name="service" description="Illegal dataAccess -> service">
${usage.service}
</propagation>
</starter>
</rule>
</rules>
</program>
AIM access control applied to data from models that a user can view.
Groups of resources that contain access to components have been defined, and subsequently, these groups of resources will be
allocated to users.
Users with administrator role will have full access to data of the different models regardless of whether the user has permissions
assigned or not.
To activate the access control is mandatory to set qs.activeAccessControl property from file
$CHECKING_DATA/config/plugins/APPMAP/appmap.user.properties to true. (Properties updated into this file require restarting the
server)
There are two possibilities to use the access control: by xml or web and database. This configuration is through the property
qs.typeAccessControl with two possibles values: xml or web. If the configuration is by xml, all operations in web will be ignored, and if
the configuration is by web all xml files are ignored.
Configuration by xml
aim.access.control.groups.xml
aim.access.control.users.xml
File aim.access.control.groups.xml
The aim.access.control.groups.xml file contains the configuration of the different groups of resources as well as global access control
settings. This file contains the following sections:
Tag default: Default value for users who are not in the configuration. Possible values are "all" or "nothing". "all" indicates that the
user will have full access to the model data and "nothing" indicates that the user will not have access to any data.
Tag allowedproperties: contains properties that will be visible from the elements to which a user does not have access (Properties
recid, name and dn always be visible).
Tag predicate: Indicates types and subtypes which will be considered for entities which will be accessed, i.e. these are the entities
from where the access will be given. An user will have access to entities that meet the corresponding aql is also a type or subtype of
those indicated in this property, the user will also have access to all the sons of these entities.
Tag groups: will have a list of groups, each of them with its configuration.
description: description
details: details
tags: tags
environment: environment
deleted: should delete this atom when updating model or not
domain: component domain
abstractionLevel: component abstraction level
classname: fully-qualified classname
programType: Program type
language: Implementation language
callType: Call type
artifacts: code artifacts
File aim.access.control.users.xml
The aim.access.control.users.xml file contains the relationship between users and groups. This file contains a list of users identified by
the checking login and each of them has a list of resource groups.
This relationship will be that give each user depending on the groups that have access.
<?xml version="1.0" encoding="UTF-8"?>
<access>
<!-- Each user groups -->
<users>
<user>
<id></id> <!-- User's login -->
<groups>
<group></group><!-- Groups that apply to the user -->
</groups>
</user>
<user>
...
</user>
...
<user>
...
</user>
</users>
</access>
Data visualization
Users who do not have full access to the model you are referring to will be dependencies between nodes if they have access, and nodes
which do not have access but the latter will not have all properties that have normally.
Properties that have the node that the user does not have access will be configurable with the exception of id, dn and name that will
always be visible.
Users who have access control may not download the appropriate model.
The xml files described above must be placed into sub-directories of:
$CHEKING_DATA/config/projectfiles
Configuration files that apply to each model are that they are following the structure of directories ascending from the directory of the
project until a configuration file is either reach the directory $CHEKING_DATA/config/projectfiles. In the event that there is no
configuration files, all users will have full access to the data of the models.
Users with administrator role will have full access to the data of the different models regardless of whether the user has
permissions assigned or not.
<!--
Properties to show for nodes that the user has not access. Id, dn and mane allways show in the
browser.
The properties that the user can configure are:
description: description
details: details
tags: tags
environment: environment
deleted: should delete this atom when updating model or not
domain: component domain
abstractionLevel: component abstraction level
classname: fully-qualified classname
programType: Program type
language: Implementation language
callType: Call type
artifacts: code artifacts
<!-- Types and subtypes for which access will be allocated (Separated with comma) -->
<predicate>
<types>software</types>
<subtypes>databaseInstance</subtypes>
</predicate>
aim.access.control.users.xml
<?xml version="1.0" encoding="UTF-8"?>
<access>
<!-- Each user groups -->
<users>
<user>
<id>user1</id> <!-- User's login -->
<groups>
<group>GROUP_1</group>
<group>GROUP_2</group>
</groups>
</user>
<user>
<id>user2</id> <!-- User's login -->
<groups>
<group>GROUP_2</group>
</groups>
</user>
<user>
<id>user3</id> <!-- User's login -->
<groups/><!-- User without access to any model -->
</user>
</users>
</access>
Configuration by web
To access the web administration you have to go to the tab plugins, select the APPMAP plugin and, subsequently, press the button "
Configuration".
For access to the administration of AIM access control you have to press this button. When press this button a new window will be
shown with the next interface:
There are two tabs: the first tab contains the access of the user by groups. and the second tab is the administration of groups.
Manage groups
To manage the groups must press in tab Access groups and show next interface:
Add group
To add a group you have to press the button "Add" and will be displayed the next panel:
The fields in this panel are:
Project: Project of the group. All child projects of this project that have not associated a group apply this group.
Access for users without this group: For all or users that have not associated to this group will have access to all or nothing
depends on the selection.
Name: Name of the group.
Description: Description of the group.
AQL: AQL to identify components to access. This components will be software or databaseInstance components.
Models of the group: In this section affected models by the group are specified being able to put regular expressions for example
.*/Model_.*
For add models to the group, you have to fill the text field and press the icon plus.
To choose the project and model, there is a folder icon. Click on one of them, a tree panel will be shown to choose a project or model.
Modify group
To modify a group you must select the group in datatable and press the button "Modify". This action will showed the same panel that add
a group but with the fields filled.
Delete group
To delete any group you must select one or more groups and press the button "Delete". If there are user associated to any group will
showed a message with this information. If you press yes groups will be deleted and if you press "No" the action will be cancelled.
In the left part there are a tree of users by role. To admin user access you must select any user in this tree.
When you select any user the table will be loaded with the groups of this user.
Add groups to user
To add groups to user you must press the button "Add" and will showed the panel with the available groups:
To add groups you must select the groups in datatable and press "Add".
To delete user groups you must select the groups to remove and press the button "Delete".
To modify groups and users group by xmlrpc aim has next interface to this.
To activate, go to admin (you must be logged as administrator), and in the configuration tab, set the xmlrpc.active property to true:
Service description
Add group
add group
attribute description
Executing by ANT
targets
addGroup name (name of group), project (Project of group), defaultValue (Default value: all or Add group to
nothing), description (Description of group), aql (AQL of group) batabase
Examples:
Elements
APPMAP plugin. A plugin deployable in a ChecKing system, containing all the elements needed for software inventory operations.
Include scripts for model building and configuration discovery, among others.
AIM Query Service. A centralized query service that the APPMAP plugin starts during plugin initialization. This service opens two
TCP ports, a management port and a service port. Clients and administrative points use those ports to communicate with the Query
Service.
AIM - Application map Browser, end-user graphical console for operations on AIM models. The browser connects to AIM Query
Service, but it could operate in "disconnected mode" and open AIM models stored in local filesystem.
AIM - Scripting, a set of scripts and libraries for connecting with AIM Query Service and performing operations on the application
inventory models.
The following image shows the top-level architecture of the AIM system:
Purpose
This document is a quick guide for developing custom rules for application portfolio extraction from code and other artifacts.
Application Portfolio provides an extensible framework for automated extraction of entities (organisational and software-related) and their
relations, for compilation of an application map, to be used by different checKing plug-ins.
The framework is based on a set of BuilderRules, that may perform different tasks:
To create portfolio entities (organisational or software-related) and resolve their mutual relations.
To check if the software artifacts are compliant with architecture standards.
To detect potential architectural anti-patterns (smells).
To resolve the group of code artifacts that are logically related to software entities in the application map, for later analysis.
A BuilderRule is an unit of logic that may perform any of the above tasks.
The generic portfolio model framework is provided as a java library inside the APPMAP plug-in (PortFolioModel*.jar). This framework
contains:
ModelBuilders, that will perform the application map extraction (the default DefaultApmModelBuilder suffices for most
needs).
BuilderRule, with many standard implementations for common situations. Many rules are provided within the framework (for
example, TooMuchCouplingValidationRule will detect coupling anti-patterns in the application map). Organisations may
program their own BuilderRules if necessary.
Model classes, for representing organisational and software-related entities and their relations (see com.optimyth.apm.model
package in distributed JavaDocs for full details). The standard entities are Organization (a company or an external organisation
etc.), Unit (for modelling an area or department), Person (for modelling people), Software (for modelling any software system)
and Component (for modelling any software component, like a program, database table or business process etc. that should be
included in the application map). Those entities have arbitrary properties (values with a certain type) for representing any entity of
interest.
Persistence facilities, for making persistent the application map into a certain repository (a default database schema is provided and
persistence engine is included in the distribution, but organisations may provide their own persistence engines, for example for
populating an external CMDB system or their own software assets repository).
Each company may add its own custom extensions on the above facilities, to reflect the particular features of its
organisation. For example, to analyse custom frameworks, extract organisational dependencies from an external
system (like a Source-Control tool or an LDAP directory), or to check if existing code complies with architectural rules.
The generic framework provides different ModelBuilders. Currently the only one used is the DefaultApmModelBuilder class.Every apm
model builder needs:
parsersRegistry: a bean defining parsers of languages that are being analysed by app map. A QakingFileParserAdapter class
adapt QAking parsers (Cobol, java, JavaScript, C#, VB.net, JSP, PLSQL etc.) to this framework. Specific apm parsers can be
loaded.
ruleset: an apm ruleset with model builder rules used to generate the company's model.
reportRenderer: renderer classes to dump the information. Currently XmlBuilderReportRenderer and HtmlBuilderReportRenderer are
supported.
fileFilter: java.io.FileFilter to use when deciding which directories/files to process (defaults to all files/directories).
This configuration is defined in the APPMAP plug-in scripts/resources/apm-modelbuilder.xml configuration file (a Spring XML
descriptor that configures the model building process).
First,a BuilderContext is initialised (you can register in the bean "apm_modelBuilder" a custom ModelBuilderListener to add extra
logic). See the ModelBuilderListener javadoc for more information about the implementations of this interface. By default a dummy
Listener is created.
The BuilderContext is started by defining the apmmodel that is being generated as well as the ruleset that will be applied. If
you have defined a listener then it is notified of that event. The model statistics then start to collect information.
Then, all the defined client rules are initialised by the BuilderRuleset. This implies that all defined (and active) builder rules execute
its initialize() method (once).
For each basedir defined in config files (typically apm-modelbuilder.properties), all files beneath it are traversed (recursing
through subfolders) and for each file found, each BuilderRule is run on this file (if matching the rule filter).
After all basedirs are processed, the postProcess(BuilderContext) method for each rule is invoked. This can be useful when
you want to make a rule that may need information compiled from various rules, or data that can only be estimated once all files
have been traversed.
Anatomy of a builder rule
All builder rules must implement at least the com.optimyth.apm.builder.rules.BuilderRule interface. Typically a base
AbstractBuilderRule class provides a basic implementation that could be extended.
In what follows, PLUGIN_EXTENSION_DIR is the directory where APPMAP extensions are located (
CHECKING_DATA/config/plugins/APPMAP).
Software technology could be very complex, and that complexity affects AIM configurations for real software systems. Some platforms
(think on J2EE, .Net, complex database code, or legacy systems) typically combine multiple programming languages, with different
configuration descriptors. The layout for a real-world software system could be fairly complex.
To improve modularity in configuration, AIM defines a set of AIM configuration blocks by technology. An AIM configuration block is
present for each technology/subtechnology supported (e.g. the block j2ee/ejb represents the configuration rules for modelling EJB
entities and relations for a J2EE-based system).
common: Contains common elements, used by the rest of the AIM configuration blocks.
abap: Rules for ABAP.
actionscript: Rules for ActionScript.
cpp: Rules for C/C++.
database/database: Rules for analyzing extracted schema descriptors (generic or database-specific).
database/plsql: Rules for Oracle PL/SQL technology.
database/transactsql: Rules for Microsoft SQL Server (Transact-SQL) code.
dotnet/dotnet: Rules for .Net languages (C#, VB.NET), excluding ASP.NET-specific artifacts.
dotnet/aspnet: Rules for ASP.Net technology.
html/asp: Rules for Microsoft ASP 3 technology.
html/html: Rules for static HTML code.
j2ee/java: Rules for Java code (not framework-specific).
j2ee/jdbc: Rules for analyzing embedded SQL code in Java classes using JDBC API.
j2ee/hibernate: Rules for analyzing Hibernate persistence descriptors.
j2ee/ibatis: Rules for analyzing Ibatis persistence descriptors.
j2ee/jsp: Rules for JSP / JSF pages and related web resources.
j2ee/spring: Rules for analyzing Spring framework (beans, Spring WebFlow)
j2ee/ejb: Rules for analyzing EJB code.
j2ee/struts: Rules for analyzing Struts code.
j2ee/weblogic: Rules for analyzing Weblogic code.
j2ee/webservices: Rules for analyzing WebServices code.
legacy/cl400: Rules for IBM ILE (OS/400) CL scripting language.
legacy/cobol: Rules for Cobol language and related technology (CICS, embedded SQL).
legacy/jcl: Rules for IBM JCL (Job Control Language).
legacy/Natural: Rules for Software AG Natural code (and Adabas).
legacy/rpg: Rules for RPG code.
php: Rules for PHP code.
validation: Rules for architecture validation and detection of dependency anti-patterns.
vb: Rules for Visual Basic code (up to VB 6).
Each configuration block is composed of a generic XML descriptor (Spring), tech/aim.subtech.xml, and a
.properties file (tech/aim.subtech.properties) that configures the beans declared in the XML file. For simple software layouts, it
could be sufficient to select the different technologies present in software, and edit the properties for each AIM configuration block.
For each configuration block, its .properties file is included (under tech/aim.subtech.properties). There is a default configuration
(named DEFAULT, which should not be modified) that contains all the AIM technology blocks as well as some engine files. A user
configuration inherits these configuration, unless it redefines a particular file. This simplifies configuration.
In the AIM TASK - Analyze the name of the configuration could be specified when analyzing a software system with a matching layout
for the configuration. You may define multiple configurations for the different software layouts,
and reuse them when analyzing multiple software systems.
To help building the AIM configuration for model building, the configuraton discovery task provides a mechanism to generate an initial
configuration (based on AIM configuration blocks), analyzing one or more input directories (e.g. with source code for a software system
with a certain layout). The generated configuration (under PLUGIN_EXTENSION_DIR/configurations/CONFIG_NAME) could be
edited either manually or using provided editor.
The discovery of custom entities and relationships (if not already supported by any of the provided standard discovery rules) can be
done by implementing custom discovery rules that will analyse the input artifacts (e.g. source code files), identify the model entities,
properties to add to model entities, and their dependencies, and update the current model in the discovery engine. Typically you will add
such custom rules (and configuration items like filters) to the Spring apm-rules.xml configuration file, and reference the rule in the
apm-modelbuilder.xml main Spring descriptor.
This is the responsibility for the rule itself. The input to the rule (held by the BuilderContext passed to rule methods) is typically a
BaseNode AST (root node) (provided by a com.optimyth.apm.builder.parser.QakingFileParserAdapter), an ASM
ClassNode (provided by the com.optimyth.apm.builder.parser.JavaBytecodeFileParser), or anything else provided by
other com.optimyth.apm.builder.parser.FileParser implementation).
For the rule, you may implement the com.optimyth.apm.builder.rules.BuilderRule or extend from the base
com.optimyth.apm.builder.rules.AbstractBuilderRule.
For discovery logic for each processed input artifact, implement the rule's void run(BuilderContext ctx) method (or
AbstractBuilderRule's void visit(BuilderContext ctx)).
Sometimes you need to "remember" certain results that should be post-processed when the engine has visited all the input artifacts. You
may specify rule's post processing logic in the void postProcess(BuilderContext ctx). For example, you may need to
remember "calls" and resolved the remembered calls to relationships between model entities only at the end, when all entities are built in
the model.
The rule, when it detects a construct that should be modelled in the application portfolio in a certain way, it may delegate the modelling
logic to an external callback class, that provides callback methods ("event handlers") with the extracted information from the rule. With
this design, you are separating navigation and analysis on the input item from entities/relations modelling. Define an interface (e.g.
MyArchitectureFrameworkCallback) and provide onEVENT(... args ...) methods that will be invoked by the rule at the
points where something of interest for the model is found in the input item.
The implementation of your callback interface may extend the com.optimyth.apm.builder.RuleCallbackBase, that provides
basic facilities for registering a model helper (see below).
The callback above described may delegate to another component, the ModelHelper, the instantiation of APPMAP model objects
(entities, properties, relationships). Typically this logic could be reused by different callbacks (in fact, a base
com.optimyth.apm.builder.rules.model.ComponentsHelper) is provided, with methods for building some common cases. It
may extend that class to add additional methods).
For logging, APPMAP uses Apache Log4j. You may log errors and traces etc. using code like this, in your rule,
callback or model helper items:
Structure of apm-modelbuilder.xml
<xml declaration>
<Doctype>
<beans>
<property files declaration>
<apm_modelbuilder bean>
<apm_parsersRegistry>
<apm_ruleset>
<rule beans>
<..>
<file filter beans>
<apm_report_renderer beans>
<renderer bean>
<..>
<auxiliar beans>
<import of other files>
</beans>
For modular configuration, typically specific model building beans are configured in separate Spring
descriptors, that are imported from main apm-modelbuilder.xml. Common specific descriptors are:
apm-rules.xml, where each rule (discovery, architecture validation or antipattern detection etc.) is
configured.
apm-persistence.xml, where the persistence managers for the discovered model are configured.
apm-qaking.xml, with configurations for the parsers for each language/technology, that will provide
parsed content to rules.
apm-script.xml, with configurations for the scripts, that may be used from the batch interface for different
operations on extracted APPMAP models.
Property files declaration and apm_modelbuilder bean
The apm_modelBuilder bean defines the DefaultApmModelBuilder class and its sets of properties (parserRegistry, ruleset,
reportRenderer and the optional modelBuilderlistener)
Define the builder Ruleset with a list of rule beans, injecting different properties if needed.You can override the filter property if you want
to use a custom file filter instead of the "AllFileFilter" class.
apm_report_renderer bean
There are three kinds of BuilderReportRenderer. They need outputFule as the property to inject.
XmlBuilderReportRenderer - Dumps Application Map building report (see javadoc for more information).
HtmlBuilderReportRenderer - Dumps report in HTML format using a builderReport.template file
CompositeReportRenderer - Composite ('fan-out') BuilderReportRenderer.
Rule's structure
Rules can have several properties needed to perform their tasks; some of them can be references to other specific objects also declared
in spring files. These special objects are grouped by:
filters
callbacks
resolvers: the logic to resolve external references to external resources as programs, includes, images and so on.
Validation Rules
These are BuilderRules focused on checking if the analysed software artifacts comply with the architecture standards. Typically they
provide its logic on the postProcess() method (where the full software entities are already extracted). They look for global information
within the model. For example, for each Component in the ApmModel they look at the number of their outgoing relationships to
determine if it is too high and then emit a "smell detection" to include in the report. This smell is included as a architecture violation in the
final report.
Below is an example:
Any JKQA rule can be wrapped by QakingValidationRuleAdapter and be included as a ValidationRule. If you find JKQA rules
to be suitable to form an "Architecture rule", just declare it wrapped into this class:
apm-qaking.xml
For enhaced modularity, you may place such definitions in the imported apm-qaking.xml file:
amp-modelbuilder.xml
DeclarativeValidationRule
Instead of implementing (in Java) a ValidationRule, the DeclarativeValidationRule could be used. This rule uses a domain-specific
language (DEPVAL for short) to define software architecture compliance rules, and could be configured as in the following example:
// Checks if any component tagged CO uses any component tagged as BU-specific, which is
forbidden by architecture rules
rule(name: 'CO2CO', description: 'CO artifact calling BU-specific artifact is forbidden') {
deny {
from(aql: ".['CO' == @tags]");
// See how to ignore outgoing usages of a set of components
to(aql: "component[#!['app=MODULE,prog=IS.D'].contains(o.key)#][@tags and @tags != 'CO']")
}
}
// Checks if any BU-specific component uses any component tagged for a different BU,
which is forbidden by architecture rules
rule(name: 'BU2sameOrCO', description: 'BU-specific artifact using other BU artifact is
forbidden') {
deny {
from(aql: ".[@tags and @tags != 'CO']");
to(aql: "\$tag = ./@tags; component[@tags and @tags != 'CO' and @tags != \$tag]")
}
}
// Checks for COPYs that are not included in any other program. Uses specific Groovy
logic (checkEntity)
rule(name: 'Unused COPY', description: 'Every COPY should have incoming deps from Cobol
programs',
message: '${rule.description}: ${source}',
checkEntity: { entity, ctx, rule ->
def progType = entity.getPropertyByName('programType').value;
if('COPY' == progType) {
// If no incoming usages from other programs: 'dead code' COPY
return null == entity.parentComponents.find{ parent -> 'program' == parent.componentType.name }
}
return false;
}
)
}
We try here to explain one of the most complicated rules in AIM, rules for object oriented languages (i.e. Java, C#, VB.NET, ABAP)
CSharpClassRule is an AbstractTypeResolverRule (which extends AbstractClassRule, the base for all the rules for OO
languages).
AbstractTypeResolverRule uses a TypeResolver, a class devoted to resolve found types: given the namespaces found in the
analyzed classes, the type resolver identifies which is the referred class. In our example, there is a TypeResolverDotNet, which uses
a descriptor of .NET framework classes. This descriptor can be generated also from custom DLLs (see utility "DllTypeExtractor.exe",
included in QAKing).
The class ClassDepsResolver instead, resolves candidate dependencies into APM model's components and relations: the rule
searches the AST, finding possible dependencies with candidate types, while the ClassDepsResolver solves those dependencies:
Java example
A.java
B.java
C.java
Analyzing A.java, we find a use of C class into its code... we still didn't find any C class, so AbstractClassRule stores
that "use candidate". When the rule finds C class, then the Deps resolver decides if it must add or not those
components and relations to the model.
Note: deps resolver needs then a reference to the callback, the only class that is supposed to modify APM model.
ExistingClassDepsResolver - This class deps resolution strategy will generate component for any class parsed in the model, and
relations between pairs of classes when both are present in the model. So this automatically skips any class declared in artifacts not
analyzed during model building.
Properties:
classnameFilter
un Predicate<String> que macheará las clases a descartar, por considerarse que forman parte del marco estándar y que no
deben reflejarse en el modelo). Por defecto es Predicate.JDK_FILTER, puede usarse para CSharp
Predicate.CSHARP_FILTER (o Predicate.VBNET_FILTER para vb.net)
callback
ClassCallback used to insert entities (software and components) into APM model
MatchingPkgClassDepsResolver - Matches dependencies using two Predicate injected at classnameFilter and predicate properties.
Properties:
classnameFilter
is used to skip classes that should be ignored (e.g. JDK or .NET framework).
predicate
is used to accept only the classes matching the predicate.
callback
ClassCallback used to insert entities (software and components) into APM model
ClassCallback
This class is will receive events that process classes in any OO language, deciding what to do whenever these events occur.
The same callback can be used and injected into the rule and the deps resolver.
Manually register the application name: all components will belong to given Software
Use a SoftwareResolver to know which application (Software) is Component container
This is useful when the application name is specified in files like web.xml, web.config or .csproj/.vbproj
ApplicationRegistrySoftwareResolver: looks into applications previously discovered by other rules like DotnetProjectRule (and
maintained in a ApplicationRegistry)
WebAppSoftwareResolver: resolves the software looking at webApps resolved by WebAppBuilderRule which analyzes web.config file
(ASP.NET)
To decide whether a rule should be custom or not we must take into account the following:
Is it a case of technology standard?: in case of not being the technology standard will be a rule customized.
It is standard technology and product rules solve it correctly but it is not the desired model?: If the technology standard and is not a
bug in the product will be a rule customized.
This section describes best practices to follow when it comes to rules of product customizations.
To the overwrite a method of a class to always put the label @Override. It should change the signature of the method it will fail to
compile.
To the extent possible make a call to the superclass method since logic can change between versions.
If you want to overwrite a product bean, i.e., define a bean's spring custom with the same name that product should be checked in
every version change if there are new properties in the bean overwritten in case of ignoring them can get unexpected results or even
errors.
When you create a bean extending one product use the parent attribute in the definition of spring and if there are properties that are
added to the existing bean this will be transparent to the customization.
For example:
aim.custom.xml
Accessing nodes in the AST avoid the use of methods such as child (0) as possible changes in the AST can cause unexpected errors,
so it is advisable to use methods such as child("node name") or find("node name").
Recommendations
As recommendation is a good practice to have available unit testing of each rule customized to be able to launch them in each version
that you want to implement, so it can detect errors as soon as possible.
Purpose
To help setting up the configuration for building an application map model, this task provides a discovery tool that generates
an AIM configuration from one or more source code directories. The generated configuration could be later refined and executed
using the AIM TASK - Analyze over a software system with a layout similar to the one analyzed during discovery.
The APPMAP plugin APPMAP/script/discovery script could be launched from the checKing web interface. Alternatively, you may
execute from command-line the script directly:
In either case, the discovery task takes a comma-separated list of directories with software source folders, and discovers automatically
which technologies should be applied, generating configuration files for them.
How it works
The discovery engine uses a set of discovery rules, tailored for discovering code artifacts (source code, configuration descriptors,
application content...) and generating configuration blocks for each technology discovered. The rules are defined in the
CHECKING_DATA/plugins/APPMAP/configurations/modelbuilder/DEFAULT/aim.discovery.xml, but typically the
provided configuration (for the supported technologies in AIM) does not need to be modified.
Configuration
config.dir (optional, only available via command line) configuration output directory
If the configuration specified already exists, it is augmented with the new technologies discovered, if any.
Results
The task execution shows the discovered technologies and the count of elements found:
discover:
[aim.discovery] Technologies discovered: common/common,j2ee/java,j2ee/jdbc,j2ee/spring
[aim.discovery] Technology: j2ee/java
[aim.discovery] file: 36
[aim.discovery] Technology: j2ee/spring
[aim.discovery] configuration: 9
[aim.discovery] element: 49
[aim.discovery] Matched files: 45
[aim.discovery] Ignored files: 241
BUILD SUCCESSFUL
Total time: 1 second
Overview
Configuration
Startup / shutdown
Service Management
Query server: com.optimyth.aim:type=queryServer
Query service: com.optimyth.aim:type=queryServer,module=queryService
Statistics: com.optimyth.aim:type=queryServer,module=queryService,data=statistics
TheadPool: com.optimyth.aim:type=queryServer,module=threadpool
SessionManager: com.optimyth.aim:type=queryServer,module=sessionManager
Logging: com.optimyth.aim:type=Logging
Query Service API
Query Service URL
Additional client configuration
Authentication (session open) and session close
Operations
Technical notes
Overview
The AIM Query Service is a centralized service that APPMAP plugin starts during plugin initialization. This service is not running on the
webserver itself, but it's on a different process: a stand-alone server.
This server opens two TCP ports, a management port and a service port. Clients and administrative tasks use those ports to
communicate with the Query Service and perform operations on existing models, generated by the AIM TASK - Analyze.
AIM - Application map Browser, end-user console for analyzing model dependencies.
Scripts that perform operations (query, tagging, analyzing arquitecture rules...) on existing AIM models.
Third-party applications that use the AIM Query Service API (see below) for interacting with existing AIM models.
Client access is validated in the service using the credentials (e.g. username/password) for checKing accounts.
Configuration
The service configuration parameters are stored in the appmap.user.properties file, stored in the plugin extensions dir
CHECKING_DATA/config/plugins/APPMAP. The following properties are relevant for Query Service:
qs.querytimeout configure timeout that is set in the client and server 300
qs.modelsDir Path where models are stored (do not change in normal usage) CHECKING_DATA/plugindata/appmap
qs.maxResults Max results size (set to a number, e.g. 10000, to avoid collapsing -1
service with large resultsets)
Note: It is recommended to stop the service before changing any of these values.
Startup / shutdown
APPMAP plugin starts automatically the service during plugin initialization, and shuts down the service during plugin termination.
Although not necessary in general, the service could be started/stopped manually using the run-queryserver.xml script located in
PLUGINDIR/scripts.
Examples:
start:
[echo] + ---------------------------------------------------------
[echo] + Query Server v0.1 - (c) Copyright by Optimyth 2012
[echo] + ---------------------------------------------------------
[echo] Starting the server...
[server.task] [2012-05-17 11:38:15] AIM QueryService contacted successfully: localhost:7890
ping:
[echo] + ---------------------------------------------------------
[echo] + Query Server v0.1 - (c) Copyright by Optimyth 2012
[echo] + ---------------------------------------------------------
[echo] Pinging the server...
[server.task] [2012-05-17 11:38:15] AIM QueryService contacted successfully: localhost:7890
ant -f run-queryserver.xml stop
stop:
[echo] + ---------------------------------------------------------
[echo] + Query Server v0.1 - (c) Copyright by Optimyth 2012
[echo] + ---------------------------------------------------------
[echo] Stopping the server...
[server.task] [2012-05-17 11:39:27] AIM QueryService localhost:7890 successfully stopped!
Service Management
Besides startup / shutdown, the service management interface is exposed via JMX (Java Management eXtensions) agent.
External JMX-enabled tools, like jconsole or jvisualvm (provided with Oracle Java Runtime), could connect to the management
port.
JMX management interfaces (beans) are exposed by query server for monitoring and/or live configuration changes. The beans could be
seen in the JMX management console:
All JMX beans exposed are placed under the com.optimyth.aim domain.
Represents the query service. Child nodes (queryService, threadpool) expose management interfaces for the underlying query service
and supporting thead pool.
This bean exposes management interface for the service that responds to requests.
MaxResults int Max number of results to return (-1 means "no limit")
Statistics: com.optimyth.aim:type=queryServer,module=queryService,data=statistics
This entry provides statistics for operations served since last startup.
TopN int Max number of top-N operations to remember, by time and result size
TheadPool: com.optimyth.aim:type=queryServer,module=threadpool
This entry provides a management interface for the thread pool that serve requests in query server.
KeepAliveSeconds int Number of seconds an idle thread will be kept (above CorePoolSize)
before been removed from pool
MaxPoolSize int Maximum number of threads that will allowed in pool (must be non less
than CorePoolSize)
PoolSize int Number of threads in pool (read-only)
ThreadPriority int Priority for threads in pool (between 1=lowest and 10=highest)
changeQueueCapacity void changeQueueCapacity(int Queue capacity for holding pending tasks, when no idle threads available
queueCapacity) in pool
Normally this settings should not be changed under normal circumstances. The MaxPoolSize property could be configured in the
qs.maxthreads property
of the appmap.user.properties configuration file.
SessionManager: com.optimyth.aim:type=queryServer,module=sessionManager
Expose statistics for the session service (authentication in query server is done using ChecKing identities).
Timeout int Timeout (in milliseconds) for authentication operations against checking server
Logging: com.optimyth.aim:type=Logging
Represents query server logging system. This management interface permits live changes on the logging configuration.
getLevel string getLevel(string logger) Get logging level for the logger item
setLevel void setLevel(string logger, string level) Set logging level for logger item
configure void configure(string) Configures logging (properties text or path to .properties file)
deactivateLogging void deactivateLogging(string logger) Deactivate logging for the given logger
openLogHub void openLogHub(int port, string format) Create a log hub (server where log collectors can connect)
The com.optimyth.apm.query.client.IQueryClient interface provides access (from Java) to a remote AIM Query Service. API
classes are located in the QueryService.jar (located in PLUGINDIR/lib directory or in the distribution media). You may need other
JARs in runtime (libthrift-*.jar, for example).
To specify the service endpoint, a URL could be used, with the following syntax:
aim://[username[:password]@]host[:port][/modelLocation]
Example:
aim://administrator:adminpwd@checkinghost:7890
The authentication credentials (username and password, credentials for checKing accounts) and model location are optional. If port is
not specified, the default 7890 service port is used.
import com.optimyth.apm.query.client.*;
...
IQueryClient client = new QueryClient();
client.setUrl("aim://user:pwd@localhost");
...
If the credentials are not coded in the URL, they must be set via API:
import com.optimyth.apm.query.client.*;
import com.optimyth.apm.query.service.*;
...
IQueryClient client = new QueryClient();
clinet.setCredentials(new Credentials("user", "pwd"));
client.setUrl("aim://localhost");
...
The query client has a timeout (30 seconds by default) that, when exceeded, shuts down a running operation. Sometimes, for
long-running operations, you may need to increase the timeout:
See the JavaDoc for the QueryClient class for full details.
The login() and close() methods create an authenticated session and terminates current session, respectively. It is recommended
to call close() in a finally block to ensure that session termination is attemped even in case of exceptions:
} finally {
client.close();
}
Operations
As most of the operations work on a particular AIM model, you must typically specify the relative path to the model before executing any
operation:
/**
* Executes a remote query, using model as starting context.
* @param aqlQuery
* @return
* @throws QueryServiceException
*/
List<Atom> query(String aqlQuery) throws QueryServiceException;
/**
* Executes a remote query, using given entity as starting context.
* @param aqlQuery
* @param ctxEntityId
* @return
* @throws QueryServiceException
*/
List<Atom> query(String aqlQuery, long ctxEntityId) throws QueryServiceException;
/**
* Executes a remote query, using given entities as starting context.
* @param aqlQuery
* @param ctxEntityIds
* @return
* @throws QueryServiceException
*/
List<Atom> query(String aqlQuery, List<Long> ctxEntityIds) throws QueryServiceException;
/**
* Executes impact analysis, using AQL for sources and targets
*/
ImpactAnalysisResult impactAnalysis(ImpactAnalysis analysis) throws QueryServiceException;
/**
* Executes impact analysis with intermidiate paths, using AQL for sources and targets
*/
String execImpactAnalysisWithPaths(ImpactAnalysis analysis) throws QueryServiceException;
/**
* Executes impact analysis with intermidiate paths, using AQL for sources and targets
*/
List<ImpactGraph> getImpactAnalysisWithPaths(String queryId, String modelId) throws
QueryServiceException;
/**
* Performs tagging in an AIM model, according to the TagOperation
*/
void tag(TagRequest tagOp) throws QueryServiceException;
/**
* Performs diff on a pair of models, returning the differences as a DiffResult
*/
DiffResult diff(DiffRequest diffReq) throws QueryServiceException;
/**
* Validates dependencies in model, looking for violations on validation rules
*/
List<Violation> validate(ValidationRequest req) throws QueryServiceException;
See JavaDoc for full details on the objects seen in the method signatures. Please note that some IQueryClient methods are used by
APPMAP Browser and are not of interest for typical usage of this API.
Technical notes
AIM Query Service uses Apache Thrift for service protocol implementation. This means that clients use TCP connections, which are not
compatible with web (HTTP) proxies that could be placed in the middle. APPMAP Browser supports a 'model download mode', when a
web proxy in the middle is the unique network path for accessing checKing server, that downloads the model datafiles via HTTP to the
browser's local filesystem, but other clients need direct TCP connection to the service port. Remember to contact your network
administrator to enable network access to the service port (with firewalls and other network access control devices).
Please, be careful with ant version. Version tested and supported to run AIM and Query Service, is ant-1.7.0.
Overview
Programming custom scripts
Overview
For integrating AIM in other applications, AIM provides a library (AIM Scripting API) for performing operations on remote AIM models,
that operate with connection to the AIM Query Service. This AIM Scripting API is built on top of the
com.optimyth.apm.query.client.IQueryClient (see Query Service API for full details).
For Java, the library JAR is named Scripting.jar and contains client-side classes for using programmatically
existing scripts or implementing your own. You probably need other dependencies, like QueryService.jar or
libthrift-*.jar, that could be located in the plugin lib directory or in the distribution media.
package com.optimyth.apm.scripting;
/**
* Executes an operation (typically in remote models via AIM Query Service).
* @param ctx ScriptContext
* @throws ScriptException if there was a problem when executing the operation
*/
public void run(ScriptContext ctx) throws ScriptException;
There is a base abstract class com.optimyth.apm.scripting.AbstractScript that could be extended for implementing your
own script (in Java).
API elements
Propagation Analysis provides a Java API for executing analysis. The main class is the PropagationEngine, that will process a
program XML descriptor from a resource, with a proper PropagationListener that will be notified when an AIM model entity is
traversed (as starter or propagated) in a propagation rule described in the XML program descriptor.
You may use this API in many places (custom scripts, rules, etc.).
Note: All classes in the API are located in the com.optimyth.aim.propagation package, in the PropagationAnalysis.jar.
For full details, refer to the JavaDoc for the PropagationAnalysis module, included in the product distribution.
PropagationListener will receive notifications (calls to its onXYZ() methods) of the stages in propagation analysis, and on the starters and
propagated items found. The listener then performs an appropiate action in these event notification methods. This is where the
processing logic of interest is encoded (propagation itself is generic and it is managed by the PropagationEngine).
PropagationEngine will parse the XML program descriptor, invokes listener's onStart() and launch all rules declared in sequence.
For each rule starter, the actions are executed, and onStarterItem() on listener is called.
After processing all starter entities in the current starter, propagations are launched for the starters set in the containing starter, and for
each entity visited by current propagation, actions are executed, then the onPropagatedItem() method is invoked.
When all rules are processed, the engine calls onEnd() on the listener (many listeners report the results of the analysis here).
The following example uses dead-code analysis with a tag marker reporter, by extending AbstractPropagationAnalysisRule,
which exposes some abstract methods (buildListener()) that could be overriden to return the appropiate PropagationListener
for the analysis (and where reporters could be configured). Nothing more is needed to have a builder rule based on propagation
analysis.
package myPackage;
import com.optimyth.aim.propagation.engine.PropagationContext;
import com.optimyth.aim.propagation.engine.PropagationConstants;
import com.optimyth.aim.propagation.listener.PropagationListener;
import com.optimyth.aim.propagation.deadcode.*;
import com.optimyth.apm.model.ApmAtom;
import com.optimyth.apm.model.ApmEntity;
Purpose
This document is a quick guide in order to know how to extend product softwareResolvers for specific behavior on client installations.
Application Portfolio provides a set of product softwareResolvers, but depending on client requirements these product ones could not fit
on client scenario.
For any new particular softwareResolver we are going to explain how to setup them, avoiding to edit any product configuration.
Extending SoftwareResolver
Once we have created a java class for our specific softwareResolver implementing
com.optimyth.apm.builder.rules.common.appresolution.SoftwareResolver interface, we should package it in a JAR file, and place this
JAR file into PLUGIN_EXTENSION_DIR directory, which is the directory where APPMAP extensions are located ($
CHECKING_DATA/config/plugins/APPMAP)
JAR file must contain a META-INF directory, and we must place there the XML descriptor file for our specific softwareResolver named
aim.resolvers.descriptor.xml. AIM will use this XML descriptor in order to create dinamically the defined software resolvers, adding them
to the application's context.
<xml declaration>
<resolvers>
<software-resolvers>
<resolver>
<name>
<description>
<properties>
<resolver>
</software-resolvers>
</resolvers>
Once we have declared properties specific softwareResolver is going to use, we can setup values within aim.common.properties file.
This properties can be refered by software resolver key declared in descriptor file plus property id
(i.e.: aim.common.appresolver.single.softwareName)
Apart from above configuration we must add declared key of our specific software resolver in aim.common.properties file editing list of
aim.common.resolvers property
Software resolvers extension logic does not support Maps on properties as Spring. This type may be defined as a list of
values separated by a token, and then treat values on specific software resolver in order to map them into a specific
map.
API Home
The following pages are technical documentation about AIM rules; They are generated automatically from source files to
extract all relevant information. It's not intended to replace javadoc pages; these are usefull in order to help in
customers' configuration processes instead javadoc, used to enchance AIM's API.
RuleCallbackBase
Class RuleCallbackBase
Structure
Methods Summary
Class RuleCallbackBase
RuleCallbackBase - Extend your callbacks with this class to benefit from some handy methods.
Structure
Methods Summary
helper
SoftwareResolver that may be injected to return the Sofware where the components returned by this callback will be placed.
public void setDatabaseObjectResolver(rules.common.dbresolution.DatabaseObjectResolver
databaseObjectResolver)
The database object resolver to use for finding mapped database objects. When set, dbType / dbName are used as fallback if the
resolver does not match the target table.
The name of the containing software, to use as fallback if no explicit or global software resolver can resolve container for artifacts
The software type (default: "application"), to use as fallback if no explicit or global software resolver can resolve artifact
Override SoftwareResolver: this is the old (default) behavior for some webapp rules, where these detection is embedded, and
they use the default resolution as a fallback
If true, add Artifacts property for each analyzed component (defaults to true).
The RuleTransformation to use with this callback (please note that transformation logic may be added to rules as well)
public void setup(BuilderContext ctx)
The setup() method could be invoked on the first onXXX() method invoked in element processing,
to ensure that a helper is registered and that the helper has the BuilderContext set.
ctx BuilderContext
rules.abap
com.optimyth.apm.builder.rules.abap
com.optimyth.apm.builder.rules.abap
rules.abap.AbapBuilderRule
Class AbapBuilderRule
Structure
Methods Summary
Class AbapBuilderRule
package rules.abap
Structure
Methods Summary
Callback to use for updating AIM model with entities and relations found in ABAP code.
rules.abap.AbapCallback
Page created on 04/20/2015
Class AbapCallback
Structure
Field Summary
Class AbapCallback
package rules.abap
AbapCallback - Callback for creating ABAP components and dependencies in AIM model.
Structure
Field Summary
rules.abap.DefaultAbapCallback
Class DefaultAbapCallback
Structure
Methods Summary
Class DefaultAbapCallback
package rules.abap
Structure
Methods Summary
If true, temporary data is stored in a system file (useful with huge code volume).
Default: false (temporary data is created in out-of-heap memory)
TODO probably this should be "global configuration" and not to be stored in every single rule ...
If true, create a node for SQL statements found in source element. If false, no explicit nodes for SQL statements are created.
The database type (e.g. SAP/R3) or database name for container of referenced tables.
Used as fallback if no global database object resolver, or the resolver cannot find the target entity.
The database name or database schema (e.g. SAP) for container of referenced tables.
Used as fallback if no global database object resolver, or the resolver cannot find the target entity.
rules.actionscript
com.optimyth.apm.builder.rules.actionscript
com.optimyth.apm.builder.rules.actionscript
rules.actionscript.ActionScriptBuilderRule
Class ActionScriptBuilderRule
Structure
Methods Summary
Class ActionScriptBuilderRule
package rules.actionscript
Structure
Methods Summary
Callback to use for updating AIM model with entities and relations found in ActionScript code.
rules.actionscript.ActionScriptCallback
Class ActionScriptCallback
Structure
Field Summary
Class ActionScriptCallback
Structure
Field Summary
rules.actionscript.DefaultActionScriptCallback
Class DefaultActionScriptCallback
Structure
Field Summary
Methods Summary
Class DefaultActionScriptCallback
package rules.actionscript
Structure
Field Summary
Methods Summary
rules.asp
com.optimyth.apm.builder.rules.asp
com.optimyth.apm.builder.rules.asp
rules.asp.AspBuilderRule
Class AspBuilderRule
Goal
Technology
Configuration examples
Structure
Methods Summary
Class AspBuilderRule
package rules.asp
AspBuilderRule -
Goal
Technology
ASP 3.0
Configuration examples
Structure
Methods Summary
The helper to use when resolving HTML static tags (links, images, etc.)
rules.asp.AspCallback
Interface AspCallback
Structure
Field Summary
Methods Summary
Interface AspCallback
package rules.asp
AspCallback -
Structure
Field Summary
Methods Summary
A COM object created by an ASP page: CreateObject() or Server.CreateObject() has been found
public onCss(String url, java.io.File resolvedFile, com.optimyth.apm.model.portfolio.Component
page, BuilderContext ctx)
rules.asp.BasicAspCallback
Class BasicAspCallback
Structure
Methods Summary
Class BasicAspCallback
BasicAspCallback - Basic callback that resolves ASP common elements (pages, com objects, referred html elements)
Structure
Methods Summary
The name of the webapp to build if no webapp was provided (default: WEBAPP)
rules.aspnet.aspx
com.optimyth.apm.builder.rules.aspnet.aspx
com.optimyth.apm.builder.rules.aspnet.aspx
rules.aspnet.aspx.AspxBuilderRule
Class AspxBuilderRule
Goal
Technology
Configuration examples
Structure
Methods Summary
Class AspxBuilderRule
package rules.aspnet.aspx
AspxBuilderRule -
This class may use as Software container the web applications discovered by the rules.aspnet.webapp.WebAppBuilderRule, or simply
use a single container named after the setAppname property as fallback.
Rule for resolving outgoing dependencies for ASPX WebPages (including "master" pages).
See also
rules.aspnet.aspx.AspxCallback
rules.aspnet.aspx.BasicAspxCallback
TagResolver
Goal
Rule for resolving outgoing dependencies for ASPX WebPages (including "master" pages).
Technology
ASP.NET
Configuration examples
<bean id="apm_rule_aspx_tagresolver" class=
"com.optimyth.apm.builder.rules.aspnet.aspx.TagResolver">
<description>Resolver for static HTML resources</description>
<property name="tagExtractors">
<map>
<entry key="link">
<bean class=
"com.optimyth.apm.builder.rules.aspnet.aspx.TagResolver$CssTagExtractor">
<property name="acceptUnresolvedResources" value="true"/>
</bean>
</entry>
<entry key="script">
<bean class=
"com.optimyth.apm.builder.rules.aspnet.aspx.TagResolver$JavascriptTagExtractor">
<property name="acceptUnresolvedResources" value="true"/>
</bean>
</entry>
<entry key="a">
<bean class="com.optimyth.apm.builder.rules.aspnet.aspx.TagResolver$ATagExtractor"
>
<property name="acceptUnresolvedResources" value="true"/>
</bean>
</entry>
<entry key="img" value-ref="imgExtractor"/>
<entry key="asp:Image" value-ref="imgExtractor"/>
</map>
</property>
</bean>
Structure
Methods Summary
The directory where web content can be found (for resolving relative URLs to code resources).
If not specified, no static dependencies will be resolved
List of taglibs to consider when parsing JSP/JSP elements (e.g. custom UIComponents)
The helper to use when resolving HTML static tags (links, images, etc.)
rules.aspnet.aspx.AspxCallback
Interface AspxCallback
Structure
Field Summary
Methods Summary
Interface AspxCallback
package rules.aspnet.aspx
AspxCallback -
Structure
Field Summary
Methods Summary
Registers a new ASP.NET item (page, webservice, custom control) for the given webapp
file File containing the ASP.NET item (for page: .aspx, for webservice: .asmx, for control: .ascx)
item
webapp
ctx
returns Component that models the ASP.NET entity
A Server.Tranfer(invokedPage) found
A <%@ Register
rules.aspnet.aspx.BasicAspxCallback
Class BasicAspxCallback
Structure
Methods Summary
Class BasicAspxCallback
BasicAspxCallback - Basic callback that resolves ASP.NET common elements (pages, user controls, webservices) and their (optional)
code-behind classes.
Structure
Methods Summary
rules.aspnet.webapp
com.optimyth.apm.builder.rules.aspnet.webapp
com.optimyth.apm.builder.rules.aspnet.webapp
rules.aspnet.webapp.BasicWebappCallback
Class BasicWebappCallback
Structure
Class BasicWebappCallback
Structure
rules.aspnet.webapp.WebAppBuilderRule
Class WebAppBuilderRule
Goal
Technology
Components
Relations
Configuration examples
Code examples
Structure
Methods Summary
Class WebAppBuilderRule
package rules.aspnet.webapp
WebAppRule -
The rule looks for web application descriptors (typically Web.Config) to identify the application root directory (APPDIR), then resolves the
assemblies (both in APPDIR/bin directory and in the application descriptor).
Discovered web applications are used by other rules, so logic is placed in the #initialize method. Other ASP.NET discovery rules, like
rules.aspnet.aspx.AspxBuilderRule, use the web application information collected by this rule.
See also
rules.aspnet.webapp.WebappCallback
rules.aspnet.aspx.AspxBuilderRule
Goal
Technology
ASP.NET
Components
Relations
application configures> resource (Web.Config descriptor), application uses> library (referenced assemblies)
Configuration examples
Code examples
concat(//ApplicationIdentity/add[@key='AppType']/@value, '-'
,//ApplicationIdentity/add[@key='AppID']/@value)
Structure
Methods Summary
Mandatory WebappCallback for registering web application and other webapp resources configured in Web.config descriptors
(Optional) directory from where ASP.NET applications will be discovered. If not set, all engine basedirs will be used
(Optional) Comma-separated list of ANT patterns for matching web.xml descriptors under basedirs
If not provided, ** /Web.Config will be used.
XPath expression for computing the from contents of Web.Config file. If not set, the application name will be the name
of the webapp root directory.
xpathAppName
rules.aspnet.webapp.WebappCallback
Interface WebappCallback
Structure
Field Summary
Methods Summary
Interface WebappCallback
package rules.aspnet.webapp
WebappCallback - Callback for updating model with all the elements found in a web.xml descriptor, of interest for "application discovery".
Structure
Field Summary
Properties Name Desc
public static final NULL The /dev/null WebappCallback. All callback methods return null, ignoring the events
Methods Summary
Invoked when an assembly (.dll) is referenced in the webapp (placed under the /bin dir, or referenced in Web.Config)
rules.cl400
com.optimyth.apm.builder.rules.cl400
com.optimyth.apm.builder.rules.cl400
rules.cl400.CLScriptCallback
Interface CLScriptCallback
Structure
Field Summary
Methods Summary
Interface CLScriptCallback
package rules.cl400
See also
rules.cl400.CLScriptRule
Structure
Field Summary
Methods Summary
scriptName
scriptFile The source file for the script
ctx @return Component representing the script.
callerScript caller
calledProgName Name of the program to run
callType CL Command used in the call (CALL, SBMJOB)
ctx BuilderContext
returns ApmRelation callerScript -> calledProgram, possibly null if relation was discarded.
script
command CL Data area command used (one of CRTDTAARA,CHGDTAARA,RTVDTAARA,DLTDTAARA)
dataArea Name of the data area
ctx BuilderContext
returns ApmRelation for script -> dataArea, possibly null if relation was discarded.
public onFileUsed(com.optimyth.apm.model.portfolio.Component script, String command,
com.optimyth.cl400.model.ObjectName dataStore, String kind, BuilderContext ctx)
script
command CL Data file usage command (one of OVRDBF or CPYF)
dataStore Filename
kind The kind of the file (data file, display file, DDS...)
ctx BuilderContext
returns ApmRelation for script -> dataStore, possibly null if relation was discarded.
script
qualifiedMember
srcFile
ctx
returns ApmRelation with the include relation between script and CL/400 included script.
rules.cl400.CLScriptRule
Class CLScriptRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Methods Summary
Class CLScriptRule
package rules.cl400
CLScriptRule -
Extract dependencies from CL400 scripts
Goal
Technology
CL (OS/400 control language)
Components
Relations
Configuration examples
Where apm_filter_cl is a FileFilter matching only CL scripts, and apm_callback_CLScript is a bean which
class implements rules.cl400.CLScriptCallback.
Structure
Methods Summary
rules.cl400.DefaultCLScriptCallback
Class DefaultCLScriptCallback
Configuration examples
Structure
Methods Summary
Class DefaultCLScriptCallback
extends from RuleCallbackBase
implements rules.cl400.CLScriptCallback
package rules.cl400
DefaultCLScriptCallback - Default implementation of rules.cl400.CLScriptCallback which basically resolves CL scripts found and their
calls to other programs or scripts, file usages (display files, data files or DDS), and included CL scripts.
Configuration examples
Where myScriptApplication and myBackendApplication are the names of the applications where scripts and
programs should be added, respectively. Both of them are optional.
Structure
Methods Summary
The name of the backend software containing all referenced programs that are not scripts
If true (the default), all entity names are converted to upper-case; if false, case is not changed
rules.cobol
com.optimyth.apm.builder.rules.cobol
com.optimyth.apm.builder.rules.cobol
rules.cobol.BasicCobolDependenciesCallback
Class BasicCobolDependenciesCallback
Configuration examples
Structure
Field Summary
Methods Summary
Class BasicCobolDependenciesCallback
BasicCobolDependenciesCallback - A basic callback for responding to rules.cobol.CobolBuilderRule "events". Delegates model entities
construction into ComponentsHelper.
Configuration examples
Where application, dbType and dbInstance are the application where entities should be added, the type of the
database and the name of its instance, respectively. All three properties are optional.
Structure
Field Summary
Methods Summary
Name of container application, alias to #setSoftwareName (if not provided, defaults to ModelConstants#DEFAULT_APP)
DB type for database entities usages discovered from EXEC SQL embedded statement. If not provided, defaults to
ModelConstants#DB2
If true (the default), all entity names are converted to upper-case; if false, case is not changed
The transformation to apply on each datafile to get the name that will be given to datafiles from the info in its descriptor
Predicate for database object names that, when matched, will skip the database object
If true, unresolved dynamic CALLs will be created with the name of the Cobol variable as target program,
and a toCheck property set. If false (the default) the dynamic CALL will be ignored when value for target
variable cannot be resolved for the Cobol program.
Class BetterCobolDependenciesCallback
Structure
Methods Summary
Class BetterCobolDependenciesCallback
package rules.cobol
BetterCobolDependenciesCallback - CobolDependenciesCallback that will register Cobol programs, COPY includes (cobol -> copy),
program calls (cobol -> cobol, cobol -> CL) and table calls (cobol -> DB2).
Extends rules.cobol.BasicCobolDependenciesCallback with CalledResolver for more accurate resolution of COPYs, called entities, and
DDS files.
Structure
Methods Summary
rules.cobol.CobolBuilderRule
Class CobolBuilderRule
package rules.cobol
CobolBuilderRule - .
Resolves Cobol dependencies: called programs, included copybooks, used SQL tables, used datafiles and DSP (a.k.a. screen
formatting records)
See also
rules.cobol.CobolDependenciesCallback
Goal
Resolves Cobol dependencies: called programs, included copybooks, used SQL tables, used datafiles and DSP (a.k.a. screen
formatting records)
Components
Cobol program
Relations
When the rule detects one of the above dependencies on the Cobol program AST,
invokes the proper callback method:
Configuration examples
Where apm_filter_cobol is a FileFilter matching only Cobol files, apm_callback_Cobol is a bean which class
implements CobolDependenciesCallback}, and myIgnoredCallsPattern are regular expressions matching
copys/calls that should be ignored, parseSqlDependencies property decides if embedded SQL should be parsed,
and parseSqlDependencies property decides if operations on datafiles should be analyzed. The last four properties
are optional.
Structure
Methods Summary
Regular expression with the COPY pattern to ignore (if not specified, all COPYs will be considered)
copysToIgnore Regular expression that, when matched by a COPY name, will ignore that COPY
Regular expression with the program pattern to ignore in both (if not specified, all COPYs will be considered)
callsToIgnore Regular expression that, when matched by a program name, will ignore the call to that program name
If set to true, Cobol - SQL dependencies will be extracted from EXEC SQL statements
If set to true, EXEC CICS blocks will be parsed and cobol-related dependencies resolved (basically LINK/XCTL command)
If set to true, SQL queries and their relationships with used tables are inserted into the model. Ignored if parseSqlDependencies is
false
If set to true, SQL code is added as property into the queries. Ignored if parseSqlDependencies is false
rules.cobol.CobolDependenciesCallback
Interface CobolDependenciesCallback
Structure
Field Summary
Methods Summary
Interface CobolDependenciesCallback
package rules.cobol
CobolDependenciesCallback - Callback for resolving dependencies between Cobol programs and Cobol-SQL.
Structure
Field Summary
Methods Summary
Adds a COPY program, linked to program. A copybook could be added in a COPY or EXEC SQL INCLUDE clauses.
Adds a CALL between two Cobol programs, using EXEC CICS LINK
Adds a CALL between a cobol program and an unresolved called program in a dynamic CALL.
calling The Cobol program that executed (e.g. in dynamic CALL) the program
targetVar Name of the variable containing the program name, which value cannot be resolved via static analysis
ctx BuilderContext
returns ApmRelation with left=calling, right=new program (calledName), or null if the callback decided to ignore the call
public onUsedFile(com.optimyth.apm.model.portfolio.Component calling,
rules.cobol.FileDescriptor fd, com.als.core.ast.BaseNode operation, BuilderContext ctx)
calling
fd FileDescriptor bean representing the used file
operation BaseNode with the statement that uses the file represented by fd
ctx BuilderContext
returns ApmRelation with left=calling, right=new file resource (physical file), or null if the callback decided to ignore the file
usage
Adds a CICS transaction usage (for START, RETURN or CANCEL commands) between a cobol program and CICS transaction.
calling The Cobol program that executed (e.g. in dynamic CALL) the program
transId Name of the CICS transaction
cics CICS command object
ctx BuilderContext
returns ApmRelation with left=calling, right=new program (calledName), or null if the callback decided to ignore the call
calling The Cobol program that executed (e.g. in dynamic CALL) the program
procName Procedure or function name
operation Type of operation Call
ctx BuilderContext
returns ApmRelation with left=calling, right=new procedure or function (calledName), or null if the callback decided to ignore
the call
rules.cobol.PlSqlCobolDependenciesCallback
Class PlSqlCobolDependenciesCallback
Structure
Field Summary
Class PlSqlCobolDependenciesCallback
PlSqlCobolDependenciesCallback - CobolDependenciesCallback that will register Cobol programs, COPY includes (cobol -> copy),
program calls (cobol -> cobol, cobol -> CL) and table calls (cobol -> Pl/Sql).
Extends rules.cobol.BetterCobolDependenciesCallback for more accurate resolution of embedded SQL code.
Structure
Field Summary
rules.common
com.optimyth.apm.builder.rules.common
com.optimyth.apm.builder.rules.common
rules.common.BaseNodeCallback
Interface BaseNodeCallback
Structure
Field Summary
Methods Summary
Interface BaseNodeCallback
package rules.common
BaseNodeCallback - Generic callback for any BaseNode that should be considered as a PortfolioEntity.
Structure
Field Summary
public static final NULL Empty implementation. #onNode simply returns null.
Methods Summary
rules.common.XPathRule
Class XPathRule
Configuration examples
Structure
Methods Summary
Class XPathRule
package rules.common
XPathRule - Generic APM discovery rule that will fetch AST BaseNodes matching an XPath expression, and invoke the registered
BaseNode callback on each matched BaseNode.
XPath is a "declarative" way to select certain constructs in the parsed source code. All the model update logic should be encoded in the
rules.common.BaseNodeCallback implementation, that will take as input matched BaseNode (and the BuilderContext).
See also
rules.common.BaseNodeCallback
Configuration examples
Where apm_filter_common is a FileFilter matching only desired files, and apm_callback_BaseNode is a bean
which class implements rules.common.BaseNodeCallback.
Structure
Methods Summary
Sets XPath expression (that should return a List of matching AST BaseNodes)
Sets the callback to use for notifying any BaseNode matched by the XPath expression on the currently analyzed AST.
rules.cpp
Page created on 04/20/2015
com.optimyth.apm.builder.rules.cpp
com.optimyth.apm.builder.rules.cpp
rules.cpp.BasicCppCallback
Class BasicCppCallback
Structure
Methods Summary
Class BasicCppCallback
Structure
Methods Summary
rules.cpp.BasicCppClassRule
Class BasicCppClassRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Field Summary
Methods Summary
Class BasicCppClassRule
package rules.cpp
TODO This rule is incomplete. Must resolve all dependencies in C/C++ sources...
Adds cpp file to the model and all dependencies to its includes files. This rule is really simple, to solve a more complete model, we're
working on CppClassRule.
Goal
Adds cpp file to the model and all dependencies to its includes files. This rule is really simple, to solve a more complete model, we're
working on CppClassRule.
Technology
C++
Components
Relations
This rule simply adds an 'includes' relation: class -> included header
Configuration examples
Structure
Field Summary
Methods Summary
rules.cpp.CppCallback
Interface CppCallback
Structure
Field Summary
Methods Summary
Interface CppCallback
package rules.cpp
Structure
Field Summary
Methods Summary
Pro*C cursor: it can be declared in a "EXEC SQL INCLUDEd" file, and used in the same file with different relations (open, fetch,
close)
rules.cpp.ExtendedCppCallback
Class ExtendedCppCallback
Structure
Methods Summary
Class ExtendedCppCallback
Structure
Methods Summary
rules.cpp.ExtendedCppClassRule
Class ExtendedCppClassRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Field Summary
Methods Summary
Class ExtendedCppClassRule
package rules.cpp
Goal
Adds C++ file to the model and all dependencies to its includes files.
Technology
C++
Components
Relations
This rule simply adds an 'contains' relation: class -> included methods
Configuration examples
<bean id="apm_rule_BasicCppClass" class=
"com.optimyth.apm.builder.rules.cpp.ExtendedCppClassRule">
<property name="application" value="TEST_CPP_APP"/> <!-- application name -->
<property name="cppCallback" ref="cpp.callback"/> <!-- callback -->
</bean>
<bean id="cpp.callback" class="com.optimyth.apm.builder.rules.cpp.ExtendedCppCallback">
<property name="level" value="class"/> <!-- file, class or function. This is used only by
-->
</bean>
Structure
Field Summary
Methods Summary
rules.cpp.ProcDatabaseRule
Class ProcDatabaseRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Field Summary
Methods Summary
Class ProcDatabaseRule
package rules.cpp
It can be configured with different granularity levels (@see CppCallback): FILE, CLASS, FUNCTION
Adds cpp file to the model and all SQL dependencies to plsql objects.
Goal
Adds cpp file to the model and all SQL dependencies to plsql objects.
Technology
C++, PL/SQL
Components
Relations
This rule simply adds a 'uses' relation: source -> PL/SQL object
Configuration examples
Structure
Field Summary
Methods Summary
rules.database.hibernate
com.optimyth.apm.builder.rules.database.hibernate
com.optimyth.apm.builder.rules.database.hibernate
rules.database.hibernate.AbstractHibernateRule
Class AbstractHibernateRule
Structure
Methods Summary
Class AbstractHibernateRule
package rules.database.hibernate
AbstractHibernateRule - Base class for rules that process Hibernate framework artefacts.
Structure
Methods Summary
rules.database.hibernate.BasicHibernateCallback
Class BasicHibernateCallback
Configuration examples
Structure
Methods Summary
Class BasicHibernateCallback
Configuration examples
Where application, dbType and dbName are the application where entities should be added, the type of the
database and the name of its instance, respectively. All three properties are optional, with default values
ModelConstants#DEFAULT_APP, #dbType and #dbName respectively.
Structure
Methods Summary
If false, the name of the tables referenced in Hibernate descriptors are not transformed.
If true (the default), the table (and schema) names are converted to upper-case.
rules.database.hibernate.BasicHibernateMappingCallback
Class BasicHibernateMappingCallback
Structure
Methods Summary
The fallback type of the database name (for schema databases) or database type
The fallback type of the database schema (for schema databases) or database name
If false, the name of the tables referenced in Hibernate descriptors are not transformed.
If true (the default), the table (and schema) names are converted to upper-case.
Predicate for database object names that, when matched, will skip the database object
rules.database.hibernate.HibernateCallback
Interface HibernateCallback
Structure
Field Summary
Methods Summary
Interface HibernateCallback
package rules.database.hibernate
HibernateCallback - Common interface for Hibernate callbacks, modeling descriptors, class mapped, and relations between mapped
classes.
Structure
Field Summary
Methods Summary
rules.database.hibernate.HibernateDescriptorRule
Class HibernateDescriptorRule
Configuration examples
Structure
Methods Summary
Class HibernateDescriptorRule
package rules.database.hibernate
HibernateDescriptorRule - Parses XML Hibernate descriptors and extracts information about mapping between classes and database
tables.
Configuration examples
Methods Summary
The (comma-separated) ANT patterns where hibernate mapping XML files could be found
rules.database.hibernate.HibernateJavaRule
Class HibernateJavaRule
Structure
Methods Summary
Class HibernateJavaRule
package rules.database.hibernate
HibernateJavaRule - Analyze Java code for database mappings defined via JPA/Hibernate annotations, or queries declared in
JPA/Hibernate API.
Structure
Methods Summary
Comma-separated list of additional hibernate API packages to consider. Add your own framework hibernate-extension packages
Interface HibernateMappingCallback
Structure
Field Summary
Methods Summary
Interface HibernateMappingCallback
package rules.database.hibernate
See also
rules.database.hibernate.HibernateMappingRule
rules.database.hibernate.HibernateJavaRule
Structure
Field Summary
public static HIBERNATE_SQL_TOCHECK Property for queries that cannot be parsed so the outgoing relations
final should be reviewed
Methods Summary
rules.database.hibernate.HibernateMappingRule
Page created on 04/20/2015
Class HibernateMappingRule
Configuration examples
Structure
Field Summary
Methods Summary
Class HibernateMappingRule
package rules.database.hibernate
HibernateMappingRule - Parses XML Hibernate descriptors and extracts information about mapping between classes and database
tables.
The alternate rules.database.hibernate.HibernateJavaRule process Java sources looking for Java5 annotation-based mapping
information and analyze programmatic queries (HQL or native SQL) for dependencies (with persistent classes or database objects).
See also
HibernateVisitor
Configuration examples
Structure
Field Summary
Methods Summary
com.optimyth.apm.builder.rules.database.ibatis
com.optimyth.apm.builder.rules.database.ibatis
rules.database.ibatis.AbstractIbatisRule
Class AbstractIbatisRule
Structure
Methods Summary
Class AbstractIbatisRule
package rules.database.ibatis
AbstractIbatisRule -
Structure
Methods Summary
rules.database.ibatis.BasicIbatisCallback
Class BasicIbatisCallback
Structure
Methods Summary
Class BasicIbatisCallback
BasicIbatisCallback -
Structure
Methods Summary
If false, the name of the tables referenced in Hibernate descriptors are not transformed.
If true (the default), the table (and schema) names are converted to upper-case.
Predicate for database object names that, when matched, will skip the database object
rules.database.ibatis.IbatisCallback
Interface IbatisCallback
Structure
Field Summary
Methods Summary
Interface IbatisCallback
package rules.database.ibatis
IbatisCallback -
Structure
Field Summary
Methods Summary
rules.database.ibatis.IbatisDescriptorRule
Class IbatisDescriptorRule
Structure
Methods Summary
Class IbatisDescriptorRule
package rules.database.ibatis
IbatisDescriptorRule - Parses iBatis/myBatis XML configuration / mapper descriptors. SQL statements found will be registered as
Components in the software for the descriptor. TODO how to process and model resultMap / parameterMap / resultType /
parameterType ?
Structure
Methods Summary
The file filter for iBatis XML descriptors. Configuration may use a particular Ant pattern for a specific naming convention.
When not given, *\/.xml Ant pattern will be used, and files processed to see if they correspond to iBatis configuration / mapper
XML files.
Resource of an optional .properties file to be used for replacing dynamic macros (like ${myvar})
in SQL statements found in iBatis descriptor
rules.database.ibatis.IbatisJavaRule
Page created on 04/20/2015
Class IbatisJavaRule
Structure
Methods Summary
Class IbatisJavaRule
package rules.database.ibatis
IbatisJavaRule - Rule that process java classes for iBatis annotations and calls to iBatis API.
Structure
Methods Summary
The instance of IbatisApiResolver to use for resolving the ID of the mapped SQL statement
from a call to iBatis API (default: DefaultIbatisApiResolver).
rules.database.schema
com.optimyth.apm.builder.rules.database.schema
com.optimyth.apm.builder.rules.database.schema
rules.database.schema.DatabaseSchemaCallback
Class DatabaseSchemaCallback
Structure
Methods Summary
Class DatabaseSchemaCallback
package rules.database.schema
Structure
Methods Summary
rules.database.schema.DatabaseSchemaRule
Class DatabaseSchemaRule
Structure
Methods Summary
Class DatabaseSchemaRule
DatabaseSchemaRule - Models database components from schema descriptors extracted by schemaExtract script (GLOBAL plugin).
Configuration: Specify either schemaFile (full path to the XML schema descriptor file), or schemaDirectory + schemaFilePattern (if
multiple schema descriptors need to be processed).
This rule models schema entity with tables (linked to indexes, primary key, and other tables in foreign key relations), and views.
Database-specific rules may extend this to add other entities and relations (like triggers, stored procedures, etc.). For example, for
Oracle, rules.database.schema.OracleDatabaseSchemaRule resolves more entities (subclasses override #processSchemaExtension).
See also
rules.database.schema.OracleDatabaseSchemaRule
Structure
Methods Summary
The directory where schema descriptors and SQL entities are exported
public void setSchemaDirectories(java.util.List schemaDirectories)
Callback for schema entities and relations (if not set, a DatabaseSchemaCallback instance will be used)
If set, the views SQL code is parsed for relations with other views/tables
rules.database.schema.OracleDatabaseSchemaRule
Class OracleDatabaseSchemaRule
Structure
Methods Summary
Class OracleDatabaseSchemaRule
package rules.database.schema
OracleDatabaseSchemaRule - Models extended schema entities for Oracle. Sample schema entities produced: <pre> software(dn:
'sys=DB', type: 'software', name: 'DB', description: 'database DB', softwareType: 'database') component(dn: 'sys=DB,db=SCHEMA',
type: 'component', name: 'SCHEMA', description: 'database schema DB.SCHEMA', componentType: 'databaseInstance') component(dn:
'sys=DB,db=SCHEMA,table=T', type: 'component', name: 'VISA_FICHEROS_ENVIADOS', description: 'Table SCHEMA.T',
componentType: 'table', sqlType: 'table', columns: 'ID,FIELD1,FIELD2,FIELD3', rows: 1612972) component(dn:
'sys=DB,db=SCHEMA,table=T,index=T_ID02', type: 'component', name: 'T_ID02', componentType: 'index', description: 'Index on table
T', columns: 'ID,FIELD1') component(dn: 'sys=DB,db=SCHEMA,table=T,index=T_PK', type: 'component', name: 'T_PK',
componentType: 'primaryKey', description: 'PrimaryKey on table T', columns: 'ID') component(dn: 'sys=DB,db=SCHEMA,table=V', type:
'component', name: 'V', description: 'Table V', componentType: 'view', sqlType: 'view', columns: 'F1,...,Fn', rows: 0, sqlcode: 'SELECT *
FROM T') </pre>
Structure
Methods Summary
rules.dotnet
com.optimyth.apm.builder.rules.dotnet
com.optimyth.apm.builder.rules.dotnet
rules.dotnet.CSharpClassRule
Class CSharpClassRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Class CSharpClassRule
package rules.dotnet
CsharpClassRule -
A class rule that will resolve outgoing dependencies for C# class.
See also
rules.oo.AbstractClassRule
rules.oo.ClassCallback
ClassDepsResolver
Goal
Technology
csharp
Components
Relations
Configuration examples
Where callback is the rules.oo.ClassCallback to use for interacting with the model, and ClassDepsResolver that will
decide if outgoing classes should be registered in the model.
Structure
rules.dotnet.DotnetClassCallback
Class DotnetClassCallback
Structure
Class DotnetClassCallback
package rules.dotnet
DotnetClassCallback - A BasicClassCallback for .net languages, uses specific logic for inferring the language from file extensions; when
the language could not be inferred, "dotnet" is used as language name.
Structure
rules.dotnet.DotnetClassRule
Class DotnetClassRule
Structure
Methods Summary
Class DotnetClassRule
package rules.dotnet
Structure
Methods Summary
The language-specific rules (keyed by language name, like csharp or vbnet) that will be applied
rules.dotnet.DotnetProjectRule
Class DotnetProjectRule
Structure
Field Summary
Methods Summary
Class DotnetProjectRule
package rules.dotnet
DotnetProjectRule - Analyzes references to a set of (Visual Studio) .net projects, discovering software entities (modules or applications)
for each .vbproj / .csproj found, and resolving references to external resources (application assemblies).
Structure
Field Summary
Comma-separated list of ANT patterns for matching .*proj files (relative to basedirs). Defaults to #DEFAULT_CSPROJ_PATTERN
and #DEFAULT_VBPROJ_PATTERN
If false, assemblies referenced but not matching applications analized will NOT be added to the model (default: true)
If true, dot.net standard assemblies will be added to the model (default: false)
The schema URI to use for the .*proj files (default: #DEFAULT_SCHEMA_URI)
rules.dotnet.VbNetClassRule
Class VbNetClassRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Field Summary
Class VbNetClassRule
package rules.dotnet
VbNetClassRule -
A class rule that will resolve outgoing dependencies for Visual Basic .NET class.
See also
rules.oo.AbstractClassRule
rules.oo.ClassCallback
ClassDepsResolver
Goal
A class rule that will resolve outgoing dependencies for Visual Basic .NET class.
Technology
vbnet
Components
Relations
Configuration examples
Where callback is the rules.oo.ClassCallback to use for interacting with the model, and ClassDepsResolver that will
decide if outgoing classes should be registered in the model.
Structure
Field Summary
rules.grouping
com.optimyth.apm.builder.rules.grouping
com.optimyth.apm.builder.rules.grouping
rules.grouping.GroupRule
Page created on 04/20/2015
Class GroupRule
Structure
Methods Summary
Class GroupRule
package rules.grouping
Structure
Methods Summary
Inject a classfier responsible for interpreting filters and create membership relations
rules.html
com.optimyth.apm.builder.rules.html
com.optimyth.apm.builder.rules.html
rules.html.DefaultHtmlCallback
Class DefaultHtmlCallback
Structure
Methods Summary
Class DefaultHtmlCallback
extends from RuleCallbackBase
implements rules.html.HtmlCallback
package rules.html
Structure
Methods Summary
rules.html.DynamicHtmlRule
Class DynamicHtmlRule
Goal
Configuration examples
Structure
Methods Summary
Class DynamicHtmlRule
package rules.html
DynamicHtmlRule -
Extends HtmlRule by letting a webapp resolver determine the name of the web application container where each discovered html pages
and their dependencies should be placed.
See also
WebAppResolver
Goal
Extends HtmlRule by letting a webapp resolver determine the name of the web application container where each discovered html pages
and their dependencies should be placed.
Configuration examples
<bean id="apm_rule_html_tags" class="java.util.HashMap">
<constructor-arg><map>
<entry key="link"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$CssTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="a"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$ATagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="img"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$ImgTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="script"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$JavascriptTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="frame"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$FrameTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="iframe"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$FrameTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="form"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$FormTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
</map></constructor-arg>
</bean>
Structure
Methods Summary
rules.html.HtmlCallback
Interface HtmlCallback
package rules.html
HtmlCallback - Callback used by extraction rules for "plain html" code. Provides callback methods for the usual elements found in HTML
pages (currently: page, css, script, image, link, form).
Structure
Field Summary
public static final PAGE_EXTS The (lowercase) extensions for pages, static or dynamic: htm,html,xhtml,jsp,asp,jspx,aspx,php
Methods Summary
rules.html.HtmlRule
Class HtmlRule
Goal
Components
Relations
Configuration examples
Structure
Methods Summary
Class HtmlRule
package rules.html
HtmlRule - BuilderRule for extracting dependencies between HTML files and outgoing static dependencies (for example, CSS,
JavaScript, links, images, forms...)
This rule places all components discovered under the web application configured in the callback. The derived
rules.html.DynamicHtmlRule uses a WebAppResolver for determining which application the components should be placed, based on
file/url patterns.
Extracts static dependencies in HTML files (CSS stylesheets, JavaScript files, links, images, forms, frames...)
See also
rules.html.HtmlCallback
TagResource
Goal
Extracts static dependencies in HTML files (CSS stylesheets, JavaScript files, links, images, forms, frames...)
Components
Relations
See rules.html.HtmlCallback for the relations that may be resolved for css, scripts, links, forms, and images.
Configuration examples
<bean id="apm_rule_html_tags" class="java.util.HashMap">
<constructor-arg><map>
<entry key="link"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$CssTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="a"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$ATagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="img"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$ImgTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="script"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$JavascriptTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="frame"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$FrameTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="iframe"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$FrameTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
<entry key="form"><bean class=
"com.optimyth.apm.builder.rules.html.HtmlRule$FormTagExtractor"><property name=
"acceptUnresolvedResources" value="true"/></bean></entry>
</map></constructor-arg>
</bean>
The (optional) extractors property permits fine-grained configuration of each tag extractor.
Structure
Methods Summary
Comma-separated list of tags to parse (defaults to "link,script,a,img,form"). If injected via "extractors", this property is ignored.
The directory where web content can be found (for resolving relative URLs to code resources)
rules.j2ee
com.optimyth.apm.builder.rules.j2ee
com.optimyth.apm.builder.rules.j2ee
rules.j2ee.JavaDependenciesCallback
Interface JavaDependenciesCallback
Structure
Methods Summary
Interface JavaDependenciesCallback
package rules.j2ee
Structure
Methods Summary
rules.j2ee.ejb
com.optimyth.apm.builder.rules.j2ee.ejb
rules.j2ee.ejb.BasicEjb3DependenciesCallback
Class BasicEjb3DependenciesCallback
Structure
Methods Summary
Class BasicEjb3DependenciesCallback
EJB callback, works for both rules.j2ee.ejb.EjbDescriptorRule (1.x or 2.x, descriptor-based) and rules.j2ee.ejb.Ejb3BuilderRule (3.x,
Java5 annotation-based).
Structure
Methods Summary
Name of database
(optional) Name of default schema name: for referred tables without a specified schema
(optional) ClassCallback that may be called to create classes so that we can relate them with EJBs
public void setExcludePredicate(rules.common.Predicate exclude)
Predicate for database object names that, when matched, will skip the database object
If false, the name of the tables referenced in Hibernate descriptors are not transformed.
If true (the default), the table (and schema) names are converted to upper-case.
rules.j2ee.ejb.Ejb3BuilderRule
Class Ejb3BuilderRule
Configuration examples
Structure
Methods Summary
Class Ejb3BuilderRule
Ejb3BuilderRule - Looks for EJB3 beans that use javax.ejb.* annotations for declaring EJB properties. Please note that there is an
alternative way to declare EJB using a descriptor (e.g. EJB2's ejb-jar.xml descriptor).
Configuration examples
Where apm_filter_ejb3 is a FileFilter matching only desired files, and apm_callback_Ejb is a bean which class
implements rules.j2ee.ejb.Ejb3DependenciesCallback.
Structure
Methods Summary
Resolve dependencies with database objects in EBJ3 entity beans, described in annotations
rules.j2ee.ejb.Ejb3DependenciesCallback
Interface Ejb3DependenciesCallback
Structure
Field Summary
Methods Summary
Interface Ejb3DependenciesCallback
package rules.j2ee.ejb
Structure
Field Summary
Methods Summary
Registers an EJB descriptor file (e.g. used with EJB 1.x / 2.x)
Invoked when an EJB bean of the given ejbType is found. This method return the ejb component (an element)
with
Invoked when a reference to an EJB is referenced by another component (e.g. another EJB, or another class).
Registers a "configures" dependency between EJB descriptor (1.x or 2.x) and ejb declared in that descriptor
Registers one of the consituent class part of the EJB (local/remote interface, local/remote home interface, bean class, primary key
class...)
interfac
ejb
ctx
rules.j2ee.ejb.EjbDescriptorRule
Class EjbDescriptorRule
Structure
Methods Summary
Class EjbDescriptorRule
extends from AbstractBuilderRule
package rules.j2ee.ejb
EjbDescriptorRule - Process EJB ejb-jar.xml descriptors to find EJB beans. The alternative, for EJB3, is to use annotations to describe
EJB elements.
Structure
Methods Summary
rules.j2ee.jdbc
com.optimyth.apm.builder.rules.j2ee.jdbc
com.optimyth.apm.builder.rules.j2ee.jdbc
rules.j2ee.jdbc.BasicJdbcCallback
Class BasicJdbcCallback
Configuration examples
Structure
Methods Summary
Class BasicJdbcCallback
BasicJdbcCallback - Simple callback that will register all referenced tables, with a select/insert/update/delete usage relation.
If the addCodeToRelations property is true, SQL code may be registered at the relation in the property "code" (List of the SQL code
discovered).
Configuration examples
<bean id="apm_callback_Jdbc" class=
"com.optimyth.apm.builder.rules.j2ee.jdbc.BasicJdbcCallback">
<property name="application" value="myApp"/>
<property name="dbType" value="myDBType"/>
<property name="dbName" value="myDBInstance"/>
<property name="addCodeToRelations" value="true"/>
</bean>
Where application, dbType and dbName are the application where entities should be added, the type of the
database and the name of its instance, respectively. All three properties are optional, with default values
ModelConstants#DEFAULT_APP, #dbType and #dbName. The property addCodeToRelations decides if extracted
SQL should be added as a relation's property (default is false).
Structure
Methods Summary
Name of container application, to use as fallback (if not provided, defaults to ModelConstants#DEFAULT_APP)
The (default) database name (with schema-oriented db systems) or database type (with database-oriented db systems)
The (default) schema name (with schema-oriented db systems) or database name (with database-oriented db systems)
If true (the default), all database elements will be set to upper-case; if false, no case transformation will be done on element
names
public void setLanguage(String language)
The language for the element that embeds SQL operations (default: java)
If set to true, code for the dependency (property RELATION_CODE with List{String}) is added to the relations (default: false)
Predicate for database object names that, when matched, will skip the database object
rules.j2ee.jdbc.JdbcBytecodeRule
Class JdbcBytecodeRule
Structure
Methods Summary
Class JdbcBytecodeRule
package rules.j2ee.jdbc
JdbcBytecodeRule - Operates on bytecode to extract dependences with database via JDBC code
Structure
Methods Summary
JdbcCallback to use for updating model with discovered table usages in embedded SQL
public void setListener(rules.j2ee.jdbc.JdbcSqlListener listener)
rules.j2ee.jdbc.JdbcCallback
Interface JdbcCallback
Structure
Field Summary
Methods Summary
Interface JdbcCallback
package rules.j2ee.jdbc
Structure
Field Summary
Methods Summary
A new class is visited. Return the component modelling the class, or null if the class should be ignored
An SQL statement is found, creates intermediate sql component and a 'calls' relation between currentClass and sql component
A generic table/view usage, for extraction techniques that cannot process the full statement
A sequence usage
rules.j2ee.jdbc.JdbcRule
Class JdbcRule
Goal
Technology
Configuration examples
Structure
Field Summary
Methods Summary
Class JdbcRule
package rules.j2ee.jdbc
JdbcRule -
This rule uses sql extractor / sql listener solution for extracting and parsing embedded SQL code. Obviously only a few SQL statement
can be extracted due to the complexity of the task (SQL code may be constructed programmatically, and the extraction logic is too
complex but for the simplest cases).
Standard APPMAP discovery rule for resolving SQL dependencies (to tables) in SQL embedded in Java source code.
See also
rules.j2ee.jdbc.JdbcCallback
Goal
Standard APPMAP discovery rule for resolving SQL dependencies (to tables) in SQL embedded in Java source code.
Technology
Configuration examples
<bean id="apm_rule_Jdbc" class="com.optimyth.apm.builder.rules.j2ee.jdbc.JdbcRule">
<property name="filter" ref="apm_filter_javaSource"/>
<property name="callback" ref="apm_callback_Jdbc"/>
<property name="extractor">
<bean class="com.als.sql.extractor.java.JdbcCodeSqlExtractor">
<property name="parser" ref="ls_sql_parser"/>
<property name="listener" ref="apm_listener_Jdbc"/>
</bean>
</property>
</bean>
Where apm_filter_javaSource is a FileFilter matching only java source files, apm_callback_Jdbc is a bean
which class implements JdbcCallback}, is qaKing's SQL parser (typically defined in apm-qaking.xml), and
apm_listener_Jdbc is a bean which class implements SqlExtractListener.
Structure
Field Summary
Methods Summary
JdbcCallback to use for updating model with discovered table usages in embedded SQL
rules.j2ee.webapp.jsf
com.optimyth.apm.builder.rules.j2ee.webapp.jsf
com.optimyth.apm.builder.rules.j2ee.webapp.jsf
rules.j2ee.webapp.jsf.BasicFacesConfigCallback
Class BasicFacesConfigCallback
Configuration examples
Structure
rules.j2ee.webapp.jsf.FacesConfigCallback
Interface FacesConfigCallback
Structure
Field Summary
Methods Summary
Interface FacesConfigCallback
package rules.j2ee.webapp.jsf
FacesConfigCallback - Receive events from rules.j2ee.webapp.jsf.FacesConfigRule (currently, only UI components and managed
beans) are supported).
See also
rules.j2ee.webapp.jsf.FacesConfigRule
Structure
Field Summary
Methods Summary
rules.j2ee.webapp.jsf.FacesConfigRule
Class FacesConfigRule
Goal
Technology
Components
Configuration examples
Structure
Methods Summary
Class FacesConfigRule
package rules.j2ee.webapp.jsf
FacesConfigRule -
At rule's initialization, all faces-config files obtained from WebAppRegistry are processed and their JSF components and managed beans
are sent to the callback.
IMPORTANT: This rule should be placed after the rules.j2ee.webapp.webxml.WebXmlRule rule, that is required for discovery of the
web.xml descriptors where the faces descriptors are referenced. If not, the rule simply does nothing.
The rule logic is performed at initialization, where Faces config descriptors discovered by the WebXmlRule are processed.
Parses faces configs based on Faces Config Specification 1.2
Goal
Components
faces descriptor (resource), UI components, managed beans. See rules.j2ee.webapp.jsf.FacesConfigCallback for details.
Configuration examples
Structure
Methods Summary
rules.j2ee.webapp.jsp
com.optimyth.apm.builder.rules.j2ee.webapp.jsp
com.optimyth.apm.builder.rules.j2ee.webapp.jsp
rules.j2ee.webapp.jsp.BasicJspCallback
Class BasicJspCallback
Configuration examples
Structure
Methods Summary
Class BasicJspCallback
BasicJspCallback - Default implementation for rules.j2ee.webapp.jsp.JspCallback resolving JSP elements found. All components are
placed in a Software item as resolved by software resolver, or to application named after injected #setWebappName property.
Configuration examples
<bean id="apm_callback_Jsp" class=
"com.optimyth.apm.builder.rules.j2ee.webapp.jsp.BasicJspCallback">
<property name="webappName" value="myWebappName"/>
</bean>
Where myWebappName is the application where pages and other elements should be added.
Structure
Methods Summary
The name of the webapp to build if no webapp was provided (default: {@link
com.optimyth.apm.factory.ModelConstants#DEFAULT_APP ModelConstants.DEFAULT_APP)
rules.j2ee.webapp.jsp.JspBuilderRule
Class JspBuilderRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Methods Summary
Class JspBuilderRule
package rules.j2ee.webapp.jsp
The rule dependes on TagResolver for resolving static HTML dependencies, and JavaResolver for resolving dependencies with Java
classes referenced in the JSP page.
Discovers JSP pages and their common dependencies (HTML "static", tags, taglibs referenced, Java classes)
See also
rules.j2ee.webapp.jsp.JspCallback
JavaResolver
TagResolver
Goal
Discovers JSP pages and their common dependencies (HTML "static", tags, taglibs referenced, Java classes)
Technology
J2EE
Components
JSP pages
Relations
Referenced taglibs
Included JSPs (via <%@ include %>)
JSPs included / forwarded (when the URL resolves to a JSP in the codebase)
Tags (e.g. JSF UIComponents) in the given set of taglibs (infrastructure libraries are should be ignored)
Static HTML dependencies (references to CSS, IMG, JavaScript, and links to resolvable app resources)
Configuration examples
Where apm_filter_jsp is a FileFilter matching only JSP pages, apm_callback_Jsp is a bean which class
implements rules.j2ee.webapp.jsp.JspCallback and taglibsToParse is a list with paths to libraries which tags
should be parsed.
Structure
Methods Summary
List of taglibs to consider when parsing JSP/JSP elements (e.g. custom UIComponents)
Sets JSP resolver to use for resolving JSP includes/forwards (static and dynamic)
The helper to use when resolving HTML static tags (links, images, etc.)
If true (the default), create component for any JSP, including unparseable pages; if false ignore JSP files that were not parsed
rules.j2ee.webapp.jsp.JspCallback
Page created on 04/20/2015
Interface JspCallback
Structure
Field Summary
Methods Summary
Interface JspCallback
package rules.j2ee.webapp.jsp
JspCallback - Generic callback for JSP elements. Provide callback methods for discovered JSP pages (#onJsp), JSP-specific
dependencies (#onIncludedJsp, #onInvokedJsp, #onTaglibReferenced and #onTag), HTML "static" dependencies (#onCss, #onScript,
#onLink, #onImage, #onForm).
This callback does not process JSP - Java relations, which are processed by JavaResolver.
Structure
Field Summary
Methods Summary
Resolves a given web resource URL for the given tagType as a TagResource
rules.j2ee.webapp.servlet
com.optimyth.apm.builder.rules.j2ee.webapp.servlet
com.optimyth.apm.builder.rules.j2ee.webapp.servlet
rules.j2ee.webapp.servlet.BasicServletCallback
Class BasicServletCallback
Configuration examples
Structure
Methods Summary
Class BasicServletCallback
Configuration examples
<bean id="apm_callback_Servlet" class=
"com.optimyth.apm.builder.rules.j2ee.webapp.servlet.BasicServletCallback">
<property name="webappName" value="myWebappName"/>
</bean>
Structure
Methods Summary
The name of the webapp to build if no webapp was provided (default: "common")
rules.j2ee.webapp.servlet.ServletBuilderRule
Class ServletBuilderRule
Technology
Configuration examples
Structure
Methods Summary
Class ServletBuilderRule
package rules.j2ee.webapp.servlet
ServletBuilderRule - Builds servlet and filter dependencies, from compiled bytecode (.class). This rule finds servlet and filter
implementation classes, links to their definition in web.xml (if any, previously parsed by the WebXmlRule), and passes to the
rules.j2ee.webapp.servlet.ServletCallback callback.
See also
rules.j2ee.webapp.servlet.ServletCallback
Technology
J2EE
Configuration examples
<bean id="apm_rule_Servlet" class=
"com.optimyth.apm.builder.rules.j2ee.webapp.servlet.ServletBuilderRule">
<property name="filter" ref="apm_filter_servlets"/>
<property name="servletCallback" ref="apm_callback_Servlet"/>
<property name="baseServlets">
<set>
<value>my/base/servlet/NumberOne</value>
<value>my/base/servlet/NumberTwo</value>
...
<value>my/base/servlet/NumberN</value>
</set>
</property>
<property name="baseFilters">
<set>
<value>my/base/filter/NumberOne</value>
<value>my/base/filter/NumberTwo</value>
...
<value>my/base/filter/NumberN</value>
</set>
</property>
</bean>
Where apm_filter_servlets is a FileFilter matching only servlet files, apm_callback_Servlet is a bean which
class implements rules.j2ee.webapp.servlet.ServletCallback, and baseServlets/baseFilters are sets defining
custom base servlets/filters, respectively, both of them optional.
Structure
Methods Summary
rules.j2ee.webapp.servlet.ServletCallback
Interface ServletCallback
Structure
Field Summary
Methods Summary
Interface ServletCallback
package rules.j2ee.webapp.servlet
ServletCallback - Callback for servlet API entities (servlets, filters). Extends ClassCallback (which process Java language dependencies,
like inheritance, method calls, field usage) with servletAPI-specific callbacks.
See also
rules.j2ee.webapp.servlet.BasicServletCallback
Structure
Field Summary
Methods Summary
rules.j2ee.webapp.webxml
com.optimyth.apm.builder.rules.j2ee.webapp.webxml
com.optimyth.apm.builder.rules.j2ee.webapp.webxml
rules.j2ee.webapp.webxml.BasicWebappCallback
Page created on 04/20/2015
Class BasicWebappCallback
Configuration examples
Structure
Methods Summary
Class BasicWebappCallback
Configuration examples
Structure
Methods Summary
(Optional) If set, use this for the application name. If not set, take appname from web.xml descriptor
(Optional) Alternative to webappName: put here your logic to solve customer-specific webApp resolution
Interface WebappCallback
Structure
Field Summary
Methods Summary
Interface WebappCallback
package rules.j2ee.webapp.webxml
WebappCallback - Callback for updating model with all the elements found in a web.xml descriptor, of interest for "web application
discovery". Relevant presentation-layer J2EE elements are considered: servlets, filters, resources, ejb references, context listeners, tag
libraries, and JSF (faces) descriptors.
Structure
Field Summary
Methods Summary
rules.j2ee.webapp.webxml.WebXmlRule
Class WebXmlRule
Goal
Technology
Configuration examples
Structure
Methods Summary
Class WebXmlRule
package rules.j2ee.webapp.webxml
WebXmlRule -
NOTE: Typically there should be a single instance of this rule in a configuration, with the webxmlPatterns property set, and with a
WebappCallback configured to resolve the application where the descriptor lives, based e.g. on the descriptor path.
As other rules may need access to the descriptors processed by this rule, the rule logic is performed in the initialize() method (so
no filter is needed). Some rules that use the webapps discovered by this rule are: rules.j2ee.webapp.jsp.JspBuilderRule,
rules.j2ee.webapp.jsf.FacesConfigRule, rules.j2ee.webapp.servlet.ServletBuilderRule, rules.spring.webflow.SpringWebflowRule.
If the rule successfully processes each web.xml descriptor found, the WebApp bean representing configuration is stored in a map (keyed
by the Software corresponding to the application resolved by the callback) under the WEB.XML.CONTENTS key, so other J2EE rules may
use that information (for example, taglibs found in JSP files, etc.)
Rule that parses web.xml descriptor file for any J2EE "web applications", emitting events to the
rules.j2ee.webapp.webxml.WebappCallback that will update the model with descriptor-discovered information.
See also
rules.j2ee.webapp.webxml.WebappCallback
Goal
Rule that parses web.xml descriptor file for any J2EE "web applications", emitting events to the
rules.j2ee.webapp.webxml.WebappCallback that will update the model with descriptor-discovered information.
Technology
J2EE
Configuration examples
<bean id="apm_rule_WebXml" class=
"com.optimyth.apm.builder.rules.j2ee.webapp.webxml.WebXmlRule">
<property name="callback" ref="apm_callback_Webapp"/>
<property name="webxmlPatterns" value="myWebxmlPattern"/>
</bean>
Structure
Methods Summary
(Optional) Comma-separated list of ANT patterns for matching web.xml descriptors under basedirs
If not provided, ** /WEB-INF/web.xml will be used.
(Optional) Set of (relative) paths for matching web.xml descriptors under basedirs
(Optional) a map with the maps that will convert application names found in display-name elements of web.xml descriptor
into the logical webapp name mapped to.
appsMap
rules.j2ee.weblogic
com.optimyth.apm.builder.rules.j2ee.weblogic
com.optimyth.apm.builder.rules.j2ee.weblogic
rules.j2ee.weblogic.JavaControlsRule
Class JavaControlsRule
Structure
Methods Summary
Class JavaControlsRule
package rules.j2ee.weblogic
JavaControlsRule - Process Java Control source code (.jcx files), looking at dependencies with J2EE resources encoded in Javadoc
comments (attributes prefixed with @prefix:suffix).
Structure
Methods Summary
The processors that will derive model entities and dependencies from JavaControl tags
rules.j2ee.webservice
com.optimyth.apm.builder.rules.j2ee.webservice
com.optimyth.apm.builder.rules.j2ee.webservice
rules.j2ee.webservice.AxisWsddRule
Class AxisWsddRule
Components
Relations
Structure
Methods Summary
Class AxisWsddRule
AxisWsddRule - Process WSDD (Axis Web Service Deployment Descriptor). <pre> <service name="Pago" provider="java:RPC">
<namespace>http://faults.samples</namespace> <parameter name="className"
value="com.pelayo.diversos.pago.service.PagoServiceImpl" /> <parameter name="allowedMethods" value="capturarPago"/>
<parameter name="scope" value="Session" /> <wsdlFile>../colab-ws.wsdl</wsdlFile> </service> </pre>
{technology}j2ee/webservice{technology}
Components
Relations
Configuration component for WSDD file, that configures each webService WS. Component for implementation class C
is created, with WS - implementedBy -> C relation. If wsdlFile is provided and exists as physical file,
a configuration component for the WSDL file is created, with WSDL - configures -> WS relation.
If createWebServiceMethods is true, operation component is created for each operation O in WS, with
WS - contains -> O.
Structure
Methods Summary
The name of the containing software, to use as fallback if no explicit or global software resolver can resolve container for artifacts
The software type (default: "application"), to use as fallback if no explicit or global software resolver can resolve artifact
rules.j2ee.webservice.JaxwsRule
Class JaxwsRule
Structure
Methods Summary
Class JaxwsRule
package rules.j2ee.webservice
JaxwsRule - Creates web services and web service proxies based on JAX-WS annotations in Java classes (JSR-181).
Structure
Methods Summary
If set to true, webservices used in proxies that cannot be resolved are created in the same proxy software.
rules.j2ee.webservice.JBuilderWebServiceRule
Class JBuilderWebServiceRule
Structure
Methods Summary
Class JBuilderWebServiceRule
Structure
Methods Summary
If set to true, webservices referenced in .wsdu that cannot be resolved are created in the same software that contains the
descriptor
rules.java
com.optimyth.apm.builder.rules.java
com.optimyth.apm.builder.rules.java
rules.java.JavaClassBytecodeRule
Class JavaClassBytecodeRule
Technology
Components
Configuration examples
Structure
Class JavaClassBytecodeRule
extends from AbstractClassRule
package rules.java
JavaClassBytecodeRule - Rule that builds Java classes as components, resolving Java-type dependencies (method calls, object
instantiations, inheritance and variable references) by analyzing bytecode (compiled .class files).
This rule DOES NOT resolve any Java API dependency, or dependencies that cannot be resolved to other classes in the same model
("inter-model deps"). This is done purposely, to limit model growth.
Implementation note: This rule uses bytecode.
TODO complete with varReferences
Technology
Java
Components
Classes
Configuration examples
Structure
rules.java.JavaClassMethodBytecodeRule
Class JavaClassMethodBytecodeRule
Structure
Methods Summary
Class JavaClassMethodBytecodeRule
package rules.java
See also
rules.java.JavaClassMethodRule
Structure
Methods Summary
The filter for the classnames where the source/target method will be resolved as components. Defaults to none (do not register
methods in model).
Predicate that, when matches a candidate ASM MethodNode, the rule will register the method as component of the enclosing
class.
rules.java.JavaClassMethodRule
Class JavaClassMethodRule
Technology
Components
Relations
Configuration examples
Structure
Methods Summary
Class JavaClassMethodRule
package rules.java
JavaClassMethodRule - Rule that builds Java classes and methods as components, resolving Java-type dependencies (method calls,
object instantiations, inheritance, variable and type references)
IMPORTANT NOTE: The method component in model does not use the full method signature. This is done purposely, to reduce the size
of the method key. That means that all overloaded methods collapse to a single method. This is OK for most of the purposes, but
obviously is not accurate 100% due to method overloading.
This rule DOES NOT resolve any Java API dependency, or dependencies that cannot be resolved to other classes in the same model
("inter-model deps"). This is done purposely, to limit model growth.
Implementation note: This rule uses source-based AST.
See also
rules.java.JavaClassRule
Technology
Java
Components
Java methods and their enclosing classes
Relations
Dependencies resolved are: inheritance, call, var usage, type reference. Methods are resolved
if the enclosing class matches the resolveMethodsFilter predicate.
If a NodePredicate is registered in #setMethodPredicate, method declarations matching it
and in classes whose name was matched by #setResolveMethodsFilter are registered as components.
If you want to represent dependencies without method-level granularity, use
rules.java.JavaClassRule instead.
Configuration examples
Structure
Methods Summary
The filter for the classnames where the source/target method will be resolved as components. Defaults to none (do not register
methods in model).
NodePredicate that, when matches a candidate MethodDeclaration, the rule will register the method as component of the
enclosing class.
rules.java.JavaClassRule
Class JavaClassRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Field Summary
Class JavaClassRule
package rules.java
JavaClassRule -
This rule DOES NOT resolve any Java API dependency, or dependencies that cannot be resolved to other classes in the same model
("inter-model deps"). This is done purposely, to limit model growth.
Implementation note: This rule uses source-based AST.
Rule that builds Java classes as components, resolving Java-type dependencies (method calls, object instantiations, inheritance,
variable and type references)
See also
rules.java.JavaClassMethodRule
Goal
Rule that builds Java classes as components, resolving Java-type dependencies (method calls, object instantiations, inheritance,
variable and type references)
Technology
Java
Components
Classes
Relations
Dependencies resolved are: inheritance, call, var usage, type reference. Methods are NOT resolved. If you
want to represent dependencies with method-level granularity, use rules.java.JavaClassMethodRule
instead.
Configuration examples
Structure
Field Summary
protected null qe
rules.java.jar
Page created on 04/20/2015
com.optimyth.apm.builder.rules.java.jar
com.optimyth.apm.builder.rules.java.jar
rules.java.jar.BasicJarCallback
Class BasicJarCallback
Structure
Class BasicJarCallback
Resolves JAR files as libraries (Software), with contained classes or resources inside. TODO currently unused. Create rule for
processing packed files (JARs, WARs, EARs...)
Structure
rules.java.jar.JarCallback
Interface JarCallback
Structure
Field Summary
Methods Summary
Interface JarCallback
package rules.java.jar
JarCallback - this callback define the events for updating model for every jar found in the java application.
Structure
Field Summary
Methods Summary
rules.java.jar.JarRule
Class JarRule
Goal
Technology
Components
Configuration examples
Structure
Methods Summary
Class JarRule
package rules.java.jar
JarRule -
Rule that extracts a list of jars and its contents from a java application, creating containing relations between a jar and its classes.
Goal
Rule that extracts a list of jars and its contents from a java application, creating containing relations between a jar and its classes.
Technology
Java
Components
Configuration examples
<bean id="apm_rule_jar" class="com.optimyth.apm.builder.rules.java.JarRule">
<property name="xxxx" ref="apm_callback_jar"/>
</bean>
Structure
Methods Summary
comma separated jar ant patterns to use for updating the model
comma separated jar ant patterns to use on class names: only jars containing filtered classes will be added to the model
rules.jcl
com.optimyth.apm.builder.rules.jcl
com.optimyth.apm.builder.rules.jcl
rules.jcl.DefaultJclJobCallback
Class DefaultJclJobCallback
Components
Relations
Configuration examples
Structure
Methods Summary
Class DefaultJclJobCallback
DefaultJclJobCallback - Default implementation for rules.jcl.JclJobCallback resolving procedures, jobs and calls found in JCL scripts.
Components
Relations
calls between the JCL and the called program (which could be another JCL, or an external program)
Configuration examples
Where myScriptApplication and myBackendApplication are the names of the applications where scripts and
programs should be added, respectively. Both of them are optional, with default value
ModelConstants#DEFAULT_APP.
Structure
Methods Summary
Name for the Software container that will hold batch scripts
Name for the Software container that will hold called programs (not batch scripts)
Type of the Software container for holding backend (non batch script) to reference
If true (the default), all entity names are converted to upper-case; if false, case is not changed
If true, target called programs not found in model are created (in batch application).
If false, those calls are ignored.
If true, be mapped so many relationships between the JCL and the element as are referred to in various steps.
If false, be mapped a single relationship between JCL and the element although references the element more than once inside.
If true, register utilities as model components; if false, utilities are not registered as model components. Default: true
rules.jcl.JclJobCallback
Interface JclJobCallback
Structure
Field Summary
Methods Summary
Interface JclJobCallback
package rules.jcl
Structure
Field Summary
Methods Summary
job The job containing the procedure definition (null for catprocs)
procedureName Procedure name
procedure TreeNode with the proc AST node for the procedure.
ctx Buildercontext
returns Component for the procedure (or null if it should be skipped)
rules.jcl.JclRule
Class JclRule
Goal
Technology
Configuration examples
Structure
Methods Summary
Class JclRule
extends from AbstractBuilderRule
package rules.jcl
JclRule -
The rules.jcl.JclJobCallback may be used to construct the job/step structure in batch JCL scripts, and resolve calls to programs and
procedures.
See also
rules.jcl.JclJobCallback
Goal
Technology
Configuration examples
Where apm_filter_jcl is a FileFilter matching only JCL scripts, and apm_callback_JclJob is a bean which
class implements rules.jcl.JclJobCallback.
Structure
Methods Summary
If true (the default), sql statements launched by DB2 utilities executed in JCL will be processed.
If false, SQL is not processed by the rule.
rules.metrics
com.optimyth.apm.builder.rules.metrics
com.optimyth.apm.builder.rules.metrics
rules.metrics.MetricsRule
Class MetricsRule
Structure
Methods Summary
Class MetricsRule
package rules.metrics
Structure
Methods Summary
rules.natural
com.optimyth.apm.builder.rules.natural
com.optimyth.apm.builder.rules.natural
rules.natural.BasicNaturalDependenciesCallback
Class BasicNaturalDependenciesCallback
Goal
Configuration examples
Structure
Methods Summary
Class BasicNaturalDependenciesCallback
BasicNaturalDependenciesCallback -
Callback for converting rule events to model entities for Natural programs.
See also
ByExtensionMapper
CalledProgramResolver
Goal
Callback for converting rule events to model entities for Natural programs.
Configuration examples
<bean id="apm_rule_natural_callback" class=
"com.optimyth.apm.builder.rules.natural.BasicNaturalDependenciesCallback">
<property name="application" value="${model.name}"/>
<property name="resolver" ref="apm_rule_natural_resolver"/>
<property name="mapper" ref="apm_rule_natural_mapper"/>
<property name="databaseType" ref="${database.type}"/>
<property name="databaseName" ref="${database.name}"/>
</bean>
Where calledResolver is the CalledResolver to use (see CalledProgramResolver for a typical implementation for
Natural systems), and mapper is the Mapper that will classify each file in Natural system to the proper entity type (see
ByExtensionMapper for a typical implementation). \\\{{application}}, databaseType and databaseName are the
application where entities should be added, the type of the database and the name of its instance, respectively. All
three properties are optional.
Structure
Methods Summary
If true (the default), all entity names are converted to upper-case; if false, case is not changed
Predicate for database object names that, when matched, will skip the database object
rules.natural.NaturalBuilderRule
Page created on 04/20/2015
Class NaturalBuilderRule
Goal
Configuration examples
Structure
Methods Summary
Class NaturalBuilderRule
package rules.natural
NaturalBuilderRule -
Extraction rule for Software AG's Natural system
See also
rules.natural.BasicNaturalDependenciesCallback
Goal
Configuration examples
Structure
Methods Summary
rules.natural.NaturalDependenciesCallback
Interface NaturalDependenciesCallback
Structure
Field Summary
Methods Summary
Interface NaturalDependenciesCallback
package rules.natural
See also
rules.natural.BasicNaturalDependenciesCallback
Structure
Field Summary
Methods Summary
public getHelper()
Invoked for creating Database entities corresponding to the item (typically an Adabas view)
Invoked when a certain (Adabas) database operation (op) is detected on a certain view, inside item (a Natural program/routine)
rules.natural.NaturalViewRule
Class NaturalViewRule
Structure
Methods Summary
Class NaturalViewRule
package rules.natural
NaturalViewRule - Process Natural local data area descriptors (e.g. .NSL files), looking for lines that declare views: <pre> 0010 V 1
VIEWNAME-VIEW VIEWNAME </pre> For each view declared, a new component is declared
Structure
Methods Summary
Regexp pattern to use for extracting view name from view records (default: \d+\s+V\s\d+\s+(\S+)\s+(\S+)\s*)
Must have two groups for extracting view alias and view name from the line.
rules.oo
com.optimyth.apm.builder.rules.oo
com.optimyth.apm.builder.rules.oo
rules.oo.AbstractClassRule
Class AbstractClassRule
Configuration examples
Structure
Field Summary
Methods Summary
Class AbstractClassRule
extends from AbstractBuilderRule
package rules.oo
AbstractClassRule - Extends AbstractBuilderRule with common behaviour for extraction rules for any class-oriented language (like Java,
.NET, etc.).
This class adds several setters, so a bean declaration may contain the following lines:
See also
rules.oo.ClassCallback
ClassDepsResolver
rules.java.JavaClassRule
rules.java.JavaClassBytecodeRule
rules.dotnet.CSharpClassRule
Configuration examples
Where apm_filter_java is a FileFilter matching only java files, apm_callback_Class is a bean which class
implements ClassCallback}, flags decides which dependencies to resolve, and apm_classResolver is a bean that
implements ClassDepsResolver and resolves dependencies found to model entities and relations. Boolean flags are
optional, with default values true for all.
Structure
Field Summary
Methods Summary
public void setSourceDirs(java.util.List sourceDirs)
The source dirs where class source files start (in Java, roots of package directories)
The single source dir where class source files start (in Java, root of package directories)
Comma-separated list of Ant patterns to use for finding source directories where used classnames will be resolved.
Use this instead of List) or File) if the source
directories are not known in advance but source directories follow certain pattern(s).
NOTE: sourceDir/sourceDirs have precedence over sourcePatterns. If both are specified, sourcePatterns are discarded.
If true, rule will resolve calls to outer classes matching the filter (default: true)
If true, rule will resolve object instantiations for outer classes matching the filter (default: false)
public void setResolveTypeReferences(boolean resolveTypeReferences)
If true, rule will resolve type references for outer classes matching the filter (default: false)
If true, rule will resolve field references for outer classes matching the filter (default: false)
Callback that will receive the "events" when a new class (or dependency) is matched
callback
The resolver that will resolve candidate dependencies to APM model components and relations
rules.oo.AbstractTypeResolverRule
Class AbstractTypeResolverRule
Structure
Field Summary
Methods Summary
Class AbstractTypeResolverRule
package rules.oo
AbstractTypeResolverRule - In the AbstractClassRule we register different lists of candidate dependencies (var references, type
usages, inheritance, etc...)
These dependencies are solved in the postProcess()</code method. In this class, in the
{{rememberNotResolved() method, we wait before saving a candidate into those lists used by AbstractClassRule. Before that,
we register them as CandidateType.
Every time the rule finds a type, it must call checkResolution method, in order to remove that CandidateType from the
type-resolution pending list, and put it in the correct list (e.g. AbstractClassRule.instantiationsToResolve)
Structure
Field Summary
Methods Summary
If set, this resolver tries to resolve a referenced type to its qualified name.
rules.oo.BasicClassCallback
Class BasicClassCallback
Configuration examples
Structure
Methods Summary
Class BasicClassCallback
BasicClassCallback - Default implementation for rules.oo.ClassCallback. Subclasses may change onXXX callbacks, if needed.
Configuration examples
<bean class="com.optimyth.apm.builder.rules.oo.BasicClassCallback">
<property name="application" value="myApp"/>
<property name="addCodeToRelations" value="true"/>
<property name="language" value="vbnet"/>
</bean>
Where myApp is the name of the application where entities should be added, addCodeToRelations decides if the
piece of code behind a relation between classes should be added as a relation's property, and language is the OO
technology being used. All of them are optional with default values ModelConstants#DEFAULT_APP}, and
ClassCallback#JAVA_LANG respectively.
If the application name should be fetched dynamically, a SoftwareResolver could be injected,
Structure
Methods Summary
Name of container application to use if no software resolver is provided (if not provided, defaults to
ModelConstants#DEFAULT_APP)
If set to true, code for the dependency (property RELATION_CODE with List(String)) is added to the relations (default: false)
rules.oo.ClassCallback
Interface ClassCallback
Structure
Field Summary
Methods Summary
Interface ClassCallback
package rules.oo
ClassCallback - Callback that will receive events for extraction rules that process classes in any OO language.
Structure
Field Summary
public static final NULL The /dev/null of ClassCallback. Does nothing: All callback methods return null.
Methods Summary
Adds a new Component under the registered application, adding the current file as artifact.
public getHelper()
rules.oracleforms
com.optimyth.apm.builder.rules.oracleforms
com.optimyth.apm.builder.rules.oracleforms
rules.oracleforms.BasicOracleFormsCallback
Page created on 04/20/2015
Class BasicOracleFormsCallback
Structure
Field Summary
Methods Summary
Class BasicOracleFormsCallback
Structure
Field Summary
Methods Summary
DB type for database entities usages discovered from EXEC SQL embedded statement. If not provided, defaults to
ModelConstants#DB2
Set the schema resolver here. Use this alternatively to schema name, but at least one must be specified!
If true (the default), all entity names are converted to upper-case; if false, case is not changed
Predicate for database object names that, when matched, will skip the database object
rules.oracleforms.OracleFormsCallback
Interface OracleFormsCallback
Structure
Field Summary
Methods Summary
Interface OracleFormsCallback
package rules.oracleforms
Structure
Field Summary
Methods Summary
returns Component for the form, or null. The component should be linked to a Software element
rules.oracleforms.OracleFormsRule
Class OracleFormsRule
Structure
Field Summary
Methods Summary
Class OracleFormsRule
package rules.oracleforms
Structure
Field Summary
Methods Summary
rules.php
com.optimyth.apm.builder.rules.php
com.optimyth.apm.builder.rules.php
rules.php.BasicPhpCallback
Class BasicPhpCallback
Structure
Class BasicPhpCallback
Structure
rules.php.PhpBuilderRule
Class PhpBuilderRule
Structure
Methods Summary
Class PhpBuilderRule
package rules.php
Structure
Methods Summary
NodePredicate that, when matches a candidate MethodDeclaration, the rule will register the method as component of the
enclosing class.
If true, PHP class methods are modelled as operation Components; if false, only dependencies between classes are modelled.
If true, resolve dependencies in embedded SQL code; if false, no SQL code is processed
public void setRegisterFunctions(boolean registerFunctions)
When true, PHP functions are registered as operation Components; when false, only dependencies between PHP programs or
classes are modelled.
If set, the views SQL code is parsed for relations with other views/tables
Optional FallbackSqlListener instance to process SQL statements when sqlListener cannot parse it
rules.php.PhpCallback
Interface PhpCallback
Structure
Methods Summary
Interface PhpCallback
package rules.php
PhpCallback -
Structure
Methods Summary
rules.php.PhpDatabaseCallback
Class PhpDatabaseCallback
Structure
Class PhpDatabaseCallback
package rules.php
PhpDatabaseCallback -
Structure
rules.plsql
com.optimyth.apm.builder.rules.plsql
com.optimyth.apm.builder.rules.plsql
rules.plsql.BasicPlsqlCallback
Class BasicPlsqlCallback
Structure
Methods Summary
Class BasicPlsqlCallback
Structure
Methods Summary
Set the schema resolver here. Use this alternatively to schema name, but at least one must be specified!
Set the schema name here. Use this alternatively to schema resolver, but at least one must be specified!
The file filter to match standalone SQL scripts that will be registered in the model.
Useful for discriminating between schema exported SQL (that should not be registered in the model)
and application scripts (that should be registered).
Default: Rejects any script file.
Predicate for database object names that, when matched, will skip the database object
rules.plsql.PlsqlBuilderRule
Class PlsqlBuilderRule
Goal
Components
Relations
Configuration examples
Structure
Field Summary
Methods Summary
Class PlsqlBuilderRule
PlsqlBuilderRule - .
Extracts PL/SQL dependencies: types, functions, procedures, packages (its internal functions/procedures/types as well), triggers, used
SQL queries and tables, used sequences. This rule is typically used for parsing PL/SQL exported by the schemaExtract script for Oracle
(GLOBAL plugin). If your PL/SQL code contains other PL/SQL, the rules.plsql.PlsqlDatabaseSchemaRule subclass could be used
instead for extracting other Oracle entities in PL/SQL code.
Goal
Extracts PL/SQL dependencies: types, functions, procedures, packages (its internal functions/procedures/types as well), triggers, used
SQL queries and tables, used sequences. This rule is typically used for parsing PL/SQL exported by the schemaExtract script for Oracle
(GLOBAL plugin). If your PL/SQL code contains other PL/SQL, the rules.plsql.PlsqlDatabaseSchemaRule subclass could be used
instead for extracting other Oracle entities in PL/SQL code.
Components
Relations
When the rule detects one of the above dependencies on the PL/SQL program AST,
invokes the proper callback method.
Configuration examples
Structure
Field Summary
Methods Summary
If set to true, PL/SQL entities (types, stored procedures, schemas and packages) not found in software sources will be created
(when possible).
If set to false, no extra PL/SQL entities. Please remember that when a reference is not fully qualified, it is not possible to infer the
target element.
rules.plsql.PlsqlCallback
Interface PlsqlCallback
Structure
Field Summary
Methods Summary
Interface PlsqlCallback
package rules.plsql
Structure
Field Summary
Called when processing any SQL file. Returns database schema where the SQL file belongs (e.g. with exported schema files)
Called when a SQL script (not a exported schema file) is found. Returns the component modelling the script
Called when a sequence NEXTVAL or CURRVAL is invoked (an usage of a SEQUENCE by the calling component)
public createRelation(com.optimyth.apm.model.portfolio.Component source,
com.optimyth.apm.model.ApmEntity destination, rules.plsql.PlsqlTypeResolver.RelationType
relationType)
rules.plsql.PlsqlDatabaseSchemaRule
Class PlsqlDatabaseSchemaRule
Structure
Methods Summary
Class PlsqlDatabaseSchemaRule
package rules.plsql
PlsqlDatabaseSchemaRule - Extends rules.plsql.PlsqlBuilderRule by processing database objects created in DDL statements inside
SQL scripts (CREATE/ALTER TABLE, CREATE VIEW, CREATE INDEX, CREATE SYNONYM, CREATE SEQUENCE, CREATE
DATABASE LINK, COMMENT).
Structure
Methods Summary
The DatabaseCallback to use for registering database elements not supported by plsql callback
rules.powerscript
com.optimyth.apm.builder.rules.powerscript
com.optimyth.apm.builder.rules.powerscript
rules.powerscript.BasicPowerscriptCallback
Class BasicPowerscriptCallback
Structure
Field Summary
Methods Summary
Class BasicPowerscriptCallback
Structure
Field Summary
Methods Summary
DB type for database entities usages discovered from EXEC SQL embedded statement. If not provided, defaults to
ModelConstants#DB2
DB instance name for database entities usages discovered from EXEC SQL embedded statement. If not provided, defaults to
ModelConstants#DB2
If true (the default), all entity names are converted to upper-case; if false, case is not changed
Predicate for database object names that, when matched, will skip the database object
rules.powerscript.PowerscriptCallback
Interface PowerscriptCallback
Structure
Field Summary
Methods Summary
Interface PowerscriptCallback
package rules.powerscript
Structure
Field Summary
Methods Summary
rules.powerscript.PowerscriptClassRule
Class PowerscriptClassRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Field Summary
Methods Summary
Class PowerscriptClassRule
package rules.powerscript
Adds Powerscript classes to the model and all dependencies to its includes files.
Goal
Adds Powerscript classes to the model and all dependencies to its includes files.
Technology
Powerscript
Components
Relations
This rule simply adds an 'contains' relation: class -> included methods
Configuration examples
Structure
Field Summary
Methods Summary
com.optimyth.apm.builder.rules.rpg
com.optimyth.apm.builder.rules.rpg
rules.rpg.BasicRpgCallback
Class BasicRpgCallback
Structure
Field Summary
Methods Summary
Class BasicRpgCallback
Structure
Field Summary
Methods Summary
If set to true, RPG - SQL dependencies will be extracted from EXEC SQL statements
If true, procedures are registered, and calls to procedures are represented in the model
public void setCopyResolver(rules.common.callresolution.CalledResolver copyResolver)
Default software resolver to use for unresolved items (only used if registerUnresolved = true)
The default resolver to use when injected #setCalledResolver cannot resolve called program.
Predicate for database object names that, when matched, will skip the database object
DB type for database entities usages discovered from EXEC SQL embedded statement. If not provided, defaults to
ModelConstants#DB2
DB instance name for database entities usages discovered from EXEC SQL embedded statement. If not provided, defaults to
ModelConstants#DB2
rules.rpg.RpgBuilderRule
Class RpgBuilderRule
Structure
Methods Summary
Class RpgBuilderRule
package rules.rpg
Structure
Methods Summary
Interface RpgCallback
Structure
Field Summary
Methods Summary
Interface RpgCallback
package rules.rpg
Structure
Field Summary
Methods Summary
rules.soa
com.optimyth.apm.builder.rules.soa
com.optimyth.apm.builder.rules.soa
rules.soa.WSDLRule
Class WSDLRule
Structure
Methods Summary
Class WSDLRule
package rules.soa
Web Service WSDL Rule - Process WSDL descriptors, creating web service components and optionally operations (as method
components) when createWebServiceMethods = true.
Structure
Methods Summary
The name of the containing software, to use as fallback if no explicit or global software resolver can resolve container for artifacts
The software type (default: "application"), to use as fallback if no explicit or global software resolver can resolve artifact
rules.spring
com.optimyth.apm.builder.rules.spring
com.optimyth.apm.builder.rules.spring
rules.spring.BasicSpringDescriptorCallback
Class BasicSpringDescriptorCallback
Configuration examples
Structure
Field Summary
Methods Summary
Class BasicSpringDescriptorCallback
Configuration examples
<bean id="apm_callback_SpringDescriptor" class=
"com.optimyth.apm.builder.rules.spring.BasicSpringDescriptorCallback">
<property name="application" value="myApplication"/>
<property name="beanFilter" value="myBeanFilter"/>
<property name="classFilter" value="myClassFilter"/>
</bean>
Where application is the application name where beans belong to, beanFilter decides what beans should be
filtered out and classFilter decides what beans should be filtered out based on their classname. All three
properties are optional, with default values ModelConstants#DEFAULT_APP, BeanFilter#ALL ("accept all beans") and
Predicate#JDK_FILTER ("ignore JDK classes"), respectively.
In the #setSpringProcessor property, extra processors for modelling specific resources could be registered, so the raw
beans could be related to extra model entities.
Structure
Field Summary
Methods Summary
The bean filter to use for deciding which beans and dependencies the rule will process
The bean classes that will be EXCLUDED from processing match classFilter.
The SpringProcessor to notify when Spring elements (descriptor, bean, dependency, imported descriptor) are processed.
public void setResolver(rules.oo.ClassDepsResolver resolver)
The resolver for dependencies between Spring beans and Java classes
rules.spring.SpringDescriptorCallback
Interface SpringDescriptorCallback
Structure
Field Summary
Methods Summary
Interface SpringDescriptorCallback
package rules.spring
SpringDescriptorCallback - Logic for converting Spring bean definitions and dependencies to Component entities.
Structure
Field Summary
Methods Summary
Registers an alias
rules.spring.SpringDescriptorRule
Class SpringDescriptorRule
package rules.spring
SpringDescriptorRule -
Process parsed Spring descriptors looking for bean definitions, dependencies between them and imports.
See also
rules.spring.SpringDescriptorCallback
Goal
Process parsed Spring descriptors looking for bean definitions, dependencies between them and imports.
Technology
Java / Spring
Components
Relations
uses relation (between injection dependencies between beans, configures relation between beans and the descriptors where they are
declared
Configuration examples
Structure
Methods Summary
public void setCallback(rules.spring.SpringDescriptorCallback callback)
rules.spring.webflow
com.optimyth.apm.builder.rules.spring.webflow
com.optimyth.apm.builder.rules.spring.webflow
rules.spring.webflow.BasicSpringWebflowCallback
Class BasicSpringWebflowCallback
Configuration examples
Structure
Methods Summary
Class BasicSpringWebflowCallback
Configuration examples
Where application is the name of the Web Application using Spring Webflow, parseBeanImports decides if
bean-import elements should be processed, and webappRoot is the Web Application's basedir. If no
application were set, ModelConstants#DEFAULT_APP would be used. parseBeanImports is false by default.
webappRoot is not mandatory either, but you will need to fill it if you want to parse relations between view-states
and their JSP pages.
Structure
Methods Summary
public void setApplication(String application)
rules.spring.webflow.SpringWebflowCallback
Interface SpringWebflowCallback
Structure
Field Summary
Methods Summary
Interface SpringWebflowCallback
package rules.spring.webflow
SpringWebflowCallback - Generic callback for flow descriptors found and their inner elements (states, transitions and imports).
Structure
Field Summary
Methods Summary
rules.spring.webflow.SpringWebflowRule
Class SpringWebflowRule
Goal
Technology
Configuration examples
Structure
Methods Summary
Class SpringWebflowRule
package rules.spring.webflow
SpringWebflowRule -
Process Spring Webflow descriptors and looks for bean imports, view/action/decision/subflow/end states and transitions between them.
See also
rules.spring.webflow.SpringWebflowCallback
Goal
Process Spring Webflow descriptors and looks for bean imports, view/action/decision/subflow/end states and transitions between them.
Technology
Configuration examples
Structure
Methods Summary
rules.sql
com.optimyth.apm.builder.rules.sql
com.optimyth.apm.builder.rules.sql
rules.sql.BasicDatabaseCallback
Class BasicDatabaseCallback
Structure
Methods Summary
Class BasicDatabaseCallback
BasicDatabaseCallback -
Structure
Methods Summary
Predicate for database object names that, when matched, will skip the database object
rules.sql.DatabaseCallback
Interface DatabaseCallback
Structure
Field Summary
Methods Summary
Interface DatabaseCallback
package rules.sql
Structure
Field Summary
Methods Summary
rules.sql.SqlCallback
Interface SqlCallback
Structure
Methods Summary
Interface SqlCallback
package rules.sql
SQL-AST processing: this class is a sql helper (used for example by JDBC, Cobol or PLSQL rules)
Structure
Methods Summary
Called when a table is reference. Calling is the component that uses the table. tableName is the qualified name.
Typically this finds in the model the schema where the table lives
rules.struts
com.optimyth.apm.builder.rules.struts
com.optimyth.apm.builder.rules.struts
rules.struts.JspStrutsCallback
Class JspStrutsCallback
Structure
Class JspStrutsCallback
package rules.struts
This callback creates the relation between the jsp and the Struts action (encoded as html:form element in JSP).
Creates a formBean (elementstrutsType=action) component, and a jsp (page) uses:action> formBean relation.
Structure
rules.struts.JspStrutsRule
Class JspStrutsRule
Structure
Methods Summary
Class JspStrutsRule
package rules.struts
See also
rules.struts.JspStrutsCallback
Structure
Methods Summary
The (fallback) directory where web content can be found (for resolving
relative URLs to code resources).
Matching WebApp
bean (detected by
rules.j2ee.webapp.webxml.WebXmlRule) will
be tried. If no WebApp is matched, this webContents is used as fallback
base dir for JSP resources. This permits the rule to operate without a
WebXmlRule resolving web applications explicitely.
rules.struts.StrutsCallback
Class StrutsCallback
Structure
Field Summary
Methods Summary
Class StrutsCallback
package rules.struts
Structure
Field Summary
Methods Summary
rules.struts.StrutsRule
Class StrutsRule
Structure
Methods Summary
Class StrutsRule
package rules.struts
StrutsRule - Process Struts XML descriptors, and registers actions and form beans found.
Structure
Methods Summary
rules.tag
com.optimyth.apm.builder.rules.tag
com.optimyth.apm.builder.rules.tag
rules.tag.PropagationTagRule
Class PropagationTagRule
Structure
Methods Summary
Class PropagationTagRule
package rules.tag
PropagationTagRule - A tag rule that use uses a startAql / startTagOperation to find and tag matched entities, and on each matched
entity applies a (typically relative) propagationAql to found "dependent" entities, that are tagged by the propagationTagOperation.
Structure
Methods Summary
the propagation AQL, that will return which entities from each source entity will be tagged
rules.tag.TagRule
Page created on 04/20/2015
Class TagRule
Structure
Methods Summary
Class TagRule
package rules.tag
TagRule - Trivial tagging rule, for applying a tag operation on each entity matching an AQL query.
Structure
Methods Summary
rules.transactsql
com.optimyth.apm.builder.rules.transactsql
com.optimyth.apm.builder.rules.transactsql
rules.transactsql.TransactSqlBuilderRule
Class TransactSqlBuilderRule
Structure
Methods Summary
Class TransactSqlBuilderRule
TransactSqlBuilderRule - Models database entities found in Transact-SQL (T-SQL) code. Remember that SQL Server has a 4-part
naming scheme: server.database.ownerSchema.object.
Structure
Methods Summary
rules.validation
com.optimyth.apm.builder.rules.validation
com.optimyth.apm.builder.rules.validation
rules.validation.DeclarativeValidationRule
Class DeclarativeValidationRule
Structure
Methods Summary
Class DeclarativeValidationRule
package rules.validation
DeclarativeValidationRule - Rule that uses <em>DEPendencies VAlidation Language</em> (DEPVAL) to detect non-valid dependencies
found in a software system source code.
Please see checKing AIM Manual for a complete specification on DEPVAL.
Structure
Methods Summary
rules.vb
com.optimyth.apm.builder.rules.vb
com.optimyth.apm.builder.rules.vb
rules.vb.BasicVisualBasicCallback
Class BasicVisualBasicCallback
Structure
Field Summary
Methods Summary
Class BasicVisualBasicCallback
Structure
Field Summary
Methods Summary
rules.vb.VbpBuilderRule
Class VbpBuilderRule
Goal
Technology
Components
Relations
Configuration examples
Structure
Class VbpBuilderRule
package rules.vb
VbpBuilderRule -
This rule gets the most important information from VBP project (.vbp) file . A VBP file contains the references to external components:
bas modules, ocxs, dlls... to be resolved. It also identifies the existence of a vbProject.
Goal
This rule gets the most important information from VBP project (.vbp) file . A VBP file contains the references to external components:
bas modules, ocxs, dlls... to be resolved. It also identifies the existence of a vbProject.
Technology
vb6
Components
VB application (Software of type application), referenced DLLs (as Software of type library), ActiveX controls or modules (as bean),
class, form (window)
Relations
Configuration examples
<bean id="apm_rule_vbp" class="com.optimyth.apm.builder.rules.vb.VbpBuilderRule">
<description>Resolves a VB6 application and dependencies declared in .vbp files
</description>
<property name="callback" ref="apm_rule_vb_callback"/>
</bean>
Where callback is the rules.vb.VisualBasicCallback to use for interacting with the model.
An optional filter could be used to limit the .vbp files to process (if not provided, all .vbp files will be processed).
Structure
rules.vb.VisualBasicBuilderRule
Class VisualBasicBuilderRule
Structure
Field Summary
Methods Summary
Class VisualBasicBuilderRule
package rules.vb
AbstractVisualBasicBuilderRule - A base for all the Visual Basic rules. TODO resolve calls and other language relevant elements
Structure
Field Summary
Methods Summary
rules.vb.VisualBasicCallback
Interface VisualBasicCallback
Structure
Field Summary
Methods Summary
Interface VisualBasicCallback
package rules.vb
Structure
Field Summary
Methods Summary
variables.rules
com.optimyth.apm.builder.variables.rules
com.optimyth.apm.builder.variables.rules
variables.rules.DefaultVariablesCallback
Class DefaultVariablesCallback
Structure
Class DefaultVariablesCallback
package variables.rules
Structure
variables.rules.IVariablesCallback
Interface IVariablesCallback
Structure
Field Summary
Methods Summary
Interface IVariablesCallback
package variables.rules
Structure
Field Summary
Methods Summary
public com.optimyth.apm.model.variables.ProgramCall
addProgramCall(com.optimyth.apm.model.variables.Program caller,
com.optimyth.apm.model.variables.Program called, BuilderContext ctx)
public com.optimyth.apm.model.variables.Variable
addVariable(com.optimyth.apm.model.variables.Variable v, BuilderContext ctx)
Method that add variable
v Data of Variable
ctx Context
returns Variable
public com.optimyth.apm.model.variables.RelationVar
addRelationVar(com.optimyth.apm.model.variables.RelationVar rel, BuilderContext ctx)
rel Relation
ctx Context
returns RelationVar
ctx Context
returns Helper for variables
variables.rules.cobol
com.optimyth.apm.builder.variables.rules.cobol
com.optimyth.apm.builder.variables.rules.cobol
variables.rules.cobol.CobolVariablesBuilderRule
Class CobolVariablesBuilderRule
Structure
Methods Summary
Class CobolVariablesBuilderRule
package variables.rules.cobol
Structure
Methods Summary
When a model build task is launched, a set of JMX MBeans (management objects) are published and could be accessed using any
external JMX-enabled tools, like jconsole or jvisualvm (provided with Oracle Java Runtime). Simply connect the JMX console to the
model builder java process (ConfigurationApmModelBuilderTask).
JMX management interfaces (beans) are exposed by the model builder script for monitoring and/or live configuration changes. The
beans could be seen in the JMX management console:
Execution traces
Sometimes, custom rules may produce infinite loops that are difficult to trace in a running model builder task. Using a JMX console you
may look at the existing processing thread (main):
This could help detecting problems (like infinite loops or performance problems) in custom rules.
Exposes management interface for the current model builder script under execution.
Statistics help to understand how model building is progressing.
cancel void cancel() Force graceful cancellation of the model building task.
Controls trace logger, that generate log entries in the trace logfile for each model building event (rule execution, source file processing,
and creation of enties and relations in model).
Setting all log levels to DEBUG ensure that all events are logged (use with caution in production, as logging may impact performance).
MainLevel string Logging level for main model building events (DEBUG, INFO, WARN, ERROR,
OFF)
ModelLevel string Logging level for model entities & relations creation events (DEBUG, INFO, WARN,
ERROR, OFF)
ParseLevel string Logging level for source parsing events (DEBUG, INFO, WARN, ERROR, OFF)
RuleLevel string Logging level for rule execution events (DEBUG, INFO, WARN, ERROR, OFF)
openLogHub void openLogHub(int port, string Create a log hub (server where log collectors can connect)
format)
Profiler: com.optimyth.aim:type=listeners,name=profiler
Controls the AIM profiler. This profiler remembers elapsed time in parsing and rule execution, and could be useful for optimizing custom
rules.
The output is generated in a CSV (comma-separated values) that could be opened in Excel.
FilesProfiled boolean If true, elapsed time for processing each input file is stored. May penalize performance.
ParsersProfiled boolean If true, parse times are collected for each language processed.
dump void dump(string path) Dumps current profiling data either to screen or to the given file path (when provided)
Configuration: com.optimyth.aim:type=configuration,tech=TECH,subtech=SUBTECH
Each configuration block is represented by a JMX bean that provides read-only access to the configuration properties.
These beans could be useful for checking configuration properties.
Attribute Type Meaning
getProperty string getProperty(string key) The value for the requested configuration property
Logging: com.optimyth.aim:type=Logging
Represents query server logging system. This management interface permits live changes on the logging configuration.
getLevel string getLevel(string logger) Get logging level for the logger item
setLevel void setLevel(string logger, string level) Set logging level for logger item
configure void configure(string) Configures logging (properties text or path to .properties file)
deactivateLogging void deactivateLogging(string logger) Deactivate logging for the given logger
openLogHub void openLogHub(int port, string format) Create a log hub (server where log collectors can connect)
Types
person
unit
organization
software
component
class
program
configuration
operation
webService
flow
page
resource
databaseInstance
databaseObject
storedProcedure
sql
window
group
other
Obsolete:
businessProcess
businessObject
businessService
table
view
Subtypes
softwareType
application
module
layer
library
middleware
tool
product
framework
database
other
programType (cobol)
script
copy
unitType
area
subarea
department
staff
workgroup
other
orgType
ownOrg
delegation
partner
softwareFactory
other
j2eeType
servlet
filter
jsp
resource
taglib
contextListener
statefulSessionBean
statelessSessionBean
entityBean
messageDrivenBean
springType
bean
plsqlType
function
procedure
trigger
package
sequence
aspnetType
page
masterpage
webservice
control
httpHandler
httpModule
resource
assembly
codeBehindClass
aspType
page
comobj
resource
abapType
report
program
fpool
class
interface
screen
selection
form
module
function
macro
data
dialog
table
query
transaction
transformation
Checking QA
Checking AIM is technically a plugin for checking QA product. This is then the main requirement: you need a full installation of
checking QA to get AIM working.
The number of components and relations (registered in model datafile) dominates the size of the generated files, so only this factor will
be considered here. The number of components and relationships are intimately related with the source code analysed. The following
considerations are based on one specific model as follows:
Components: 10K
Relationships: 100K
The total size of all the files generated when a model with this size is analyzed is about 40MB.
If you know in advance the approximate number of entities to be represented in all your AIM model datafiles, a (conservative) rule of
thumb is to reserve 5KB of hard disk per entity.
Directories Access
Models are placed in the CHECKING_DATA/config/plugindata/appmap directory. Due to performance
considerations, it is recomended that this directory is placed in a local hard disk. Performance may suffer if this
directory is placed in a network (shared) disk unit.
Checking AIM requires read/write access to USER_HOME. For example, in Windows 7: C:\Users\<Username>
Memory requirements
The building model process is an intensive analysis job the goal of which is to extract the different components and relationships. It is
achieved by parsing all the source code.
For the previous specified model (with 22K components and 220K relationships) 1GB RAM should be necessary for each concurrent
analysis.