当前位置: 首页>>代码示例>>Java>>正文


Java Action.getActionConditions方法代码示例

本文整理汇总了Java中org.alfresco.service.cmr.action.Action.getActionConditions方法的典型用法代码示例。如果您正苦于以下问题:Java Action.getActionConditions方法的具体用法?Java Action.getActionConditions怎么用?Java Action.getActionConditions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.service.cmr.action.Action的用法示例。


在下文中一共展示了Action.getActionConditions方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: evaluateAction

import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
/**
 * @see org.alfresco.service.cmr.action.ActionService#evaluateAction(org.alfresco.service.cmr.action.Action,
 *      org.alfresco.service.cmr.repository.NodeRef)
 */
public boolean evaluateAction(Action action, NodeRef actionedUponNodeRef)
{
    boolean result = true;

    if (action.hasActionConditions() == true)
    {
        List<ActionCondition> actionConditions = action.getActionConditions();
        for (ActionCondition condition : actionConditions)
        {
            boolean tempresult = evaluateActionCondition(condition, actionedUponNodeRef);

            if (logger.isDebugEnabled())
                logger.debug("\tCondition " + condition.getActionConditionDefinitionName() + " Result - "
                            + tempresult);

            result = result && tempresult;
        }
    }

    if (logger.isDebugEnabled())
        logger.debug("\tAll Condition Evaluation Result - " + result);

    return result;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:ActionServiceImpl.java

示例2: saveConditions

import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
/**
 * Saves the conditions associated with an action.
 * 
 * @param actionNodeRef the action node reference
 * @param action the action
 */
private void saveConditions(NodeRef actionNodeRef, Action action)
{
    // TODO Need a way of sorting out the order of the conditions
    List<ActionCondition> actionConditionsList = action.getActionConditions();
    saveActionConditionList(actionNodeRef, actionConditionsList, false);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:ActionServiceImpl.java

示例3: 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;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:ActionImpl.java

示例4: 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));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:32,代码来源:BaseRuleTest.java

示例5: testGetRules

import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
/**
 * Test get rules
 */
public void testGetRules()
{
    // Check that there are no rules associationed with the node
    List<Rule> noRules = this.ruleService.getRules(this.nodeRef);
    assertNotNull(noRules);
    assertEquals(0, noRules.size());
    
    // Check that we still get nothing back after the details of the node
    // have been cached in the rule store
    List<Rule> noRulesAfterCache = this.ruleService.getRules(this.nodeRef);
    assertNotNull(noRulesAfterCache);
    assertEquals(0, noRulesAfterCache.size());
    
    // Add a rule to the node
    testAddRule();
    
    // Get the rule from the rule service
    List<Rule> rules = this.ruleService.getRules(this.nodeRef);
    assertNotNull(rules);
    assertEquals(1, rules.size());
    
    // Check the details of the rule
    Rule rule = rules.get(0);
    assertEquals("title", rule.getTitle());
    assertEquals("description", rule.getDescription());
    assertNotNull(this.nodeService.getProperty(rule.getNodeRef(), ContentModel.PROP_CREATED));
    assertNotNull(this.nodeService.getProperty(rule.getNodeRef(), ContentModel.PROP_CREATOR));
    
    // Check that the condition action have been retireved correctly
    Action action = rule.getAction();
    assertNotNull(action);
    List<ActionCondition> conditions = action.getActionConditions();
    assertNotNull(conditions);
    assertEquals(1, conditions.size());                
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:39,代码来源:RuleServiceImplTest.java

示例6: testActionConditions

import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
public void testActionConditions()
{
    ActionCondition cond1 = new ActionConditionImpl(ID_COND1, NAME_COND1, this.paramValues);
    ActionCondition cond2 = new ActionConditionImpl(ID_COND2, NAME_COND2, this.paramValues);
    ActionCondition cond3 = new ActionConditionImpl(ID_COND3, NAME_COND3, this.paramValues);
    
    Action action = (Action)create();
    
    // Check has no conditions
    assertFalse(action.hasActionConditions());
    List<ActionCondition> noConditions = action.getActionConditions();
    assertNotNull(noConditions);
    assertEquals(0, noConditions.size());

    // Add the conditions to the action
    action.addActionCondition(cond1);
    action.addActionCondition(cond2);
    action.addActionCondition(cond3);
    
    // Check that the conditions are there and in the correct order
    assertTrue(action.hasActionConditions());
    List<ActionCondition> actionConditions = action.getActionConditions();
    assertNotNull(actionConditions);
    assertEquals(3, actionConditions.size());
    int counter = 0;
    for (ActionCondition condition : actionConditions)
    {
        if (counter == 0)
        {
            assertEquals(cond1, condition);
        }
        else if (counter == 1)
        {
            assertEquals(cond2, condition);
        }
        else if (counter == 2)
        {
            assertEquals(cond3, condition);
        }
        counter+=1;
    }        
    assertEquals(cond1, action.getActionCondition(0));
    assertEquals(cond2, action.getActionCondition(1));
    assertEquals(cond3, action.getActionCondition(2));
    
    // Check remove
    action.removeActionCondition(cond3);
    assertEquals(2, action.getActionConditions().size());
    
    // Check set
    action.setActionCondition(1, cond3);
    assertEquals(cond1, action.getActionCondition(0));
    assertEquals(cond3, action.getActionCondition(1));
    
    // Check index of
    assertEquals(0, action.indexOfActionCondition(cond1));
    assertEquals(1, action.indexOfActionCondition(cond3));
    
    // Test insert
    action.addActionCondition(1, cond2);
    assertEquals(3, action.getActionConditions().size());
    assertEquals(cond1, action.getActionCondition(0));
    assertEquals(cond2, action.getActionCondition(1));
    assertEquals(cond3, action.getActionCondition(2));
    
    // Check remote all
    action.removeAllActionConditions();
    assertFalse(action.hasActionConditions());
    assertEquals(0, action.getActionConditions().size());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:71,代码来源:ActionImplTest.java


注:本文中的org.alfresco.service.cmr.action.Action.getActionConditions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。