本文整理汇总了Java中org.alfresco.service.cmr.action.Action.getParameterValues方法的典型用法代码示例。如果您正苦于以下问题:Java Action.getParameterValues方法的具体用法?Java Action.getParameterValues怎么用?Java Action.getParameterValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.action.Action
的用法示例。
在下文中一共展示了Action.getParameterValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ActionImpl
import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
public ActionImpl(Action action, String actionDefinitionName)
{
super(action.getId(), action.getParameterValues());
this.actionDefinitionName = actionDefinitionName;
this.actionConditions = action.getActionConditions();
this.compensatingAction = action.getCompensatingAction();
this.createdDate = action.getCreatedDate();
this.creator = action.getCreator();
this.description = action.getDescription();
this.trackStatus = action.getTrackStatus();
this.executeAsynchronously = action.getExecuteAsychronously();
this.modifiedDate = action.getModifiedDate();
this.modifier = action.getModifier();
this.nodeRef = action.getNodeRef();
this.title = action.getTitle();
this.executionStartDate = action.getExecutionStartDate();
this.executionEndDate = action.getExecutionEndDate();
this.executionStatus = action.getExecutionStatus();
this.executionFailureMessage = action.getExecutionFailureMessage();
if (action instanceof ActionImpl)
{
ActionImpl actionImpl = (ActionImpl) action;
this.executionInstance = actionImpl.getExecutionInstance();
this.runAsUserName = actionImpl.getRunAsUser();
this.tenantId = actionImpl.getTenantId();
this.actionChain = actionImpl.actionChain;
}
}
示例2: checkRule
import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
protected void checkRule(Rule rule)
{
// Check the basic details of the rule
assertEquals(this.ruleType.getName(), rule.getRuleTypes().get(0));
assertEquals(TITLE, rule.getTitle());
assertEquals(DESCRIPTION, rule.getDescription());
Action ruleAction = rule.getAction();
assertNotNull(ruleAction);
// Check conditions
List<ActionCondition> ruleConditions = ruleAction.getActionConditions();
assertNotNull(ruleConditions);
assertEquals(1, ruleConditions.size());
assertEquals(CONDITION_DEF_NAME, ruleConditions.get(0)
.getActionConditionDefinitionName());
Map<String, Serializable> condParams = ruleConditions.get(0)
.getParameterValues();
assertNotNull(condParams);
assertEquals(1, condParams.size());
assertTrue(condParams.containsKey(COND_PROP_NAME_1));
assertEquals(COND_PROP_VALUE_1, condParams.get(COND_PROP_NAME_1));
// Check the actions
assertEquals(ACTION_DEF_NAME, ruleAction.getActionDefinitionName());
Map<String, Serializable> actionParams = ruleAction.getParameterValues();
assertNotNull(actionParams);
assertEquals(1, actionParams.size());
assertTrue(actionParams.containsKey(ACTION_PROP_NAME_1));
assertEquals(ACTION_PROP_VALUE_1, actionParams.get(ACTION_PROP_NAME_1));
}
示例3: prepareEmail
import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
@Override
public MimeMessageHelper prepareEmail(Action ruleAction, NodeRef actionedUponNodeRef, Pair<String, Locale> recipient,
Pair<InternetAddress, Locale> sender)
{
parameterValues = ruleAction.getParameterValues();
return super.prepareEmail(ruleAction, actionedUponNodeRef, recipient, sender);
}
示例4: executeImpl
import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
@Override
protected void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
{
// retrieve workflow definition
String workflowName = (String)ruleAction.getParameterValue(PARAM_WORKFLOW_NAME);
WorkflowDefinition def = workflowService.getDefinitionByName(workflowName);
// create workflow package to contain actioned upon node
NodeRef workflowPackage = (NodeRef)ruleAction.getParameterValue(WorkflowModel.ASSOC_PACKAGE.toPrefixString(namespaceService));
workflowPackage = workflowService.createPackage(workflowPackage);
ChildAssociationRef childAssoc = nodeService.getPrimaryParent(actionedUponNodeRef);
nodeService.addChild(workflowPackage, actionedUponNodeRef, WorkflowModel.ASSOC_PACKAGE_CONTAINS, childAssoc.getQName());
// build map of workflow start task parameters
Map<String, Serializable> paramValues = ruleAction.getParameterValues();
Map<QName, Serializable> workflowParameters = new HashMap<QName, Serializable>();
workflowParameters.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage);
for (Map.Entry<String, Serializable> entry : paramValues.entrySet())
{
if (!entry.getKey().equals(PARAM_WORKFLOW_NAME))
{
QName qname = QName.createQName(entry.getKey(), namespaceService);
Serializable value = entry.getValue();
workflowParameters.put(qname, value);
}
}
// provide a default context, if one is not specified
Serializable context = workflowParameters.get(WorkflowModel.PROP_CONTEXT);
if (context == null)
{
workflowParameters.put(WorkflowModel.PROP_CONTEXT, childAssoc.getParentRef());
}
// start the workflow
WorkflowPath path = workflowService.startWorkflow(def.getId(), workflowParameters);
// determine whether to auto-end the start task
Boolean endStartTask = (Boolean)ruleAction.getParameterValue(PARAM_END_START_TASK);
String startTaskTransition = (String)ruleAction.getParameterValue(PARAM_START_TASK_TRANSITION);
endStartTask = (endStartTask == null) ? true : false;
// auto-end the start task with the provided transition (if one)
if (endStartTask)
{
List<WorkflowTask> tasks = workflowService.getTasksForWorkflowPath(path.getId());
for (WorkflowTask task : tasks)
{
workflowService.endTask(task.getId(), startTaskTransition);
}
}
}