本文整理汇总了Java中org.alfresco.service.cmr.workflow.WorkflowNode类的典型用法代码示例。如果您正苦于以下问题:Java WorkflowNode类的具体用法?Java WorkflowNode怎么用?Java WorkflowNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WorkflowNode类属于org.alfresco.service.cmr.workflow包,在下文中一共展示了WorkflowNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTaskDefinition
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
public WorkflowTaskDefinition getTaskDefinition(Task task)
{
// Get the task-form used (retrieved from cached process-definition)
TaskFormData taskFormData = formService.getTaskFormData(task.getId());
String taskDefId = null;
if(taskFormData != null)
{
taskDefId = taskFormData.getFormKey();
}
// Fetch node based on cached process-definition
ReadOnlyProcessDefinition procDef = activitiUtil.getDeployedProcessDefinition(task.getProcessDefinitionId());
WorkflowNode node = convert(procDef.findActivity(task.getTaskDefinitionKey()), true);
return factory.createTaskDefinition(taskDefId, node, taskDefId, false);
}
示例2: convert
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
public WorkflowPath convert(Execution execution, ProcessInstance instance)
{
if(execution == null)
return null;
boolean isActive = !execution.isEnded();
// Convert workflow and collect variables
Map<String, Object> workflowInstanceVariables = new HashMap<String, Object>();
WorkflowInstance wfInstance = convertAndSetVariables(instance, workflowInstanceVariables);
WorkflowNode node = null;
// Get active node on execution
List<String> nodeIds = runtimeService.getActiveActivityIds(execution.getId());
if (nodeIds != null && nodeIds.size() >= 1)
{
ReadOnlyProcessDefinition procDef = activitiUtil.getDeployedProcessDefinition(instance.getProcessDefinitionId());
PvmActivity activity = procDef.findActivity(nodeIds.get(0));
node = convert(activity);
}
return factory.createPath(execution.getId(), wfInstance, node, isActive);
}
示例3: getNode
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
/**
* @param activity PvmActivity
* @param key String
* @param forceIsTaskNode boolean
* @return WorkflowNode
*/
private WorkflowNode getNode(PvmActivity activity, String key, boolean forceIsTaskNode)
{
String name = activity.getId();
String defaultTitle = (String) activity.getProperty(ActivitiConstants.NODE_NAME);
String defaultDescription = (String) activity.getProperty(ActivitiConstants.NODE_DESCRIPTION);
String type = (String) activity.getProperty(ActivitiConstants.NODE_TYPE);
boolean isTaskNode = forceIsTaskNode || ActivitiConstants.USER_TASK_NODE_TYPE.equals(type);
if(defaultTitle == null)
{
defaultTitle = name;
}
if(defaultDescription == null)
{
defaultDescription = name;
}
WorkflowTransition transition = getDefaultTransition(key, name);
return factory.createNode(name, key, defaultTitle, defaultDescription, type, isTaskNode, transition);
}
示例4: buildCompletedPath
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
public WorkflowPath buildCompletedPath(String executionId, String processInstanceId)
{
WorkflowInstance wfInstance = null;
ProcessInstance processInstance = activitiUtil.getProcessInstance(processInstanceId);
if(processInstance != null)
{
wfInstance = convert(processInstance);
}
else
{
HistoricProcessInstance historicProcessInstance = activitiUtil.getHistoricProcessInstance(processInstanceId);
if(historicProcessInstance!= null)
wfInstance = convert(historicProcessInstance);
}
if(wfInstance == null)
{
// When workflow is cancelled or deleted, WorkflowPath should not be returned
return null;
}
WorkflowNode node = null;
return factory.createPath(executionId, wfInstance, node, false);
}
示例5: JscriptWorkflowNode
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
/**
* Constructor to create a new instance of this class from an
* existing instance of WorkflowNode from the CMR workflow
* object model
*
* @param workflowNode CMR workflow node object to create
* new <code>JscriptWorkflowNode</code> from
* @param scope root scripting scope for this newly instantiated object
* @param serviceRegistry service registry object
*/
public JscriptWorkflowNode(WorkflowNode workflowNode, Scriptable scope, ServiceRegistry serviceRegistry)
{
this.name = workflowNode.name;
this.title = workflowNode.title;
this.description = workflowNode.description;
this.isTaskNode = workflowNode.isTaskNode;
this.transitions = new ArrayList<JscriptWorkflowTransition>();
WorkflowTransition[] cmrWorkflowTransitions = workflowNode.transitions;
for (WorkflowTransition cmrWorkflowTransition : cmrWorkflowTransitions)
{
transitions.add(new JscriptWorkflowTransition(cmrWorkflowTransition));
}
this.scope = scope;
this.serviceRegistry = serviceRegistry;
}
示例6: makeTask
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
private WorkflowTask makeTask(WorkflowTransition... transitions)
{
String id = TASK_ID;
String title = "Test";
WorkflowTaskState state = WorkflowTaskState.IN_PROGRESS;
WorkflowTaskDefinition taskDef = makeTaskDefinition(transitions);
Map<QName, Serializable> properties = makeTaskProperties();
WorkflowDefinition definition = new WorkflowDefinition("42", "Test", "1.0", "Test", "Test", null);
NodeRef wfPackage = PCKG_NODE;
WorkflowInstance instance = new WorkflowInstance(null,
definition, null,
null, wfPackage,
null, true, null, null);
WorkflowNode node = new WorkflowNode("", "", "", "", true, new WorkflowTransition[0]);
WorkflowPath path = new WorkflowPath(null, instance, node, true);
return new WorkflowTask(id,
taskDef, null, title, null, state, path, properties);
}
示例7: buildWorkflowNode
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
private Map<String, Object> buildWorkflowNode(WorkflowNode workflowNode, WorkflowTask workflowTask)
{
Map<String, Object> model = new HashMap<String, Object>();
model.put(WORKFLOW_NODE_NAME, workflowNode.getName());
model.put(WORKFLOW_NODE_TITLE, workflowNode.getTitle());
model.put(WORKFLOW_NODE_DESCRIPTION, workflowNode.getDescription());
model.put(WORKFLOW_NODE_IS_TASK_NODE, workflowNode.isTaskNode());
List<Map<String, Object>> transitions = new ArrayList<Map<String, Object>>();
List<?> hiddenTransitions = getHiddenTransitions(workflowTask.getProperties());
for (WorkflowTransition workflowTransition : workflowNode.getTransitions())
{
Map<String, Object> transitionModel = buildTransition(workflowTransition, hiddenTransitions);
transitions.add(transitionModel);
}
model.put(WORKFLOW_NODE_TRANSITIONS, transitions);
return model;
}
示例8: createPath
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
public WorkflowPath createPath(String id,
WorkflowInstance wfInstance, WorkflowNode node,
boolean isActive)
{
String actualId = buildGlobalId(id);
return new WorkflowPath(actualId, wfInstance, node, isActive);
}
示例9: createNode
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
public WorkflowNode createNode(String name,
String definitionName, String defaultTitle,
String defaultDescription, String type,
boolean isTaskNode, WorkflowTransition... transitions)
{
String displayId = definitionName + ".node."+name;
String title = getLabel(displayId, TITLE_LABEL, defaultTitle);
String description = getLabel(displayId, DESC_LABEL, defaultDescription, title);
return new WorkflowNode(name,
title, description, type,
isTaskNode, transitions);
}
示例10: createTaskDefinition
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
public WorkflowTaskDefinition createTaskDefinition(String id, WorkflowNode node, String typeName, boolean isStart)
{
TypeDefinition metaData = getTaskTypeDefinition(typeName, isStart);
if(id == null)
{
id = qNameConverter.mapQNameToName(metaData.getName());
}
return new WorkflowTaskDefinition(id, node, metaData);
}
示例11: JscriptWorkflowPath
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
/**
* Creates a new instance of a workflow path
*
* @param id workflow path ID
* @param node workflow node the path has reached
* @param instance instance to which the workflow path belongs
* @param serviceRegistry Service Registry object
* @param scope the root scripting scope for this object
*/
public JscriptWorkflowPath(final String id, final WorkflowNode node, final JscriptWorkflowInstance instance,
final ServiceRegistry serviceRegistry, final Scriptable scope)
{
this.id = id;
this.node = node;
this.instance = instance;
this.active = false;
this.serviceRegistry = serviceRegistry;
this.scope = scope;
}
示例12: getTransitions
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
/**
* Get the available transition ids.
*
* @return ScriptableHashMap
*/
public ScriptableHashMap<String, String> getTransitions()
{
ScriptableHashMap<String, String> transitions = new ScriptableHashMap<String, String>();
WorkflowNode workflowNode = task.getPath().getNode();
if (workflowNode != null)
{
for (WorkflowTransition transition : workflowNode.getTransitions())
{
transitions.put(transition.getId(), transition.getTitle());
}
}
return transitions;
}
示例13: makeTaskDefinition
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
private WorkflowTaskDefinition makeTaskDefinition()
{
String id = "foo$startTaskDefId";
TypeDefinition metadata = makeTypeDef();
WorkflowNode node = new WorkflowNode("", "", "", "", false);
return new WorkflowTaskDefinition(id,
node, metadata);
}
示例14: makeTaskDefinition
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
private WorkflowTaskDefinition makeTaskDefinition(WorkflowTransition... transitions)
{
String id = "DefinitionId";
TypeDefinition metadata = makeTypeDef();
WorkflowNode node = new WorkflowNode("", "", "", "", true, transitions);
return new WorkflowTaskDefinition(id,
node, metadata);
}
示例15: testGetDefinitionById
import org.alfresco.service.cmr.workflow.WorkflowNode; //导入依赖的package包/类
@Test
public void testGetDefinitionById() throws Exception
{
WorkflowDefinition definition = deployTestTaskDefinition();
WorkflowDefinition result = workflowEngine.getDefinitionById(definition.getId());
assertNotNull("The workflow definition was not found!", result);
assertEquals(definition.getId(), result.getId());
assertEquals(definition.getDescription(), result.getDescription());
assertEquals(definition.getName(), result.getName());
assertEquals(definition.getTitle(), result.getTitle());
assertEquals(definition.getVersion(), result.getVersion());
WorkflowTaskDefinition resultStartDef = result.getStartTaskDefinition();
assertNotNull("Start task is null!", resultStartDef);
WorkflowTaskDefinition originalStartDef = definition.getStartTaskDefinition();
assertEquals("Start task Id does not match!", originalStartDef.getId(), resultStartDef.getId());
WorkflowNode resultNode = resultStartDef.getNode();
assertNotNull("Start Task Node is null!", resultNode);
assertEquals("Start Task Node Name does not match!", originalStartDef.getNode().getName(), resultNode.getName());
TypeDefinition metaData = resultStartDef.getMetadata();
assertNotNull("Start Task Metadata is null!", metaData);
assertEquals("Start Task Metadata name does not match!", originalStartDef.getMetadata().getName(), metaData.getName());
workflowEngine.undeployDefinition(definition.getId());
WorkflowDefinition nullResult = workflowEngine.getDefinitionById(definition.getId());
assertNull("The workflow definition was found but should be null!", nullResult);
}