To get document processing you can write a simple JAPE rule like:
Phase: DocName
Input: Token
Options: control = once
Rule:DocName
(
{Token}
)
-->
{
System.out.println(doc.getName());
}
Put this rule as a first rule in your pipeline. I hope that you have a least 1 Token in the document.