...
Code Block |
---|
language | java |
---|
title | Dołączanie dokumentu z archiwum do procesu |
---|
linenumbers | true |
---|
|
documentService.attachDocumentToProcess( documentId, documentClassId, "admin", "103_proces1", "103_proces1_zadanie1" );// podajemy id dokumentu i id klasy
documentService.attachDocumentToProcess( wfDocument, "admin", "103_proces1", "103_proces1_zadanie1" );// lub obiekt dokumentu pobrany z archiwum |
Code Block |
---|
language | java |
---|
title | Odłączenie dokumentu od procesu |
---|
linenumbers | true |
---|
|
documentService.detachDocumentFromProcess( doc.getId(), doc.getDocumentClassId(), processId);// podajemy id dokumentu i id klasy
documentService.detachDocumentFromProcess( wfDocument, processId);// lub obiekt dokumentu |
Code Block |
---|
language | java |
---|
title | Odczytywanie indeksów |
---|
linenumbers | true |
---|
|
WfDocument document = documentService.getDocument( documentId, documentClassId );
IndexInfo indexInfo1 = document.getIndexByName( "idx1" );//pobieramy indeks po nazwie
IndexInfo indexInfo2 = document.getIndexById( 1L );//pobieramy indeks po id
Long id = indexInfo1.getId();// id indeksu
String name = indexInfo1.getName();// nazwa indeksu
IndexType type = indexInfo1.getType();// STRING, INTEGER, LIST, DATE, DOUBLE
Object value = indexInfo1.getValue();// wartość indeksu, typ odpowiedni do IndexType
if ( type == IndexType.DATE )
{
Date dateValue = (Date) value;
}
else if ( type == IndexType.LONG )
{
Long longValue = (Long) value;
}
else if ( type == IndexType.DOUBLE )
{
Double doubleValue = (Double) value;
}
else
{// STRING lub LIST
String stringValue = (String) value;
}
//Fukncje ułatwiajace dostęp do wartości indeksów:
String stringValue=(String)document.getIndexValue( "idx1" );
Date dateValue=(Date)document.getIndexValue( 1L ); |
...
Code Block |
---|
language | java |
---|
title | Odczytywanie Zmiana indeksów |
---|
linenumbers | true |
---|
|
WfDocument document = documentService.getDocument( documentId, documentClassId );
IndexInfo
indexInfo1 = document.getIndexByName( "idx1" );//pobieramy indeks po nazwie IndexInfo indexInfo2indexInfo1 = document.getIndexByIdgetIndexByName( 1L"idx1" );// pobieramy indeks po idnazwie
Long id
= indexInfo1.getId();// id indeksu String name = indexInfo1.getName();//ustawienie nazwawartości indeksuindeksów
IndexType type = indexInfo1.getTypesetValue( "abc" );//typ STRING,
INTEGER, LIST, DATE, DOUBLE document.setIndexValue( Object value = indexInfo1.getValue()2L,new Date() );//poprzez wartość indeksuid, typ odpowiedniDATE
do IndexType
if ( type == IndexType.DATE )
{
Date dateValue = (Date) value;
document.setIndexValue( "idx3",333L );//poprzez nazwę, typ LONG
} else if ( type == IndexType.INTEGER )
{
Integer intValue = (Integer) value;
}
else if ( type == IndexType.DOUBLE )document.setIndexValue("idx4",0.4);//type DOUBLE
{
Double doubleValue = (Double) value;
}
else
{// STRING lub LIST
//Typy wprowadzanych wartości muszą odpowiadać typom indeksów
String stringValue = (String) value;
}
//Fukncje ułatwiajace dostęp do wartości indeksów:
String stringValue=(String)document.getIndexValue( "idx1" );
Date dateValue=(Date)document.getIndexValue( 1L );documentService.updateDocument( document );//funkcja zapisuje zmiany w bazie danych |
Wyszukiwanie dokumentów
Do wyszukiwania dokumentów należy używać klasy DocumentFinder
...