AnsweredAssumed Answered

Reloading task possible?

Question asked by antje on Oct 11, 2010
Latest reply on Oct 13, 2010 by falko.menge
Is it possible to reactivate a task, which is found in the tasklist assigned to an user?
I tried the following code:

    public void reloadProcessByTask(final Task task) {
        m_processInstance = (ExecutionEntity) m_processEngine.getRuntimeService()
            .createExecutionQuery()
            .executionId(task.getExecutionId())
            .singleResult();

        ProcessDefinition procDef = m_processEngine.getRepositoryService()
            .createProcessDefinitionQuery()
            .id(task.getProcessDefinitionId()).singleResult();

        ((ExecutionEntity) m_processInstance).setProcessDefinition((ProcessDefinitionImpl) procDef);
    }

Later the program fails, when I try to get the activities from the processDefinition (activities are empty).
What`s wrong with the code? Is there a better solution to get an old task run?

Thanks
Antje

Outcomes