本文整理汇总了Java中org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity类的典型用法代码示例。如果您正苦于以下问题:Java ProcessDefinitionEntity类的具体用法?Java ProcessDefinitionEntity怎么用?Java ProcessDefinitionEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProcessDefinitionEntity类属于org.activiti.engine.impl.persistence.entity包,在下文中一共展示了ProcessDefinitionEntity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getNextActivityImpl
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
@Override
public Map<PvmTransition, ActivityImpl> getNextActivityImpl(String bizKey) {
ProcessInstance pi = getProcessInstancsByBizKey(bizKey);
// 获取该全部的流程活动实例
List<Execution> excutionList = runtimeService.createExecutionQuery()
.processInstanceId(pi.getId()).list();
Map<String, String> map = new HashMap<String, String>();
for (Execution execution : excutionList) {
if (execution.getActivityId() != null)
map.put(execution.getActivityId(), execution.getActivityId());
}
List<String> excutionActivitId = new ArrayList<String>(map.values());
ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((org.activiti.engine.impl.RepositoryServiceImpl) repositoryService)
.getDeployedProcessDefinition(pi.getProcessDefinitionId());
List<ActivityImpl> activitiList = def.getActivities();
// 遍历所有节点找到当前节点的下一个节点
for (ActivityImpl activityDef : activitiList) {
for (String ActivitId : excutionActivitId) {
if (ActivitId.equals(activityDef.getId())) {
return nextActivityImpl(activityDef);
}
}
}
return null;
}
开发者ID:lz84,项目名称:bachelor,代码行数:26,代码来源:BpmEngineServiceImpl.java
示例2: hasWorkflowImage
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public boolean hasWorkflowImage(String workflowInstanceId)
{
boolean hasImage = false;
String processInstanceId = createLocalId(workflowInstanceId);
ExecutionEntity pi = (ExecutionEntity) runtimeService.createProcessInstanceQuery()
.processInstanceId(processInstanceId).singleResult();
// If the process is finished, there is no diagram available
if (pi != null)
{
// Fetch the process-definition. Not using query API, since the returned
// processdefinition isn't initialized with all activities
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repoService)
.getDeployedProcessDefinition(pi.getProcessDefinitionId());
hasImage = (processDefinition != null && processDefinition.isGraphicalNotationDefined());
}
return hasImage;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:ActivitiWorkflowEngine.java
示例3: getTaskDefinition
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
/**
* Get the taskDefinition key based on the Activiti task definition id,
* @param taskDefinitionKey String
* @param processDefinitionId String
* @return WorkflowTaskDefinition
*/
public WorkflowTaskDefinition getTaskDefinition(String taskDefinitionKey, String processDefinitionId)
{
ProcessDefinitionEntity procDef = (ProcessDefinitionEntity) activitiUtil.getDeployedProcessDefinition(processDefinitionId);
Collection<PvmActivity> userTasks = findUserTasks(procDef.getInitial());
TaskDefinition taskDefinition = null;
for(PvmActivity activity : userTasks)
{
taskDefinition = procDef.getTaskDefinitions().get(activity.getId());
if(taskDefinitionKey.equals(taskDefinition.getKey()))
{
String formKey = getFormKey(taskDefinition);
WorkflowNode node = convert(activity);
return factory.createTaskDefinition(formKey, node, formKey, false);
}
}
return null;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:ActivitiTypeConverter.java
示例4: getFormKey
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的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;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:ActivitiTypeConverter.java
示例5: findFirstActivity
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
/**
* 获得第一个节点.
*/
public PvmActivity findFirstActivity(String processDefinitionId) {
ProcessDefinitionEntity processDefinitionEntity = Context
.getProcessEngineConfiguration().getProcessDefinitionCache()
.get(processDefinitionId);
ActivityImpl startActivity = processDefinitionEntity.getInitial();
if (startActivity.getOutgoingTransitions().size() != 1) {
throw new IllegalStateException(
"start activity outgoing transitions cannot more than 1, now is : "
+ startActivity.getOutgoingTransitions().size());
}
PvmTransition pvmTransition = startActivity.getOutgoingTransitions()
.get(0);
PvmActivity targetActivity = pvmTransition.getDestination();
if (!"userTask".equals(targetActivity.getProperty("type"))) {
logger.debug("first activity is not userTask, just skip");
return null;
}
return targetActivity;
}
开发者ID:zhaojunfei,项目名称:lemon,代码行数:29,代码来源:AutoCompleteFirstTaskListener.java
示例6: getHighLightedFlows
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
private List<String> getHighLightedFlows(
ProcessDefinitionEntity processDefinition, String processInstanceId) {
List<HistoricActivityInstance> historicActivityInstances = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(processInstanceId)
.orderByHistoricActivityInstanceStartTime().asc() /* .orderByActivityId().asc() */
.list();
for (HistoricActivityInstance hai : historicActivityInstances) {
historicActivityInstanceList.add(hai.getActivityId());
}
// add current activities to list
highLightedActivities = runtimeService
.getActiveActivityIds(processInstanceId);
historicActivityInstanceList.addAll(highLightedActivities);
// activities and their sequence-flows
getHighlightedFlows(processDefinition.getActivities());
return highLightedFlows;
}
开发者ID:zhaojunfei,项目名称:lemon,代码行数:23,代码来源:BpmResource.java
示例7: findTargetActivity
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
/**
* 查找回退的目的节点.
*/
public ActivityImpl findTargetActivity(CommandContext commandContext,
TaskEntity taskEntity) {
if (activityId == null) {
String historyTaskId = this.findNearestUserTask(commandContext);
HistoricTaskInstanceEntity historicTaskInstanceEntity = commandContext
.getHistoricTaskInstanceEntityManager()
.findHistoricTaskInstanceById(historyTaskId);
this.activityId = historicTaskInstanceEntity.getTaskDefinitionKey();
}
String processDefinitionId = taskEntity.getProcessDefinitionId();
ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
processDefinitionId).execute(commandContext);
return processDefinitionEntity.findActivity(activityId);
}
开发者ID:zhaojunfei,项目名称:lemon,代码行数:20,代码来源:RollbackTaskCmd.java
示例8: findStartEventForm
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
public FirstTaskForm findStartEventForm(
ProcessDefinitionEntity processDefinitionEntity) {
FirstTaskForm firstTaskForm = new FirstTaskForm();
firstTaskForm.setExists(true);
firstTaskForm.setProcessDefinitionId(processDefinitionId);
firstTaskForm.setTaskForm(false);
DefaultFormHandler formHandler = (DefaultFormHandler) processDefinitionEntity
.getStartFormHandler();
if (formHandler.getFormKey() != null) {
String formKey = formHandler.getFormKey().getExpressionText();
firstTaskForm.setFormKey(formKey);
firstTaskForm.setActivityId(processDefinitionEntity.getInitial()
.getId());
}
return firstTaskForm;
}
开发者ID:zhaojunfei,项目名称:lemon,代码行数:20,代码来源:FindFirstTaskFormCmd.java
示例9: initSource
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
public void initSource() {
// source task
this.jumpInfo.setSourceTaskId(this.taskId);
TaskEntity sourceTask = Context.getCommandContext()
.getTaskEntityManager().findTaskById(this.taskId);
this.jumpInfo.setSourceTask(sourceTask);
ProcessDefinitionEntity processDefinitionEntity = Context
.getProcessEngineConfiguration()
.getDeploymentManager()
.findDeployedProcessDefinitionById(
sourceTask.getProcessDefinitionId());
// source activity
this.jumpInfo.setSourceActivityId(sourceTask.getTaskDefinitionKey());
this.jumpInfo.setSourceActivity(processDefinitionEntity
.findActivity(this.jumpInfo.getSourceActivityId()));
HistoricTaskInstanceEntity sourceHistoryTask = Context
.getCommandContext().getHistoricTaskInstanceEntityManager()
.findHistoricTaskInstanceById(this.jumpInfo.getSourceTaskId());
}
开发者ID:zhaojunfei,项目名称:lemon,代码行数:23,代码来源:RollbackCmd.java
示例10: getProcessDefinition
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
@Override
public ProcessDefinition getProcessDefinition(String definitionId)
{
ProcessDefinitionQuery query = activitiProcessEngine
.getRepositoryService()
.createProcessDefinitionQuery()
.processDefinitionId(definitionId);
if (tenantService.isEnabled() && deployWorkflowsInTenant)
{
query.processDefinitionKeyLike("@" + TenantUtil.getCurrentDomain() + "@%");
}
org.activiti.engine.repository.ProcessDefinition processDefinition = query.singleResult();
if (processDefinition == null)
{
throw new EntityNotFoundException(definitionId);
}
ProcessDefinition deploymentRest = createProcessDefinitionRest((ProcessDefinitionEntity) processDefinition);
return deploymentRest;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:ProcessDefinitionsImpl.java
示例11: testParseNamespaceInConditionExpressionType
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
@Deployment
public void testParseNamespaceInConditionExpressionType() {
ProcessDefinition processDefinition = processEngineConfiguration.getFlowable5CompatibilityHandler().getProcessDefinitionByKey("resolvableNamespacesProcess");
ProcessDefinitionEntity rawEntity = (ProcessDefinitionEntity) processDefinition;
// Test that the process definition has been deployed
assertNotNull(rawEntity);
ActivityImpl activity = rawEntity.findActivity("ExclusiveGateway_1");
assertNotNull(activity);
// Test that the conditions has been resolved
for (PvmTransition transition : activity.getOutgoingTransitions()) {
if (transition.getDestination().getId().equals("Task_2")) {
assertEquals("#{approved}", transition.getProperty("conditionText"));
} else if (transition.getDestination().getId().equals("Task_3")) {
assertEquals("#{!approved}", transition.getProperty("conditionText"));
} else {
fail("Something went wrong");
}
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:23,代码来源:BpmnParseTest.java
示例12: startProcessInstanceWithInitialActivity
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
protected void startProcessInstanceWithInitialActivity(Job job, String configuration, DeploymentManager deploymentManager, CommandContext commandContext) {
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) deploymentManager.findDeployedProcessDefinitionById(job.getProcessDefinitionId());
String activityId = getActivityIdFromConfiguration(configuration);
ActivityImpl startActivity = processDefinition.findActivity(activityId);
if (!deploymentManager.isProcessDefinitionSuspended(processDefinition.getId())) {
dispatchTimerFiredEvent(job, commandContext);
ExecutionEntity processInstance = processDefinition.createProcessInstance(null, startActivity);
processInstance.start();
} else {
LOGGER.debug("Ignoring timer of suspended process definition {}", processDefinition.getId());
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:TimerStartEventJobHandler.java
示例13: createTimerForDelayedExecution
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
protected void createTimerForDelayedExecution(CommandContext commandContext, List<ProcessDefinitionEntity> processDefinitions) {
for (ProcessDefinitionEntity processDefinition : processDefinitions) {
TimerJobEntity timer = new TimerJobEntity();
timer.setJobType(Job.JOB_TYPE_TIMER);
timer.setRevision(1);
timer.setProcessDefinitionId(processDefinition.getId());
// Inherit tenant identifier (if applicable)
if (processDefinition.getTenantId() != null) {
timer.setTenantId(processDefinition.getTenantId());
}
timer.setDuedate(executionDate);
timer.setJobHandlerType(getDelayedExecutionJobHandlerType());
timer.setJobHandlerConfiguration(TimerChangeProcessDefinitionSuspensionStateJobHandler.createJobHandlerConfiguration(includeProcessInstances));
commandContext.getJobEntityManager().schedule(timer);
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:19,代码来源:AbstractSetProcessDefinitionStateCmd.java
示例14: execute
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
@Override
protected ProcessInstance execute(CommandContext commandContext, ProcessDefinition processDefinition) {
ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) processDefinition;
ExecutionEntity processInstance = null;
if (businessKey != null) {
processInstance = processDefinitionEntity.createProcessInstance(businessKey);
} else {
processInstance = processDefinitionEntity.createProcessInstance();
}
commandContext.getHistoryManager()
.reportFormPropertiesSubmitted(processInstance, properties, null);
StartFormHandler startFormHandler = processDefinitionEntity.getStartFormHandler();
startFormHandler.submitFormProperties(properties, processInstance);
processInstance.start();
return processInstance;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:21,代码来源:SubmitStartFormCmd.java
示例15: validateAndSwitchVersionOfExecution
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
protected void validateAndSwitchVersionOfExecution(CommandContext commandContext, ExecutionEntity execution, ProcessDefinitionEntity newProcessDefinition) {
// check that the new process definition version contains the current activity
if (execution.getActivity() != null && !newProcessDefinition.contains(execution.getActivity())) {
throw new ActivitiException(
"The new process definition " +
"(key = '" + newProcessDefinition.getKey() + "') " +
"does not contain the current activity " +
"(id = '" + execution.getActivity().getId() + "') " +
"of the process instance " +
"(id = '" + processInstanceId + "').");
}
// switch the process instance to the new process definition version
execution.setProcessDefinition(newProcessDefinition);
// and change possible existing tasks (as the process definition id is stored there too)
List<TaskEntity> tasks = commandContext.getTaskEntityManager().findTasksByExecutionId(execution.getId());
for (TaskEntity taskEntity : tasks) {
taskEntity.setProcessDefinitionId(newProcessDefinition.getId());
commandContext.getHistoryManager().recordTaskProcessDefinitionChange(taskEntity.getId(), newProcessDefinition.getId());
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:23,代码来源:SetProcessDefinitionVersionCmd.java
示例16: execute
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
@Override
public StartFormData execute(CommandContext commandContext) {
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) commandContext
.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:flowable,项目名称:flowable-engine,代码行数:18,代码来源:GetStartFormCmd.java
示例17: selectInitial
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
protected void selectInitial(BpmnParse bpmnParse, ActivityImpl startEventActivity, StartEvent startEvent, ProcessDefinitionEntity processDefinition) {
if (processDefinition.getInitial() == null) {
processDefinition.setInitial(startEventActivity);
} else {
// validate that there is a single none start event / timer start event:
if (!startEventActivity.getProperty("type").equals("messageStartEvent")
&& !startEventActivity.getProperty("type").equals("signalStartEvent")
&& !startEventActivity.getProperty("type").equals("startTimerEvent")) {
String currentInitialType = (String) processDefinition.getInitial().getProperty("type");
if (currentInitialType.equals("messageStartEvent")) {
processDefinition.setInitial(startEventActivity);
} else {
throw new ActivitiException("multiple none start events or timer start events not supported on process definition");
}
}
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:StartEventParseHandler.java
示例18: createProcessDefinitionStartEvent
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
protected void createProcessDefinitionStartEvent(BpmnParse bpmnParse, ActivityImpl startEventActivity, StartEvent startEvent, ProcessDefinitionEntity processDefinition) {
if (StringUtils.isNotEmpty(startEvent.getInitiator())) {
processDefinition.setProperty(PROPERTYNAME_INITIATOR_VARIABLE_NAME, startEvent.getInitiator());
}
// all start events share the same behavior:
startEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createNoneStartEventActivityBehavior(startEvent));
if (!startEvent.getEventDefinitions().isEmpty()) {
EventDefinition eventDefinition = startEvent.getEventDefinitions().get(0);
if (eventDefinition instanceof TimerEventDefinition
|| eventDefinition instanceof MessageEventDefinition
|| eventDefinition instanceof SignalEventDefinition) {
bpmnParse.getBpmnParserHandlers().parseElement(bpmnParse, eventDefinition);
} else {
LOGGER.warn("Unsupported event definition on start event {}", eventDefinition);
}
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:19,代码来源:StartEventParseHandler.java
示例19: addTimerDeclarations
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void addTimerDeclarations(ProcessDefinitionEntity processDefinition, List<TimerJobEntity> timers) {
List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) processDefinition.getProperty(BpmnParse.PROPERTYNAME_START_TIMER);
if (timerDeclarations != null) {
for (TimerDeclarationImpl timerDeclaration : timerDeclarations) {
TimerJobEntity timer = timerDeclaration.prepareTimerEntity(null);
if (timer != null) {
timer.setProcessDefinitionId(processDefinition.getId());
// Inherit timer (if applicable)
if (processDefinition.getTenantId() != null) {
timer.setTenantId(processDefinition.getTenantId());
}
timers.add(timer);
}
}
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:19,代码来源:BpmnDeployer.java
示例20: removeObsoleteTimers
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; //导入依赖的package包/类
protected void removeObsoleteTimers(ProcessDefinitionEntity processDefinition) {
List<Job> jobsToDelete = null;
if (processDefinition.getTenantId() != null && !ProcessEngineConfiguration.NO_TENANT_ID.equals(processDefinition.getTenantId())) {
jobsToDelete = Context.getCommandContext().getTimerJobEntityManager().findTimerJobsByTypeAndProcessDefinitionKeyAndTenantId(
TimerStartEventJobHandler.TYPE, processDefinition.getKey(), processDefinition.getTenantId());
} else {
jobsToDelete = Context.getCommandContext().getTimerJobEntityManager()
.findTimerJobsByTypeAndProcessDefinitionKeyNoTenantId(TimerStartEventJobHandler.TYPE, processDefinition.getKey());
}
if (jobsToDelete != null) {
for (Job job : jobsToDelete) {
new CancelJobsCmd(job.getId()).execute(Context.getCommandContext());
}
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:19,代码来源:BpmnDeployer.java
注:本文中的org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论