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


Java Action.getCompensatingAction方法代码示例

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


在下文中一共展示了Action.getCompensatingAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:ActionImpl.java

示例2: saveActionProperties

import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
/**
 * Save the action property values
 * 
 * @param actionNodeRef the action node reference
 * @param action the action
 */
private void saveActionProperties(NodeRef actionNodeRef, Action action)
{
    // Update the action property values
    Map<QName, Serializable> props = this.nodeService.getProperties(actionNodeRef);
    props.put(ActionModel.PROP_ACTION_TITLE, action.getTitle());
    props.put(ActionModel.PROP_ACTION_DESCRIPTION, action.getDescription());
    if (action.getTrackStatus() != null)
    {
        props.put(ActionModel.PROP_TRACK_STATUS, action.getTrackStatus());
    }
    props.put(ActionModel.PROP_EXECUTE_ASYNCHRONOUSLY, action.getExecuteAsychronously());
    
    props.put(ActionModel.PROP_EXECUTION_START_DATE, action.getExecutionStartDate());
    props.put(ActionModel.PROP_EXECUTION_END_DATE, action.getExecutionEndDate());
    props.put(ActionModel.PROP_EXECUTION_ACTION_STATUS, action.getExecutionStatus());
    props.put(ActionModel.PROP_EXECUTION_FAILURE_MESSAGE, action.getExecutionFailureMessage());
    
    this.nodeService.setProperties(actionNodeRef, props);

    // Update the compensating action (model should enforce the singularity
    // of this association)
    Action compensatingAction = action.getCompensatingAction();
    List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(actionNodeRef, RegexQNamePattern.MATCH_ALL,
                ActionModel.ASSOC_COMPENSATING_ACTION);
    if (assocs.size() == 0)
    {
        if (compensatingAction != null)
        {
            // Map<QName, Serializable> props2 = new HashMap<QName,
            // Serializable>(2);
            // props2.put(ActionModel.PROP_DEFINITION_NAME,
            // compensatingAction.getActionDefinitionName());
            // props2.put(ContentModel.PROP_NODE_UUID,
            // compensatingAction.getId());

            // NodeRef compensatingActionNodeRef =
            // this.nodeService.createNode(
            // / actionNodeRef,
            // ActionModel.ASSOC_COMPENSATING_ACTION,
            // ActionModel.ASSOC_COMPENSATING_ACTION,
            // ActionModel.TYPE_ACTION,
            // props2).getChildRef();

            // Create the compensating node reference
            NodeRef compensatingActionNodeRef = createActionNodeRef(compensatingAction, actionNodeRef,
                        ActionModel.ASSOC_COMPENSATING_ACTION, ActionModel.ASSOC_COMPENSATING_ACTION);
            saveActionImpl(compensatingActionNodeRef, compensatingAction);
        }
    }
    else
    {
        ChildAssociationRef assoc = assocs.get(0);
        if (compensatingAction == null)
        {
            this.nodeService.removeChild(actionNodeRef, assoc.getChildRef());
        }
        else
        {
            saveActionImpl(assoc.getChildRef(), compensatingAction);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:69,代码来源:ActionServiceImpl.java


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