form data java 示例_Java StartFormData類代碼示例

本文整理匯總了Java中org.activiti.engine.form.StartFormData類的典型用法代碼示例。如果您正苦於以下問題:Java StartFormData類的具體用法?Java StartFormData怎麽用?Java StartFormData使用的例子?那麽恭喜您, 這裏精選的類代碼示例或許可以為您提供幫助。

StartFormData類屬於org.activiti.engine.form包,在下文中一共展示了StartFormData類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。

示例1: convert

​點讚 3

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

/**

* 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);

}

開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:31,

示例2: readStartForm

​點讚 3

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

/**

* 讀取啟動流程的表單字段

*/

@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;

}

開發者ID:shawn-gogh,項目名稱:myjavacode,代碼行數:26,

示例3: buttonClick

​點讚 3

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

public void buttonClick(ClickEvent event) {

// Check if process-definition defines a start-form

StartFormData startFormData = formService.getStartFormData(processDefinition.getId());

if(startFormData != null && ((startFormData.getFormProperties() != null && startFormData.getFormProperties().size() > 0) || startFormData.getFormKey() != null)) {

parentPage.showStartForm(processDefinition, startFormData);

} else {

// Just start the process-instance since it has no form.

// TODO: Error handling

ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinition.getId());

// Show notification of success

notificationManager.showInformationNotification(Messages.PROCESS_STARTED_NOTIFICATION, getProcessDisplayName(processDefinition));

// Switch to inbox page in case a task of this process was created

List loggedInUsersTasks = taskService.createTaskQuery()

.taskAssignee(ExplorerApp.get().getLoggedInUser().getId())

.processInstanceId(processInstance.getId())

.list();

if (loggedInUsersTasks.size() > 0) {

ExplorerApp.get().getViewManager().showInboxPage(loggedInUsersTasks.get(0).getId());

}

}

}

開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:25,

示例4: execute

​點讚 3

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

public Object execute(CommandContext commandContext) {

ProcessDefinitionEntity processDefinition = Context

.getProcessEngineConfiguration()

.getDeploymentCache()

.findDeployedProcessDefinitionById(processDefinitionId);

if (processDefinition == null) {

throw new ActivitiException("Process Definition '" + processDefinitionId +"' not found");

}

StartFormHandler startFormHandler = processDefinition.getStartFormHandler();

if (startFormHandler == null) {

return null;

}

FormEngine formEngine = Context

.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);

}

開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:27,

示例5: execute

​點讚 3

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

public StartFormData execute(CommandContext commandContext) {

ProcessDefinitionEntity processDefinition = Context

.getProcessEngineConfiguration()

.getDeploymentCache()

.findDeployedProcessDefinitionById(processDefinitionId);

if (processDefinition == null) {

throw new ActivitiException("No process definition found for id '" + processDefinitionId +"'");

}

StartFormHandler startFormHandler = processDefinition.getStartFormHandler();

if (startFormHandler == null) {

throw new ActivitiException("No startFormHandler defined in process '" + processDefinitionId +"'");

}

return startFormHandler.createStartFormData(processDefinition);

}

開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:18,

示例6: processList

​點讚 3

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

@SuppressWarnings("rawtypes")

@Override

protected List processList(List list) {

List responseProcessDefinitions = new ArrayList();

for (Object definition : list) {

ProcessDefinitionResponse processDefinition = new ProcessDefinitionResponse((ProcessDefinitionEntity) definition);

StartFormData startFormData = ActivitiUtil.getFormService().getStartFormData(((ProcessDefinitionEntity) definition).getId());

if (startFormData != null) {

processDefinition.setStartFormResourceKey(startFormData.getFormKey());

}

processDefinition.setGraphicNotationDefined(isGraphicNotationDefined(((ProcessDefinitionEntity) definition).getId()));

responseProcessDefinitions.add(processDefinition);

}

return responseProcessDefinitions;

}

開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:17,

示例7: execute

​點讚 3

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

public Object execute(CommandContext commandContext) {

ProcessDefinitionEntity processDefinition = Context

.getProcessEngineConfiguration()

.getDeploymentManager()

.findDeployedProcessDefinitionById(processDefinitionId);

if (processDefinition == null) {

throw new ActivitiObjectNotFoundException("Process Definition '" + processDefinitionId +"' not found", ProcessDefinition.class);

}

StartFormHandler startFormHandler = processDefinition.getStartFormHandler();

if (startFormHandler == null) {

return null;

}

FormEngine formEngine = Context

.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);

}

開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:27,

示例8: execute

​點讚 3

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

public StartFormData execute(CommandContext commandContext) {

ProcessDefinitionEntity processDefinition = Context

.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);

}

開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:18,

示例9: getStartTaskTypeName

​點讚 2

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

public String getStartTaskTypeName(String processDefinitionId)

{

String startTaskName = null;

StartFormData startFormData = formService.getStartFormData(processDefinitionId);

if (startFormData != null)

{

startTaskName = startFormData.getFormKey();

}

return startTaskName;

}

開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:11,

示例10: getTaskDefinitions

​點讚 2

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

/**

* {@inheritDoc}

*/

public List getTaskDefinitions(String workflowDefinitionId)

{

List defs = new ArrayList();

String processDefinitionId = createLocalId(workflowDefinitionId);

// This should return all task definitions, including the start-task

ReadOnlyProcessDefinition processDefinition =((RepositoryServiceImpl)repoService).getDeployedProcessDefinition(processDefinitionId);

String processName = ((ProcessDefinition)processDefinition).getKey();

factory.checkDomain(processName);

// Process start task definition

PvmActivity startEvent = processDefinition.getInitial();

String startTaskName = null;

StartFormData startFormData = formService.getStartFormData(processDefinition.getId());

if(startFormData != null)

{

startTaskName = startFormData.getFormKey();

}

// Add start task definition

defs.add(typeConverter.getTaskDefinition(startEvent, startTaskName, processDefinition.getId(), true));

// Now, continue through process, finding all user-tasks

Collection taskActivities = typeConverter.findUserTasks(startEvent);

for(PvmActivity act : taskActivities)

{

String formKey = typeConverter.getFormKey(act, processDefinition);

defs.add(typeConverter.getTaskDefinition(act, formKey, processDefinition.getId(), false));

}

return defs;

}

開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:38,

示例11: prepareStartProcessInstance

​點讚 2

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

/**

* 發起流程頁麵(啟動一個流程實例)內置流程表單方式

*

* @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";

}

開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:17,

示例12: addVariables

​點讚 2

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

protected void addVariables(Task task, Boolean includeProcessVariables, Boolean includeTaskVariables,

Map processVariables, Map taskVariables, Map 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 variables = restVariableHelper.getTaskVariables(taskVariables, processVariables,

startFormTypeDefinition, taskTypeDefinition);

task.setVariables(variables);

}

開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:33,

示例13: createProcessDefinitionRest

​點讚 2

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

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;

}

開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:29,

示例14: startForm

​點讚 2

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

@RequestMapping(value = "/bpm/proc/form/start", method = RequestMethod.GET)

public ModelAndView startForm(String id) {

StartFormData formData = formService.getStartFormData(id);

List props = convertFormData(formData);

ModelAndView mv = view("views/bpm/start-form");

mv.addObject("model", formData);

mv.addObject("props", props);

return mv;

}

開發者ID:KayuraTeam,項目名稱:kayura-uasp,代碼行數:13,

示例15: testJavascriptFormType

​點讚 2

import org.activiti.engine.form.StartFormData; //導入依賴的package包/類

@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 formProperties = startFormData.getFormProperties();

for (FormProperty formProperty : formProperties) {

System.out.println(formProperty.getId() + ",value=" + formProperty.getValue());

}

}

開發者ID:shawn-gogh,項目名稱:myjavacode,代碼行數:16,

注:本文中的org.activiti.engine.form.StartFormData類示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值