本文整理汇总了Java中org.activiti.engine.impl.pvm.process.ActivityImpl.getActivityBehavior方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityImpl.getActivityBehavior方法的具体用法?Java ActivityImpl.getActivityBehavior怎么用?Java ActivityImpl.getActivityBehavior使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.pvm.process.ActivityImpl
的用法示例。
在下文中一共展示了ActivityImpl.getActivityBehavior方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFormKey
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
private String getFormKey(PvmActivity act)
{
if(act instanceof ActivityImpl)
{
ActivityImpl actImpl = (ActivityImpl) act;
if (actImpl.getActivityBehavior() instanceof UserTaskActivityBehavior)
{
UserTaskActivityBehavior uta = (UserTaskActivityBehavior) actImpl.getActivityBehavior();
TaskFormHandler handler = uta.getTaskDefinition().getTaskFormHandler();
if(handler != null && handler instanceof DefaultTaskFormHandler)
{
// We cast to DefaultTaskFormHandler since we do not configure our own
return ((DefaultTaskFormHandler)handler).getFormKey().getExpressionText();
}
}
}
return null;
}
示例2: getFormKey
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
public String getFormKey(PvmActivity act, ReadOnlyProcessDefinition processDefinition)
{
if(act instanceof ActivityImpl)
{
ActivityImpl actImpl = (ActivityImpl) act;
if (actImpl.getActivityBehavior() instanceof UserTaskActivityBehavior)
{
UserTaskActivityBehavior uta = (UserTaskActivityBehavior) actImpl.getActivityBehavior();
return getFormKey(uta.getTaskDefinition());
}
else if(actImpl.getActivityBehavior() instanceof MultiInstanceActivityBehavior)
{
// Get the task-definition from the process-definition
if(processDefinition instanceof ProcessDefinitionEntity)
{
// Task definition id is the same the the activity id
TaskDefinition taskDef = ((ProcessDefinitionEntity) processDefinition).getTaskDefinitions().get(act.getId());
if(taskDef != null)
{
return getFormKey(taskDef);
}
}
}
}
return null;
}
示例3: executeParse
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的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());
}
}
}
示例4: executeParse
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
protected void executeParse(BpmnParse bpmnParse, CallActivity callActivity)
{
if (multiTenancyEnabled && tenantService.isEnabled())
{
ActivityImpl activity = findActivity(bpmnParse, callActivity.getId());
ActivityBehavior activityBehavior = activity.getActivityBehavior();
if(activityBehavior instanceof CallActivityBehavior)
{
CallActivityBehavior callActivityBehavior = (CallActivityBehavior) activityBehavior;
// Make name of process-definition to be called aware of the current tenant
callActivityBehavior.setProcessDefinitonKey(tenantService.getName(callActivityBehavior.getProcessDefinitonKey()));
}
}
}
示例5: packageSingleActivitiInfo
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
/**
* 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述
* @param activity
* @param processInstance
* @param currentActiviti
* @return
*/
private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, ProcessInstance processInstance,
boolean currentActiviti) throws Exception {
Map<String, Object> vars = new HashMap<String, Object>();
Map<String, Object> activityInfo = new HashMap<String, Object>();
activityInfo.put("currentActiviti", currentActiviti);
setPosition(activity, activityInfo);
setWidthAndHeight(activity, activityInfo);
Map<String, Object> properties = activity.getProperties();
vars.put("节点名称", properties.get("name"));
vars.put("任务类型", ActUtils.parseToZhType(properties.get("type").toString()));
ActivityBehavior activityBehavior = activity.getActivityBehavior();
logger.debug("activityBehavior={}", activityBehavior);
if (activityBehavior instanceof UserTaskActivityBehavior) {
Task currentTask = null;
// 当前节点的task
if (currentActiviti) {
currentTask = getCurrentTaskInfo(processInstance);
}
// 当前任务的分配角色
UserTaskActivityBehavior userTaskActivityBehavior = (UserTaskActivityBehavior) activityBehavior;
TaskDefinition taskDefinition = userTaskActivityBehavior.getTaskDefinition();
Set<Expression> candidateGroupIdExpressions = taskDefinition.getCandidateGroupIdExpressions();
if (!candidateGroupIdExpressions.isEmpty()) {
// 任务的处理角色
setTaskGroup(vars, candidateGroupIdExpressions);
// 当前处理人
if (currentTask != null) {
setCurrentTaskAssignee(vars, currentTask);
}
}
}
vars.put("节点说明", properties.get("documentation"));
String description = activity.getProcessDefinition().getDescription();
vars.put("描述", description);
logger.debug("trace variables: {}", vars);
activityInfo.put("vars", vars);
return activityInfo;
}
示例6: dispatchExecutionCancelled
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
protected void dispatchExecutionCancelled(EventSubscriptionEntity eventSubscription, ExecutionEntity execution, CommandContext commandContext) {
// subprocesses
for (ExecutionEntity subExecution : execution.getExecutions()) {
dispatchExecutionCancelled(eventSubscription, subExecution, commandContext);
}
// call activities
ExecutionEntity subProcessInstance = commandContext.getExecutionEntityManager().findSubProcessInstanceBySuperExecutionId(execution.getId());
if (subProcessInstance != null) {
dispatchExecutionCancelled(eventSubscription, subProcessInstance, commandContext);
}
// activity with message/signal boundary events
ActivityImpl activity = execution.getActivity();
if (activity != null && activity.getActivityBehavior() != null) {
dispatchActivityCancelled(eventSubscription, execution, activity, commandContext);
}
}
示例7: dispatchExecutionTimeOut
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
protected void dispatchExecutionTimeOut(Job job, ExecutionEntity execution, CommandContext commandContext) {
// subprocesses
for (ExecutionEntity subExecution : execution.getExecutions()) {
dispatchExecutionTimeOut(job, subExecution, commandContext);
}
// call activities
ExecutionEntity subProcessInstance = commandContext.getExecutionEntityManager().findSubProcessInstanceBySuperExecutionId(execution.getId());
if (subProcessInstance != null) {
dispatchExecutionTimeOut(job, subProcessInstance, commandContext);
}
// activity with timer boundary event
ActivityImpl activity = execution.getActivity();
if (activity != null && activity.getActivityBehavior() != null) {
dispatchActivityTimeOut(job, activity, execution, commandContext);
}
}
示例8: executeEventHandler
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
private static void executeEventHandler(ActivityImpl borderEventActivity, ActivityExecution leavingExecution, String errorCode) {
if (Context.getProcessEngineConfiguration() != null && Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
ActivitiEventBuilder.createErrorEvent(FlowableEngineEventType.ACTIVITY_ERROR_RECEIVED, borderEventActivity.getId(), errorCode, leavingExecution.getId(), leavingExecution.getProcessInstanceId(),
leavingExecution.getProcessDefinitionId()));
}
// The current activity of the execution will be changed in the next lines.
// So we must make sure the activity is ended correctly here
// The other executions (for example when doing something parallel in a subprocess, will
// be destroyed by the destroy scope operation (but this execution will be used to do it and
// will have list the original activity by then)
Context.getCommandContext().getHistoryManager().recordActivityEnd((ExecutionEntity) leavingExecution);
if (borderEventActivity.getActivityBehavior() instanceof EventSubProcessStartEventActivityBehavior) {
InterpretableExecution execution = (InterpretableExecution) leavingExecution;
execution.setActivity(borderEventActivity.getParentActivity());
execution.performOperation(AtomicOperation.ACTIVITY_START); // make sure the listeners are invoked!
} else {
leavingExecution.executeActivity(borderEventActivity);
}
}
示例9: execute
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) {
ActivityExecution activityExecution = (ActivityExecution) execution;
PvmActivity activity = activityExecution.getActivity();
ActivityImpl initialActivity = (ActivityImpl) activity.getProperty(BpmnParse.PROPERTYNAME_INITIAL);
if (initialActivity == null) {
throw new ActivitiException("No initial activity found for subprocess "
+ activityExecution.getActivity().getId());
}
// initialize the template-defined data objects as variables
initializeDataObjects(activityExecution, activity);
if (initialActivity.getActivityBehavior() != null
&& initialActivity.getActivityBehavior() instanceof NoneStartEventActivityBehavior) { // embedded subprocess: only none start allowed
((ExecutionEntity) execution).setActivity(initialActivity);
Context.getCommandContext().getHistoryManager().recordActivityStart((ExecutionEntity) execution);
}
activityExecution.executeActivity(initialActivity);
}
示例10: dispatchExecutionCancelled
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
private void dispatchExecutionCancelled(ActivityExecution execution, ActivityImpl causeActivity) {
// subprocesses
for (ActivityExecution subExecution : execution.getExecutions()) {
dispatchExecutionCancelled(subExecution, causeActivity);
}
// call activities
ExecutionEntity subProcessInstance = Context.getCommandContext().getExecutionEntityManager().findSubProcessInstanceBySuperExecutionId(execution.getId());
if (subProcessInstance != null) {
dispatchExecutionCancelled(subProcessInstance, causeActivity);
}
// activity with message/signal boundary events
ActivityImpl activity = (ActivityImpl) execution.getActivity();
if (activity != null && activity.getActivityBehavior() != null && activity != causeActivity) {
dispatchActivityCancelled(execution, activity, causeActivity);
}
}
示例11: isReceiveTask
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
private boolean isReceiveTask(PvmActivity act)
{
if(act instanceof ActivityImpl)
{
ActivityImpl actImpl = (ActivityImpl) act;
return (actImpl.getActivityBehavior() instanceof ReceiveTaskActivityBehavior);
}
return false;
}
示例12: packageSingleActivitiInfo
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
/**
* 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述
*
* @param activity
* @param processInstance
* @param currentActiviti
* @return
*/
private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, ProcessInstance processInstance,
boolean currentActiviti) throws Exception {
Map<String, Object> vars = new HashMap<String, Object>();
Map<String, Object> activityInfo = new HashMap<String, Object>();
activityInfo.put("currentActiviti", currentActiviti);
setPosition(activity, activityInfo);
setWidthAndHeight(activity, activityInfo);
Map<String, Object> properties = activity.getProperties();
vars.put("任务类型", WorkflowUtils.parseToZhType(properties.get("type").toString()));
ActivityBehavior activityBehavior = activity.getActivityBehavior();
logger.debug("activityBehavior={}", activityBehavior);
if (activityBehavior instanceof UserTaskActivityBehavior) {
Task currentTask = null;
/*
* 当前节点的task
*/
if (currentActiviti) {
currentTask = getCurrentTaskInfo(processInstance);
}
/*
* 当前任务的分配角色
*/
UserTaskActivityBehavior userTaskActivityBehavior = (UserTaskActivityBehavior) activityBehavior;
TaskDefinition taskDefinition = userTaskActivityBehavior.getTaskDefinition();
Set<Expression> candidateGroupIdExpressions = taskDefinition.getCandidateGroupIdExpressions();
if (!candidateGroupIdExpressions.isEmpty()) {
// 任务的处理角色
setTaskGroup(vars, candidateGroupIdExpressions);
// 当前处理人
if (currentTask != null) {
setCurrentTaskAssignee(vars, currentTask);
}
}
}
vars.put("节点说明", properties.get("documentation"));
String description = activity.getProcessDefinition().getDescription();
vars.put("描述", description);
logger.debug("trace variables: {}", vars);
activityInfo.put("vars", vars);
return activityInfo;
}
示例13: execute
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
public void execute(InterpretableExecution execution) {
ActivityImpl activity = (ActivityImpl) execution.getActivity();
ActivityBehavior activityBehavior = activity.getActivityBehavior();
if (activityBehavior == null) {
throw new PvmException("no behavior specified in " + activity);
}
LOGGER.debug("{} executes {}: {}", execution, activity, activityBehavior.getClass().getName());
try {
if (Context.getProcessEngineConfiguration() != null && Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
ActivitiEventBuilder.createActivityEvent(FlowableEngineEventType.ACTIVITY_STARTED,
execution.getActivity().getId(),
(String) execution.getActivity().getProperty("name"),
execution.getId(),
execution.getProcessInstanceId(),
execution.getProcessDefinitionId(),
(String) activity.getProperties().get("type"),
activity.getActivityBehavior().getClass().getCanonicalName()));
}
activityBehavior.execute(execution);
} catch (ActivitiException e) {
throw e;
} catch (Throwable t) {
LogMDC.putMDCExecution(execution);
throw new ActivitiActivityExecutionException("couldn't execute activity <" + activity.getProperty("type") + " id=\"" + activity.getId() + "\" ...>: " + t.getMessage(), t);
}
}
示例14: dispatchActivitiesCanceledIfNeeded
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
protected void dispatchActivitiesCanceledIfNeeded(EventSubscriptionEntity eventSubscription, ExecutionEntity execution, ActivityImpl boundaryEventActivity, CommandContext commandContext) {
ActivityBehavior boundaryActivityBehavior = boundaryEventActivity.getActivityBehavior();
if (boundaryActivityBehavior instanceof BoundaryEventActivityBehavior) {
BoundaryEventActivityBehavior boundaryEventActivityBehavior = (BoundaryEventActivityBehavior) boundaryActivityBehavior;
if (boundaryEventActivityBehavior.isInterrupting()) {
dispatchExecutionCancelled(eventSubscription, execution, commandContext);
}
}
}
示例15: dispatchActivityTimeoutIfNeeded
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
protected void dispatchActivityTimeoutIfNeeded(Job timerEntity, ExecutionEntity execution, CommandContext commandContext) {
String nestedActivityId = TimerEventHandler.getActivityIdFromConfiguration(timerEntity.getJobHandlerConfiguration());
ActivityImpl boundaryEventActivity = execution.getProcessDefinition().findActivity(nestedActivityId);
ActivityBehavior boundaryActivityBehavior = boundaryEventActivity.getActivityBehavior();
if (boundaryActivityBehavior instanceof BoundaryEventActivityBehavior) {
BoundaryEventActivityBehavior boundaryEventActivityBehavior = (BoundaryEventActivityBehavior) boundaryActivityBehavior;
if (boundaryEventActivityBehavior.isInterrupting()) {
dispatchExecutionTimeOut(timerEntity, execution, commandContext);
}
}
}