本文整理汇总了Java中org.activiti.bpmn.model.UserTask类的典型用法代码示例。如果您正苦于以下问题:Java UserTask类的具体用法?Java UserTask怎么用?Java UserTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserTask类属于org.activiti.bpmn.model包,在下文中一共展示了UserTask类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: parse
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
public void parse(BpmnParse bpmnParse, BaseElement baseElement) {
if (!(baseElement instanceof UserTask)) {
return;
}
if (useDefaultUserTaskParser) {
new UserTaskParseHandler().parse(bpmnParse, baseElement);
}
UserTask userTask = (UserTask) baseElement;
logger.debug("bpmnParse : {}, userTask : {}", bpmnParse, userTask);
TaskDefinition taskDefinition = (TaskDefinition) bpmnParse
.getCurrentActivity().getProperty(
UserTaskParseHandler.PROPERTY_TASK_DEFINITION);
this.configEvent(taskDefinition, bpmnParse,
TaskListener.EVENTNAME_CREATE);
this.configEvent(taskDefinition, bpmnParse,
TaskListener.EVENTNAME_ASSIGNMENT);
this.configEvent(taskDefinition, bpmnParse,
TaskListener.EVENTNAME_COMPLETE);
this.configEvent(taskDefinition, bpmnParse,
TaskListener.EVENTNAME_DELETE);
}
开发者ID:zhaojunfei,项目名称:lemon,代码行数:26,代码来源:ProxyUserTaskBpmnParseHandler.java
示例2: executeParse
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
protected void executeParse(BpmnParse bpmnParse, UserTask userTask)
{
ActivityImpl activity = findActivity(bpmnParse, userTask.getId());
ActivityBehavior activitybehaviour = activity.getActivityBehavior();
if (activitybehaviour instanceof UserTaskActivityBehavior)
{
addListeners((UserTaskActivityBehavior) activity.getActivityBehavior());
}
else if(activitybehaviour instanceof MultiInstanceActivityBehavior)
{
MultiInstanceActivityBehavior multiInstance = (MultiInstanceActivityBehavior) activitybehaviour;
if(multiInstance.getInnerActivityBehavior() instanceof UserTaskActivityBehavior)
{
addListeners((UserTaskActivityBehavior) multiInstance.getInnerActivityBehavior());
}
}
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:18,代码来源:AlfrescoUserTaskBpmnParseHandler.java
示例3: processForm
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
/**
* 配置表单,userTask.
*/
public void processForm(UserTask userTask, BpmConfNode bpmConfNode) {
if (userTask.getFormKey() == null) {
return;
}
BpmConfFormManager bpmConfFormManager = getBpmConfFormManager();
BpmConfForm bpmConfForm = bpmConfFormManager.findUnique(
"from BpmConfForm where bpmConfNode=?", bpmConfNode);
if (bpmConfForm == null) {
bpmConfForm = new BpmConfForm();
bpmConfForm.setValue(userTask.getFormKey());
bpmConfForm.setType(0);
bpmConfForm.setOriginValue(userTask.getFormKey());
bpmConfForm.setOriginType(0);
bpmConfForm.setStatus(0);
bpmConfForm.setBpmConfNode(bpmConfNode);
bpmConfFormManager.save(bpmConfForm);
}
}
开发者ID:zhaojunfei,项目名称:lemon,代码行数:24,代码来源:SyncProcessCmd.java
示例4: parse
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
@Override
public void parse(BpmnParse bpmnParse, BaseElement element) {
if (element instanceof Process) {
ProcessDefinitionEntity processDefinition = bpmnParse.getCurrentProcessDefinition();
String key = processDefinition.getKey();
processDefinition.setKey(key + "-modified-by-post-parse-handler");
} else if (element instanceof UserTask) {
UserTask userTask = (UserTask) element;
List<SequenceFlow> outgoingFlows = userTask.getOutgoingFlows();
System.out.println("UserTask:[" + userTask.getName() + "]的输出流:");
for (SequenceFlow outgoingFlow : outgoingFlows) {
System.out.println("\t" + outgoingFlow.getTargetRef());
}
System.out.println();
}
}
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:17,代码来源:MyPostParseHandler.java
示例5: executeParse
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, UserTask userTask) {
super.executeParse(bpmnParse, userTask);
ActivityImpl activity = bpmnParse.getCurrentScope().findActivity(userTask.getId());
List<ExtendPropertyHandler> extendProperties = ExtendPropertyUtils.parseExtendProperties(bpmnParse, userTask);
activity.setProperty(ExtendPropertyUtils.PROPERTY_EXTEND_PROPERTIES, extendProperties);
logger.debug("★ 解析 Activity: " + userTask.getId() + ", 从定义文件中读取 ExtendProperties , 读取到了 " + extendProperties.size() + " 条. ");
}
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:12,代码来源:UserTaskParseExHandler.java
示例6: executeParse
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
protected void executeParse(BpmnParse bpmnParse, UserTask userTask) {
super.executeParse(bpmnParse, userTask);
ActivityImpl activity = findActivity(bpmnParse, userTask.getId());
activity.setAsync(true);
}
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:7,代码来源:CustomUserTaskBpmnParseHandler.java
示例7: executeParse
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
protected void executeParse(BpmnParse bpmnParse, UserTask userTask) {
super.executeParse(bpmnParse, userTask);
// 实验后不能添加
ActivitiListener listener = new ActivitiListener();
listener.setEvent("create");
listener.setImplementationType("class");
listener.setImplementation("me.kafeitu.activiti.chapter21.listeners.TaskAutoRedirectListener");
userTask.getTaskListeners().add(listener);
}
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:11,代码来源:TaskAutoRedirectParseHandler.java
示例8: getHandledTypes
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
@Override
public Collection<Class<? extends BaseElement>> getHandledTypes() {
Set<Class< ? extends BaseElement>> types = new HashSet<Class<? extends BaseElement>>();
types.add(Process.class);
types.add(UserTask.class);
return types;
}
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:8,代码来源:MyPostParseHandler.java
示例9: createUserTask
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
protected UserTask createUserTask(String id, String name, String assignee) {
UserTask userTask = new UserTask();
userTask.setName(name);
userTask.setId(id);
userTask.setAssignee(assignee);
return userTask;
}
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:8,代码来源:DynamicProcess.java
示例10: createUserTask
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
protected UserTask createUserTask(String id, String name, String assignee) {
UserTask userTask = new UserTask();
userTask.setName(name);
userTask.setId(id);
userTask.setAssignee(assignee);
return userTask;
}
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:8,代码来源:ProcessBuilderTest.java
示例11: getHandledTypes
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
/**
* Decides which elements to intercept while parsing.
*/
@Override
public Collection<Class<? extends BaseElement>> getHandledTypes() {
List<Class<? extends BaseElement>> elements = new ArrayList<>();
elements.add(UserTask.class);
return elements;
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:11,代码来源:UserTaskParseHandler.java
示例12: executeParse
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
protected void executeParse(BpmnParse bpmnParse, UserTask userTask) {
ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, userTask, BpmnXMLConstants.ELEMENT_TASK_USER);
activity.setAsync(userTask.isAsynchronous());
activity.setExclusive(!userTask.isNotExclusive());
TaskDefinition taskDefinition = parseTaskDefinition(bpmnParse, userTask, userTask.getId(), (ProcessDefinitionEntity) bpmnParse.getCurrentScope().getProcessDefinition());
activity.setProperty(PROPERTY_TASK_DEFINITION, taskDefinition);
activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createUserTaskActivityBehavior(userTask, taskDefinition));
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:11,代码来源:UserTaskParseHandler.java
示例13: testStartEventWithExecutionListener
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
public void testStartEventWithExecutionListener() throws Exception {
BpmnModel bpmnModel = new BpmnModel();
Process process = new Process();
process.setId("simpleProcess");
process.setName("Very simple process");
bpmnModel.getProcesses().add(process);
StartEvent startEvent = new StartEvent();
startEvent.setId("startEvent1");
TimerEventDefinition timerDef = new TimerEventDefinition();
timerDef.setTimeDuration("PT5M");
startEvent.getEventDefinitions().add(timerDef);
ActivitiListener listener = new ActivitiListener();
listener.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION);
listener.setImplementation("${test}");
listener.setEvent("end");
startEvent.getExecutionListeners().add(listener);
process.addFlowElement(startEvent);
UserTask task = new UserTask();
task.setId("reviewTask");
task.setAssignee("kermit");
process.addFlowElement(task);
SequenceFlow flow1 = new SequenceFlow();
flow1.setId("flow1");
flow1.setSourceRef("startEvent1");
flow1.setTargetRef("reviewTask");
process.addFlowElement(flow1);
EndEvent endEvent = new EndEvent();
endEvent.setId("endEvent1");
process.addFlowElement(endEvent);
byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel);
new BpmnXMLConverter().validateModel(new InputStreamSource(new ByteArrayInputStream(xml)));
Deployment deployment = repositoryService.createDeployment().name("test").addString("test.bpmn20.xml", new String(xml)).deploy();
repositoryService.deleteDeployment(deployment.getId());
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:38,代码来源:EventJavaTest.java
示例14: executeParse
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
protected void executeParse(BpmnParse bpmnParse, UserTask userTask) {
// Do the regular stuff
super.executeParse(bpmnParse, userTask);
// Make user tasks always async
ActivityImpl activity = findActivity(bpmnParse, userTask.getId());
activity.setAsync(true);
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:10,代码来源:CustomUserTaskBpmnParseHandler.java
示例15: writeAdditionalAttributes
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
@Override
protected void writeAdditionalAttributes(BaseElement element, XMLStreamWriter xtw) throws Exception {
UserTask userTask = (UserTask) element;
writeQualifiedAttribute(ATTRIBUTE_TASK_USER_ASSIGNEE, userTask.getAssignee(), xtw);
writeQualifiedAttribute(ATTRIBUTE_TASK_USER_OWNER, userTask.getOwner(), xtw);
writeQualifiedAttribute(ATTRIBUTE_TASK_USER_CANDIDATEUSERS, convertToDelimitedString(userTask.getCandidateUsers()), xtw);
writeQualifiedAttribute(ATTRIBUTE_TASK_USER_CANDIDATEGROUPS, convertToDelimitedString(userTask.getCandidateGroups()), xtw);
writeQualifiedAttribute(ATTRIBUTE_TASK_USER_DUEDATE, userTask.getDueDate(), xtw);
writeQualifiedAttribute(ATTRIBUTE_FORM_FORMKEY, userTask.getFormKey(), xtw);
if (userTask.getPriority() != null) {
writeQualifiedAttribute(ATTRIBUTE_TASK_USER_PRIORITY, userTask.getPriority().toString(), xtw);
}
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:14,代码来源:UserTaskXMLConverter.java
示例16: parseChildElement
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
UserTask userTask = (UserTask) parentElement;
if (StringUtils.isNotEmpty(userTask.getAssignee())) {
model.addProblem("No duplicate assignee and humanPerformer definition allowed", xtr);
}
String resourceElement = XMLStreamReaderUtil.moveDown(xtr);
if (StringUtils.isNotEmpty(resourceElement) && "resourceAssignmentExpression".equals(resourceElement)) {
String expression = XMLStreamReaderUtil.moveDown(xtr);
if (StringUtils.isNotEmpty(expression) && "formalExpression".equals(expression)) {
((UserTask) parentElement).setAssignee(xtr.getElementText());
}
}
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:14,代码来源:UserTaskXMLConverter.java
示例17: writeListeners
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
public static boolean writeListeners(BaseElement element, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {
if(element instanceof HasExecutionListeners) {
didWriteExtensionStartElement = writeListeners(ELEMENT_EXECUTION_LISTENER, ((HasExecutionListeners) element).getExecutionListeners(), didWriteExtensionStartElement, xtw);
}
// In case of a usertaks, also add task-listeners
if(element instanceof UserTask) {
didWriteExtensionStartElement = writeListeners(ELEMENT_TASK_LISTENER, ((UserTask) element).getTaskListeners(), didWriteExtensionStartElement, xtw);
}
return didWriteExtensionStartElement;
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:11,代码来源:ActivitiListenerExport.java
示例18: parseChildElement
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
super.parseChildElement(xtr, parentElement, model);
if (parentElement instanceof UserTask) {
((UserTask) parentElement).getTaskListeners().add(listener);
}
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:9,代码来源:TaskListenerParser.java
示例19: validateModel
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
private void validateModel(BpmnModel model) {
FlowElement flowElement = model.getMainProcess().getFlowElement("task");
assertNotNull(flowElement);
assertTrue(flowElement instanceof UserTask);
assertEquals("task", flowElement.getId());
List<Problem> problems = model.getProblems();
assertNotNull(problems);
assertEquals(1, problems.size());
System.out.println(problems.get(0));
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:12,代码来源:InCompleteSignalConverterTest.java
示例20: validateModel
import org.activiti.bpmn.model.UserTask; //导入依赖的package包/类
private void validateModel(BpmnModel model) {
FlowElement flowElement = model.getMainProcess().getFlowElement("outerSubProcess");
assertNotNull(flowElement);
assertTrue(flowElement instanceof SubProcess);
assertEquals("outerSubProcess", flowElement.getId());
SubProcess outerSubProcess = (SubProcess) flowElement;
List<BoundaryEvent> eventList = outerSubProcess.getBoundaryEvents();
assertEquals(1, eventList.size());
BoundaryEvent boundaryEvent = eventList.get(0);
assertEquals("outerBoundaryEvent", boundaryEvent.getId());
FlowElement subElement = outerSubProcess.getFlowElement("innerSubProcess");
assertNotNull(subElement);
assertTrue(subElement instanceof SubProcess);
assertEquals("innerSubProcess", subElement.getId());
SubProcess innerSubProcess = (SubProcess) subElement;
eventList = innerSubProcess.getBoundaryEvents();
assertEquals(1, eventList.size());
boundaryEvent = eventList.get(0);
assertEquals("innerBoundaryEvent", boundaryEvent.getId());
FlowElement taskElement = innerSubProcess.getFlowElement("usertask");
assertNotNull(taskElement);
assertTrue(taskElement instanceof UserTask);
UserTask userTask = (UserTask) taskElement;
assertEquals("usertask", userTask.getId());
eventList = userTask.getBoundaryEvents();
assertEquals(1, eventList.size());
boundaryEvent = eventList.get(0);
assertEquals("taskBoundaryEvent", boundaryEvent.getId());
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:32,代码来源:ScopedConverterTest.java
注:本文中的org.activiti.bpmn.model.UserTask类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论