Retrieving Activity Quality Assurance Information

This chapter describes how to retrieve information on quality assurance for activity instances.

Retrieving the State regarding Quality Assurance

To retrieve the state of a given activity instance regarding quality assurance, use the following method of the ActivityInstance interface:

QualityAssuranceState getQualityAssuranceState();

The method returns an object of type QualityAssuranceState.

The following quality assurance states are defined:

Retrieving Information on Quality Assurance Workflow

The ActivityInstance interface provides the following method to get information about the performed quality assurance workflow:

QualityAssuranceInfo getQualityAssuranceInfo();

It returns a QualityAssuranceInfo object with information on the quality assurance workflow. In case no quality assurance is enabled for the activity instance, the return value is null.

Quality Assurance Attributes

The class ActivityInstanceAttributes contains attributes of an activity instance. To retrieve these attributes, use the method

ActivityInstanceAttributes getAttributes();

The method returns an instance of ActivityInstanceAttributes.

Call this method to get attributes for your activity instance, e.g.:

ActivityInstanceAttributes attr = ai.getAttributes();

The ActivityInstanceAttributes instance provides methods for:

To store attributes of an activity instance in the database, use:

void WorkflowService.setActivityInstanceAttributes(ActivityInstanceAttributes attributes)

For details on the this method, refer to the JavaDoc of WorkflowService.

Setting and Getting Quality Assurance Results

To set the quality assurance result attribute for the specific activity instance, use method

void setQualityAssuranceResult(QualityAssuranceResult result);

To retrieve the quality assurance result attribute for the activity instance use:

QualityAssuranceResult getQualityAssuranceResult();

The return value will be null for non quality assurance activity instances or newly created quality assurance instance.

The interface QualityAssuranceResult contains getter and setter methods for the following:

Quality assurance code

The methods to set and get quality assurance code are:

void setQualityAssuranceCodes(Set<QualityAssuranceCode> codes);

Set<QualityAssuranceCode> getQualityAssuranceCodes();

Quality assurance result state

The methods to retrieve and set quality assurance result states are:

void setQualityAssuranceState(ResultState state);

ResultState getQualityAssuranceState();

The following quality assurance result states are defined:

Flag for assignment to last activity performer

The following methods can be used to set or retrieve the boolean flag to determine if the quality assurance activity instance is assigned to the last activity performer:

void setAssignToLastActivityPerformer(boolean assign);
boolean getAssignToLastActivityPerformer();

Adding and Retrieving Notes

Adding notes

To add a new note to your activity instance, e.g. with the context of the quality assurance, use

Note addNote(String text);

Or, for a list of notes, use:

void setNotes(List<Note> notes);

Note that the added notes are not persisted! They are only added to the attribute, but not yet saved in the database. In order to persist the added notes, call:

void WorkflowService.setActivityInstanceAttributes(ActivityInstanceAttributes attributes)

Retrieving notes

To retrieve a list of all notes set for the activity instance, e.g. for quality assurance, use the following method:

List<Note> getNotes();