Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleDołączanie dokumentu z archiwum do procesu
linenumberstrue
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
languagejava
titleOdczytywanie indeksów
linenumberstrue
		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.INTEGER )
        {
            Integer intValue = (Integer) 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 );


Wyszukiwanie dokumentów

Do wyszukiwania dokumentów należy używać klasy DocumentFinder

...