本文整理汇总了Java中org.activiti.bpmn.model.UserTask类的典型用法代码示例。如果您正苦于以下问题:Java UserTask类的具体用法?Java UserTask怎么用?Java UserTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserTask类属于org.activiti.bpmn.model包,在下文中一共展示了UserTask类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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());
}
}
}
示例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);
}
}
示例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();
}
}
示例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() + " 条. ");
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
示例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());
}
示例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);
}
示例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);
}
}