use of org.alfresco.repo.workflow.WorkflowObjectFactory in project alfresco-remote-api by Alfresco.
the class ProcessDefinitionsImpl method getStartFormModel.
@Override
public CollectionWithPagingInfo<FormModelElement> getStartFormModel(String definitionId, Paging paging) {
// first validate if user is allowed to access the process definition if workflows are deployed per tenant
if (tenantService.isEnabled() && deployWorkflowsInTenant) {
ProcessDefinitionQuery query = activitiProcessEngine.getRepositoryService().createProcessDefinitionQuery().processDefinitionId(definitionId);
query.processDefinitionKeyLike("@" + TenantUtil.getCurrentDomain() + "@%");
org.activiti.engine.repository.ProcessDefinition processDefinition = query.singleResult();
if (processDefinition == null) {
throw new EntityNotFoundException(definitionId);
}
}
StartFormData startFormData = activitiProcessEngine.getFormService().getStartFormData(definitionId);
if (startFormData == null) {
throw new EntityNotFoundException(definitionId);
}
if (qNameConverter == null) {
qNameConverter = new WorkflowQNameConverter(namespaceService);
}
if (workflowFactory == null) {
workflowFactory = new WorkflowObjectFactory(qNameConverter, tenantService, messageService, dictionaryService, engineId, defaultStartTaskType);
}
// Lookup type definition for the startTask
TypeDefinition startTaskType = workflowFactory.getTaskFullTypeDefinition(startFormData.getFormKey(), true);
return getFormModelElements(startTaskType, paging);
}
Aggregations