Adding Notes to Process Instances

Notes Attributes

The class org.eclipse.stardust.engine.api.runtime.dto.ProcessInstanceAttributes contains notes attributes of the process instance. The method

ProcessInstanceAttributes org.eclipse.stardust.engine.api.runtime.ProcessInstance.getAttributes()

returns an instance of ProcessInstanceAttributes.

Call this method to get the notes attributes for your process instance, e.g.:

ProcessInstanceAttribites attr = pi.getAttributes();

The method

long ProcessInstanceAttributes.getProcessInstanceOid()

returns the OID of the associated process instance.

Adding Notes

To add a new note to your process instance, with the context of this note being the process instance itself, use

Note ProcessInstanceAttributes.addNote(String)

Note that this note is not persisted! It is only added to the attribute, but not yet saved in the database. Section Persisting the Notes describes how the notes added to the attribute are saved to the database.

Please refer to the JavaDoc description of Note for detailed information on this type.

Adding Notes with Context Kind

The method

Note ProcessInstanceAttributes.addNote(String, ContextKind, long)

also adds a new note. Here the context of this note is selected by ContextKind and a long value, which is the OID of the context object. Note that this note is not persisted! It is only added to the attribute, but not yet saved in the database. Section Persisting the Notes describes how the notes added to the attribute are saved to the database.

For information on the type ContextKind please refer to the according JavaDoc description for ContextKind.

List /<Note>/ ProcessInstanceAttributes.getNotes()

returns a list of all notes.

Persisting the Notes

In order to persist the added notes, call:

void WorkflowService.setProcessInstanceAttributes(ProcessInstanceAttributes attributes)

Note that momentarily only scope process instances are supported as only notes are supported there. Also note that it is not possible to change notes, you only have the option to add them.