org.activiti.engine.form.StartFormData Java Examples

The following examples show how to use org.activiti.engine.form.StartFormData. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProcessDefinitionController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 读取启动流程的表单字段
 */
@RequestMapping(value = "getform/start/{processDefinitionId}")
public ModelAndView readStartForm(@PathVariable("processDefinitionId") String processDefinitionId) throws Exception {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
    boolean hasStartFormKey = processDefinition.hasStartFormKey();

    // 根据是否有formkey属性判断使用哪个展示层
    String viewName = "chapter6/start-process-form";
    ModelAndView mav = new ModelAndView(viewName);

    // 判断是否有formkey属性
    if (hasStartFormKey) {
        Object renderedStartForm = formService.getRenderedStartForm(processDefinitionId);
        mav.addObject("startFormData", renderedStartForm);
        mav.addObject("processDefinition", processDefinition);
    } else { // 动态表单字段
        StartFormData startFormData = formService.getStartFormData(processDefinitionId);
        mav.addObject("startFormData", startFormData);
    }
    mav.addObject("hasStartFormKey", hasStartFormKey);
    mav.addObject("processDefinitionId", processDefinitionId);
    return mav;
}
 
Example #2
Source File: ProcessDefinitionController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 读取启动流程的表单字段
 */
@RequestMapping(value = "getform/start/{processDefinitionId}")
public ModelAndView readStartForm(@PathVariable("processDefinitionId") String processDefinitionId) throws Exception {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
    boolean hasStartFormKey = processDefinition.hasStartFormKey();

    // 根据是否有formkey属性判断使用哪个展示层
    String viewName = "chapter6/start-process-form";
    ModelAndView mav = new ModelAndView(viewName);

    // 判断是否有formkey属性
    if (hasStartFormKey) {
        Object renderedStartForm = formService.getRenderedStartForm(processDefinitionId);
        mav.addObject("startFormData", renderedStartForm);
        mav.addObject("processDefinition", processDefinition);
    } else { // 动态表单字段
        StartFormData startFormData = formService.getStartFormData(processDefinitionId);
        mav.addObject("startFormData", startFormData);
    }
    mav.addObject("hasStartFormKey", hasStartFormKey);
    mav.addObject("processDefinitionId", processDefinitionId);
    return mav;
}
 
Example #3
Source File: GetStartFormCmd.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
public StartFormData execute(CommandContext commandContext) {
  ProcessDefinition processDefinition = commandContext.getProcessEngineConfiguration().getDeploymentManager().findDeployedProcessDefinitionById(processDefinitionId);
  if (processDefinition == null) {
    throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId + "'", ProcessDefinition.class);
  }
  
  if (commandContext.getProcessEngineConfiguration().isActiviti5CompatibilityEnabled() && 
      Activiti5CompatibilityHandler.ACTIVITI_5_ENGINE_TAG.equals(processDefinition.getEngineVersion())) {
    
    return Activiti5Util.getActiviti5CompatibilityHandler().getStartFormData(processDefinitionId);
  }

  StartFormHandler startFormHandler = FormHandlerUtil.getStartFormHandler(commandContext, processDefinition);
  if (startFormHandler == null) {
    throw new ActivitiException("No startFormHandler defined in process '" + processDefinitionId + "'");
  }

  return startFormHandler.createStartFormData(processDefinition);
}
 
Example #4
Source File: ProcessDefinitionController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 读取启动流程的表单字段
 */
@RequestMapping(value = "getform/start/{processDefinitionId}")
public ModelAndView readStartForm(@PathVariable("processDefinitionId") String processDefinitionId) throws Exception {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
    boolean hasStartFormKey = processDefinition.hasStartFormKey();

    // 根据是否有formkey属性判断使用哪个展示层
    String viewName = "chapter6/start-process-form";
    ModelAndView mav = new ModelAndView(viewName);

    // 判断是否有formkey属性
    if (hasStartFormKey) {
        Object renderedStartForm = formService.getRenderedStartForm(processDefinitionId);
        mav.addObject("startFormData", renderedStartForm);
        mav.addObject("processDefinition", processDefinition);
    } else { // 动态表单字段
        StartFormData startFormData = formService.getStartFormData(processDefinitionId);
        mav.addObject("startFormData", startFormData);
    }
    mav.addObject("hasStartFormKey", hasStartFormKey);
    mav.addObject("processDefinitionId", processDefinitionId);
    return mav;
}
 
Example #5
Source File: GetRenderedStartFormCmd.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
public Object execute(CommandContext commandContext) {
  ProcessDefinition processDefinition = commandContext
    .getProcessEngineConfiguration()
    .getDeploymentManager()
    .findDeployedProcessDefinitionById(processDefinitionId);
  if (processDefinition == null) {
    throw new ActivitiObjectNotFoundException("Process Definition '" + processDefinitionId +"' not found", ProcessDefinition.class);
  }
  StartFormHandler startFormHandler = ((ProcessDefinitionEntity) processDefinition).getStartFormHandler();
  if (startFormHandler == null) {
    return null;
  }
  
  FormEngine formEngine = commandContext
    .getProcessEngineConfiguration()
    .getFormEngines()
    .get(formEngineName);
  
  if (formEngine==null) {
    throw new ActivitiException("No formEngine '" + formEngineName +"' defined process engine configuration");
  }
  
  StartFormData startForm = startFormHandler.createStartFormData(processDefinition);
  
  return formEngine.renderStartForm(startForm);
}
 
Example #6
Source File: GetStartFormCmd.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
public StartFormData execute(CommandContext commandContext) {
  ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) commandContext
    .getProcessEngineConfiguration()
    .getDeploymentManager()
    .findDeployedProcessDefinitionById(processDefinitionId);
  if (processDefinition == null) {
    throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId +"'", ProcessDefinition.class);
  }
  
  StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
  if (startFormHandler == null) {
    throw new ActivitiException("No startFormHandler defined in process '" + processDefinitionId +"'");
  }
  
  
  return startFormHandler.createStartFormData(processDefinition);
}
 
Example #7
Source File: ActivitiTypeConverter.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Convert a {@link ProcessDefinition} into a {@link WorkflowDefinition}.
 * @param definition ProcessDefinition
 * @return WorkflowDefinition
 */
public WorkflowDefinition convert(ProcessDefinition definition)
{
    if(definition==null)
        return null;
    
    String defId = definition.getId();
    String defName = definition.getKey();
    int version = definition.getVersion();
    String defaultTitle = definition.getName();
    
    String startTaskName = null;
    StartFormData startFormData = getStartFormData(defId, defName);
    if(startFormData != null) 
    {
        startTaskName = startFormData.getFormKey();
    }
    
    ReadOnlyProcessDefinition def = activitiUtil.getDeployedProcessDefinition(defId);
    PvmActivity startEvent = def.getInitial();
    WorkflowTaskDefinition startTask = getTaskDefinition(startEvent, startTaskName, definition.getKey(), true);
    
    return factory.createDefinition(defId,
                defName, version, defaultTitle,
                null, startTask);
}
 
Example #8
Source File: ProcessDefinitionController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 读取启动流程的表单字段
 */
@RequestMapping(value = "getform/start/{processDefinitionId}")
public ModelAndView readStartForm(@PathVariable("processDefinitionId") String processDefinitionId) throws Exception {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
    boolean hasStartFormKey = processDefinition.hasStartFormKey();

    // 根据是否有formkey属性判断使用哪个展示层
    String viewName = "chapter6/start-process-form";
    ModelAndView mav = new ModelAndView(viewName);

    // 判断是否有formkey属性
    if (hasStartFormKey) {
        Object renderedStartForm = formService.getRenderedStartForm(processDefinitionId);
        mav.addObject("startFormData", renderedStartForm);
        mav.addObject("processDefinition", processDefinition);
    } else { // 动态表单字段
        StartFormData startFormData = formService.getStartFormData(processDefinitionId);
        mav.addObject("startFormData", startFormData);
    }
    mav.addObject("hasStartFormKey", hasStartFormKey);
    mav.addObject("processDefinitionId", processDefinitionId);
    return mav;
}
 
Example #9
Source File: ProcessDefinitionController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 读取启动流程的表单字段
 */
@RequestMapping(value = "getform/start/{processDefinitionId}")
public ModelAndView readStartForm(@PathVariable("processDefinitionId") String processDefinitionId) throws Exception {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
    boolean hasStartFormKey = processDefinition.hasStartFormKey();

    // 根据是否有formkey属性判断使用哪个展示层
    String viewName = "chapter6/start-process-form";
    ModelAndView mav = new ModelAndView(viewName);

    // 判断是否有formkey属性
    if (hasStartFormKey) {
        Object renderedStartForm = formService.getRenderedStartForm(processDefinitionId);
        mav.addObject("startFormData", renderedStartForm);
        mav.addObject("processDefinition", processDefinition);
    } else { // 动态表单字段
        StartFormData startFormData = formService.getStartFormData(processDefinitionId);
        mav.addObject("startFormData", startFormData);
    }
    mav.addObject("hasStartFormKey", hasStartFormKey);
    mav.addObject("processDefinitionId", processDefinitionId);
    return mav;
}
 
Example #10
Source File: ProcessDefinitionController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 读取启动流程的表单字段
 */
@RequestMapping(value = "getform/start/{processDefinitionId}")
public ModelAndView readStartForm(@PathVariable("processDefinitionId") String processDefinitionId) throws Exception {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
    boolean hasStartFormKey = processDefinition.hasStartFormKey();

    // 根据是否有formkey属性判断使用哪个展示层
    String viewName = "chapter6/start-process-form";
    ModelAndView mav = new ModelAndView(viewName);

    // 判断是否有formkey属性
    if (hasStartFormKey) {
        Object renderedStartForm = formService.getRenderedStartForm(processDefinitionId);
        mav.addObject("startFormData", renderedStartForm);
        mav.addObject("processDefinition", processDefinition);
    } else { // 动态表单字段
        StartFormData startFormData = formService.getStartFormData(processDefinitionId);
        mav.addObject("startFormData", startFormData);
    }
    mav.addObject("hasStartFormKey", hasStartFormKey);
    mav.addObject("processDefinitionId", processDefinitionId);
    return mav;
}
 
Example #11
Source File: ProcessDefinitionController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 读取启动流程的表单字段
 */
@RequestMapping(value = "getform/start/{processDefinitionId}")
public ModelAndView readStartForm(@PathVariable("processDefinitionId") String processDefinitionId) throws Exception {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
    boolean hasStartFormKey = processDefinition.hasStartFormKey();

    // 根据是否有formkey属性判断使用哪个展示层
    String viewName = "chapter6/start-process-form";
    ModelAndView mav = new ModelAndView(viewName);

    // 判断是否有formkey属性
    if (hasStartFormKey) {
        Object renderedStartForm = formService.getRenderedStartForm(processDefinitionId);
        mav.addObject("startFormData", renderedStartForm);
        mav.addObject("processDefinition", processDefinition);
    } else { // 动态表单字段
        StartFormData startFormData = formService.getStartFormData(processDefinitionId);
        mav.addObject("startFormData", startFormData);
    }
    mav.addObject("hasStartFormKey", hasStartFormKey);
    mav.addObject("processDefinitionId", processDefinitionId);
    return mav;
}
 
Example #12
Source File: ProcessDefinitionsImpl.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 5 votes vote down vote up
@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);
}
 
Example #13
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #14
Source File: ProcessDefinitionsImpl.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected ProcessDefinition createProcessDefinitionRest(ProcessDefinitionEntity processDefinition)
{
    ProcessDefinition processDefinitionRest = new ProcessDefinition(processDefinition);
    String localKey = getLocalProcessDefinitionKey(processDefinition.getKey());
    processDefinitionRest.setKey(localKey);
    
    String displayId = localKey + ".workflow";
    processDefinitionRest.setTitle(getLabel(displayId, "title"));
    processDefinitionRest.setDescription(getLabel(displayId, "description"));
   
    processDefinitionRest.setGraphicNotationDefined(processDefinition.isGraphicalNotationDefined());
    if (processDefinition.hasStartFormKey()) 
    {
        try 
        {
            StartFormData startFormData = activitiProcessEngine.getFormService().getStartFormData(processDefinition.getId());
            if (startFormData != null) 
            {
                processDefinitionRest.setStartFormResourceKey(startFormData.getFormKey());
            }
        }
        catch (Exception e) 
        {
            throw new ApiException("Error while retrieving start form key");
        }
    }
    return processDefinitionRest;
}
 
Example #15
Source File: DefaultActiviti5CompatibilityHandler.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
public StartFormData getStartFormData(String processDefinitionId) {
  try {
    return getProcessEngine().getFormService().getStartFormData(processDefinitionId);
  } catch (org.activiti5.engine.ActivitiException e) {
    handleActivitiException(e);
    return null;
  }
}
 
Example #16
Source File: TasksImpl.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void addVariables(Task task, Boolean includeProcessVariables, Boolean includeTaskVariables, 
        Map<String, Object> processVariables, Map<String, Object> taskVariables, Map<String, TypeDefinition> definitionTypeMap)
{
    TypeDefinition startFormTypeDefinition = null;
    if (includeProcessVariables != null && includeProcessVariables) 
    {
        if (definitionTypeMap.containsKey(task.getProcessDefinitionId()) == false)
        {
            StartFormData startFormData = activitiProcessEngine.getFormService().getStartFormData(task.getProcessDefinitionId());
            if (startFormData != null)
            {
                String formKey = startFormData.getFormKey();
                definitionTypeMap.put(task.getProcessDefinitionId(), getWorkflowFactory().getTaskFullTypeDefinition(formKey, true));
            }
        }
        
        if (definitionTypeMap.containsKey(task.getProcessDefinitionId()))
        {
            startFormTypeDefinition = definitionTypeMap.get(task.getProcessDefinitionId());
        }
    }
    
    TypeDefinition taskTypeDefinition = null;
    if (includeTaskVariables != null && includeTaskVariables) 
    {
        taskTypeDefinition = getWorkflowFactory().getTaskFullTypeDefinition(task.getFormResourceKey(), false);
    }
    
    List<TaskVariable> variables = restVariableHelper.getTaskVariables(taskVariables, processVariables, 
            startFormTypeDefinition, taskTypeDefinition);
    task.setVariables(variables);
}
 
Example #17
Source File: GetRenderedStartFormCmd.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
public Object execute(CommandContext commandContext) {
  ProcessDefinition processDefinition = commandContext.getProcessEngineConfiguration().getDeploymentManager().findDeployedProcessDefinitionById(processDefinitionId);
  
  if (commandContext.getProcessEngineConfiguration().isActiviti5CompatibilityEnabled() && 
      Activiti5CompatibilityHandler.ACTIVITI_5_ENGINE_TAG.equals(processDefinition.getEngineVersion())) {
    
    return Activiti5Util.getActiviti5CompatibilityHandler().getRenderedStartForm(processDefinitionId, formEngineName); 
  }
  
  if (processDefinition == null) {
    throw new ActivitiObjectNotFoundException("Process Definition '" + processDefinitionId + "' not found", ProcessDefinition.class);
  }
  StartFormHandler startFormHandler = FormHandlerUtil.getStartFormHandler(commandContext, processDefinition); 
  if (startFormHandler == null) {
    return null;
  }

  FormEngine formEngine = commandContext.getProcessEngineConfiguration().getFormEngines().get(formEngineName);

  if (formEngine == null) {
    throw new ActivitiException("No formEngine '" + formEngineName + "' defined process engine configuration");
  }

  StartFormData startForm = startFormHandler.createStartFormData(processDefinition);

  return formEngine.renderStartForm(startForm);
}
 
Example #18
Source File: JuelFormEngine.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
public Object renderStartForm(StartFormData startForm) {
  if (startForm.getFormKey()==null) {
    return null;
  }
  String formTemplateString = getFormTemplateString(startForm, startForm.getFormKey());
  ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();
  return scriptingEngines.evaluate(formTemplateString, ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE, null);
}
 
Example #19
Source File: DefaultStartFormHandler.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
public StartFormData createStartFormData(ProcessDefinition processDefinition) {
  StartFormDataImpl startFormData = new StartFormDataImpl();
  if (formKey != null) {
    startFormData.setFormKey(formKey.getExpressionText());
  }
  startFormData.setDeploymentId(deploymentId);
  startFormData.setProcessDefinition(processDefinition);
  initializeFormProperties(startFormData, null);
  return startFormData;
}
 
Example #20
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #21
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #22
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #23
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #24
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #25
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #26
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #27
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #28
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #29
Source File: LeaveDynamicFormTest.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = "chapter6/dynamic-form/leave.bpmn")
public void testJavascriptFormType() throws Exception {

    // 验证是否部署成功
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(1, count);

    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
    StartFormData startFormData = formService.getStartFormData(processDefinition.getId());
    List<FormProperty> formProperties = startFormData.getFormProperties();
    for (FormProperty formProperty : formProperties) {
        System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());
    }
}
 
Example #30
Source File: WorkspaceController.java    From lemon with Apache License 2.0 5 votes vote down vote up
/**
 * 发起流程页面(启动一个流程实例)内置流程表单方式
 * 
 * @return
 */
@RequestMapping("workspace-prepareStartProcessInstance")
public String prepareStartProcessInstance(
        @RequestParam("processDefinitionId") String processDefinitionId,
        Model model) {
    FormService formService = processEngine.getFormService();
    StartFormData startFormData = formService
            .getStartFormData(processDefinitionId);
    model.addAttribute("startFormData", startFormData);

    return "bpm/workspace prepareStartProcessInstance";
}