Versions Compared

Key

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

...

Code Block
languagejava
titleOperacje na procesach
linenumberstrue
        ProcessBuilderDefinition definition = new ProcessBuilderDefinition();
        definition.setPackageId( "suncode" );
        definition.setCreator( "admin" );
        definition.setCreatorPassword( "enhydraxxxxxx" );
        definition.setProcessDefId( "proces1" );
        Map<String, Object> variables = new HashMap<String, Object>();
        variables.put( "zmienna1", "abc" );
        definition.setVariables( variables );
        String processId = processService.createProcess( definition );
 
		// Pobieranie informacji o procesie
        Process process = processService.getProcess( processId );
        process = processService.getProcess( processId, Process.JOIN_PROCESS_DEFINITION );// jeżeli chcemy mieć dostęp
                                                                                          // do definicji procesu
        String name = process.getName();
        String desc = process.getDescription();
        // Definicja procesu
        ProcessDefinition processDef = process.getProcessDefinition();
        String packageId = processDef.getPackageId();// bez Process.JOIN_PROCESS_DEFINITION rzuci wyjątek
        String processDefId = processDef.getProcessDefinitionId();
        // Zmiana wartości zmiennych procesu
        Map<String, Object> ctx = processService.getProcessContext( processId );
        ctx.put( "zmienna", "abc" );
        processService.setProcessContext( processId, ctx );
        //Usunięcie procesu
        processService.deleteProcess( processId );

...