本文整理汇总了Java中org.activiti.engine.impl.pvm.process.ActivityImpl.setProperty方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityImpl.setProperty方法的具体用法?Java ActivityImpl.setProperty怎么用?Java ActivityImpl.setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.pvm.process.ActivityImpl
的用法示例。
在下文中一共展示了ActivityImpl.setProperty方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createActivityOnScope
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
public ActivityImpl createActivityOnScope(BpmnParse bpmnParse, FlowElement flowElement, String xmlLocalName, ScopeImpl scopeElement) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Parsing activity {}", flowElement.getId());
}
ActivityImpl activity = scopeElement.createActivity(flowElement.getId());
bpmnParse.setCurrentActivity(activity);
activity.setProperty("name", flowElement.getName());
activity.setProperty("documentation", flowElement.getDocumentation());
if (flowElement instanceof Activity) {
Activity modelActivity = (Activity) flowElement;
activity.setProperty("default", modelActivity.getDefaultFlow());
if (modelActivity.isForCompensation()) {
activity.setProperty(PROPERTYNAME_IS_FOR_COMPENSATION, true);
}
} else if (flowElement instanceof Gateway) {
activity.setProperty("default", ((Gateway) flowElement).getDefaultFlow());
}
activity.setProperty("type", xmlLocalName);
return activity;
}
示例2: executeParse
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, StartEvent startEvent) {
super.executeParse(bpmnParse, startEvent);
ActivityImpl activity = bpmnParse.getCurrentScope().findActivity(startEvent.getId());
List<ExtendPropertyHandler> extendProperties = ExtendPropertyUtils.parseExtendProperties(bpmnParse, startEvent);
activity.setProperty(ExtendPropertyUtils.PROPERTY_EXTEND_PROPERTIES, extendProperties);
logger.debug("★ 解析 Activity: " + startEvent.getId() + ", 从定义文件中读取 ExtendProperties , 读取到了 " + extendProperties.size() + " 条. ");
}
示例3: executeParse
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的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() + " 条. ");
}
示例4: createAssociation
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
protected void createAssociation(BpmnParse bpmnParse, Association association, ScopeImpl parentScope) {
BpmnModel bpmnModel = bpmnParse.getBpmnModel();
if (bpmnModel.getArtifact(association.getSourceRef()) != null ||
bpmnModel.getArtifact(association.getTargetRef()) != null) {
// connected to a text annotation so skipping it
return;
}
ActivityImpl sourceActivity = parentScope.findActivity(association.getSourceRef());
ActivityImpl targetActivity = parentScope.findActivity(association.getTargetRef());
// an association may reference elements that are not parsed as activities (like for instance
// text annotations so do not throw an exception if sourceActivity or targetActivity are null)
// However, we make sure they reference 'something':
if (sourceActivity == null) {
// bpmnModel.addProblem("Invalid reference sourceRef '" + association.getSourceRef() + "' of association element ", association.getId());
} else if (targetActivity == null) {
// bpmnModel.addProblem("Invalid reference targetRef '" + association.getTargetRef() + "' of association element ", association.getId());
} else {
if (sourceActivity.getProperty("type").equals("compensationBoundaryCatch")) {
Object isForCompensation = targetActivity.getProperty(PROPERTYNAME_IS_FOR_COMPENSATION);
if (isForCompensation == null || !(Boolean) isForCompensation) {
LOGGER.warn("compensation boundary catch must be connected to element with isForCompensation=true");
} else {
ActivityImpl compensatedActivity = sourceActivity.getParentActivity();
compensatedActivity.setProperty(BpmnParse.PROPERTYNAME_COMPENSATION_HANDLER_ID, targetActivity.getId());
}
}
}
}
示例5: executeParse
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, SubProcess subProcess) {
ActivityImpl activity = createActivityOnScope(bpmnParse, subProcess, BpmnXMLConstants.ELEMENT_SUBPROCESS, bpmnParse.getCurrentScope());
activity.setAsync(subProcess.isAsynchronous());
activity.setExclusive(!subProcess.isNotExclusive());
boolean triggeredByEvent = false;
if (subProcess instanceof EventSubProcess) {
triggeredByEvent = true;
}
activity.setProperty("triggeredByEvent", triggeredByEvent);
// event subprocesses are not scopes
activity.setScope(!triggeredByEvent);
activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createSubprocActivityBehavior(subProcess));
bpmnParse.setCurrentScope(activity);
bpmnParse.setCurrentSubProcess(subProcess);
bpmnParse.processFlowElements(subProcess.getFlowElements());
processArtifacts(bpmnParse, subProcess.getArtifacts(), activity);
// no data objects for event subprocesses
if (!(subProcess instanceof EventSubProcess)) {
// parse out any data objects from the template in order to set up the necessary process variables
Map<String, Object> variables = processDataObjects(bpmnParse, subProcess.getDataObjects(), activity);
activity.setVariables(variables);
}
bpmnParse.removeCurrentScope();
bpmnParse.removeCurrentSubProcess();
if (subProcess.getIoSpecification() != null) {
IOSpecification ioSpecification = createIOSpecification(bpmnParse, subProcess.getIoSpecification());
activity.setIoSpecification(ioSpecification);
}
}
示例6: executeParse
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, CancelEventDefinition cancelEventDefinition) {
if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
ActivityImpl activity = bpmnParse.getCurrentActivity();
activity.setProperty("type", "cancelBoundaryCatch");
activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCancelBoundaryEventActivityBehavior(cancelEventDefinition));
}
}
示例7: executeParse
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
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));
}
示例8: createMultiInstanceLoopCharacteristics
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
protected void createMultiInstanceLoopCharacteristics(BpmnParse bpmnParse, Activity modelActivity) {
MultiInstanceLoopCharacteristics loopCharacteristics = modelActivity.getLoopCharacteristics();
// Activity Behavior
MultiInstanceActivityBehavior miActivityBehavior = null;
ActivityImpl activity = bpmnParse.getCurrentScope().findActivity(modelActivity.getId());
if (activity == null) {
throw new ActivitiException("Activity " + modelActivity.getId() + " needed for multi instance cannot bv found");
}
if (loopCharacteristics.isSequential()) {
miActivityBehavior = bpmnParse.getActivityBehaviorFactory().createSequentialMultiInstanceBehavior(
activity, (AbstractBpmnActivityBehavior) activity.getActivityBehavior());
} else {
miActivityBehavior = bpmnParse.getActivityBehaviorFactory().createParallelMultiInstanceBehavior(
activity, (AbstractBpmnActivityBehavior) activity.getActivityBehavior());
}
// ActivityImpl settings
activity.setScope(true);
activity.setProperty("multiInstance", loopCharacteristics.isSequential() ? "sequential" : "parallel");
activity.setActivityBehavior(miActivityBehavior);
ExpressionManager expressionManager = bpmnParse.getExpressionManager();
// loop cardinality
if (StringUtils.isNotEmpty(loopCharacteristics.getLoopCardinality())) {
miActivityBehavior.setLoopCardinalityExpression(expressionManager.createExpression(loopCharacteristics.getLoopCardinality()));
}
// completion condition
if (StringUtils.isNotEmpty(loopCharacteristics.getCompletionCondition())) {
miActivityBehavior.setCompletionConditionExpression(expressionManager.createExpression(loopCharacteristics.getCompletionCondition()));
}
// activiti:collection
if (StringUtils.isNotEmpty(loopCharacteristics.getInputDataItem())) {
if (loopCharacteristics.getInputDataItem().contains("{")) {
miActivityBehavior.setCollectionExpression(expressionManager.createExpression(loopCharacteristics.getInputDataItem()));
} else {
miActivityBehavior.setCollectionVariable(loopCharacteristics.getInputDataItem());
}
}
// activiti:elementVariable
if (StringUtils.isNotEmpty(loopCharacteristics.getElementVariable())) {
miActivityBehavior.setCollectionElementVariable(loopCharacteristics.getElementVariable());
}
// activiti:elementIndexVariable
if (StringUtils.isNotEmpty(loopCharacteristics.getElementIndexVariable())) {
miActivityBehavior.setCollectionElementIndexVariable(loopCharacteristics.getElementIndexVariable());
}
}
示例9: executeParse
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, EndEvent endEvent) {
ActivityImpl endEventActivity = createActivityOnCurrentScope(bpmnParse, endEvent, BpmnXMLConstants.ELEMENT_EVENT_END);
EventDefinition eventDefinition = null;
if (!endEvent.getEventDefinitions().isEmpty()) {
eventDefinition = endEvent.getEventDefinitions().get(0);
}
// Error end event
if (eventDefinition instanceof org.flowable.bpmn.model.ErrorEventDefinition) {
org.flowable.bpmn.model.ErrorEventDefinition errorDefinition = (org.flowable.bpmn.model.ErrorEventDefinition) eventDefinition;
if (bpmnParse.getBpmnModel().containsErrorRef(errorDefinition.getErrorCode())) {
String errorCode = bpmnParse.getBpmnModel().getErrors().get(errorDefinition.getErrorCode());
if (StringUtils.isEmpty(errorCode)) {
LOGGER.warn("errorCode is required for an error event {}", endEvent.getId());
}
endEventActivity.setProperty("type", "errorEndEvent");
errorDefinition.setErrorCode(errorCode);
}
endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createErrorEndEventActivityBehavior(endEvent, errorDefinition));
// Cancel end event
} else if (eventDefinition instanceof CancelEventDefinition) {
ScopeImpl scope = bpmnParse.getCurrentScope();
if (scope.getProperty("type") == null || !scope.getProperty("type").equals("transaction")) {
LOGGER.warn("end event with cancelEventDefinition only supported inside transaction subprocess (id={})", endEvent.getId());
} else {
endEventActivity.setProperty("type", "cancelEndEvent");
endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCancelEndEventActivityBehavior(endEvent));
}
// Terminate end event
} else if (eventDefinition instanceof TerminateEventDefinition) {
endEventActivity.setAsync(endEvent.isAsynchronous());
endEventActivity.setExclusive(!endEvent.isNotExclusive());
endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createTerminateEndEventActivityBehavior(endEvent));
// None end event
} else if (eventDefinition == null) {
endEventActivity.setAsync(endEvent.isAsynchronous());
endEventActivity.setExclusive(!endEvent.isNotExclusive());
endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createNoneEndEventActivityBehavior(endEvent));
}
}
示例10: createBoundaryErrorEventDefinition
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
public void createBoundaryErrorEventDefinition(ErrorEventDefinition errorEventDefinition, boolean interrupting,
ActivityImpl activity, ActivityImpl nestedErrorEventActivity) {
nestedErrorEventActivity.setProperty("type", "boundaryError");
ScopeImpl catchingScope = nestedErrorEventActivity.getParent();
((ActivityImpl) catchingScope).setScope(true);
org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition definition = new org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition(nestedErrorEventActivity.getId());
definition.setErrorCode(errorEventDefinition.getErrorCode());
addErrorEventDefinition(definition, catchingScope);
}
示例11: executeParse
import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, CompensateEventDefinition eventDefinition) {
ScopeImpl scope = bpmnParse.getCurrentScope();
if (StringUtils.isNotEmpty(eventDefinition.getActivityRef())) {
if (scope.findActivity(eventDefinition.getActivityRef()) == null) {
LOGGER.warn("Invalid attribute value for 'activityRef': no activity with id '{}' in current scope {}", eventDefinition.getActivityRef(), scope.getId());
}
}
org.activiti.engine.impl.bpmn.parser.CompensateEventDefinition compensateEventDefinition = new org.activiti.engine.impl.bpmn.parser.CompensateEventDefinition();
compensateEventDefinition.setActivityRef(eventDefinition.getActivityRef());
compensateEventDefinition.setWaitForCompletion(eventDefinition.isWaitForCompletion());
ActivityImpl activity = bpmnParse.getCurrentActivity();
if (bpmnParse.getCurrentFlowElement() instanceof ThrowEvent) {
activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateThrowCompensationEventActivityBehavior((ThrowEvent) bpmnParse.getCurrentFlowElement(), compensateEventDefinition));
} else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
boolean interrupting = boundaryEvent.isCancelActivity();
activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryEventActivityBehavior(boundaryEvent, interrupting, activity));
activity.setProperty("type", "compensationBoundaryCatch");
} else {
// What to do?
}
}