我在How to get Alfresco Action status中找到了这个问题和答案。
我有一个动作执行器类,它触发入站和放大器出境与出更新规则类型。 Tahir Malik告诉我们可以添加一个额外的行动(#2),我该怎么做?我没有找到如何在运行时获取动作执行器的规则类型。
P.S Rules&通过bootstrap为我添加的动作。
此致 尤金
====================================
更新
<rule:rule view:childName="rule:sampleRule">
...
<view:properties>
<rule:ruleType>
<view:values>
<view:value>inbound</view:value>
<view:value>update</view:value>
<view:value>outbound</view:value>
</view:values>
</rule:ruleType>
...
</view:properties>
<view:associations>
<rule:action>
<act:compositeaction view:childName="rule:action">
...
<view:associations>
<act:actions>
<act:action view:childName="act:actions">
<view:properties>
...
<act:definitionName>myActionBean</act:definitionName>
<act:executionActionStatus>New</act:executionActionStatus>
</view:properties>
...
</act:action>
</act:actions>
<act:conditions>
... // There is condition to check mime type of a node
</act:conditions>
</view:associations>
</act:compositeaction>
</rule:action>
</view:associations>
============================================
UPDATE2:
<view:reference view:pathref="rule:ruleFolder">
<view:associations>
<cm:contains>
<rule:rule view:childName="rule:inboundRule">
...
<view:properties>
<rule:ruleType>
<view:values>
<view:value>inbound</view:value>
</view:values>
</rule:ruleType>
...
</view:properties>
<view:associations>
<rule:action>
<act:compositeaction view:childName="rule:action">
...
<view:properties>
...
<act:definitionName>myActionBean</act:definitionName>
<act:executionActionStatus>Completed</act:executionActionStatus>
</view:properties>
<view:associations>
<act:actions>
<act:action view:childName="act:actions">
<view:properties>
...
</view:properties>
<view:associations>
<act:parameters>
<act:actionparameter view:childName="act:parameters">
<view:properties>
<act:parameterName>ruleType</act:parameterName>
<act:parameterValue>
<view:value view:datatype="d:text">inbound</view:value>
</act:parameterValue>
</view:properties>
</act:actionparameter>
</act:parameters>
</view:associations>
</act:action>
</act:actions>
<act:conditions>
<act:compositeactioncondition view:childName="act:conditions">
<view:properties>
<act:definitionName>composite-condition</act:definitionName>
<act:or>
<view:value view:datatype="d:boolean">true</view:value>
</act:or>
<act:invert>false</act:invert>
</view:properties>
<view:associations>
<act:compositeconditions>
<act:actioncondition view:childName="act:compositeconditions">
<view:properties>
<act:definitionName>compare-mime-type</act:definitionName>
<act:invert>false</act:invert>
</view:properties>
<view:associations>
<act:parameters>
<act:actionparameter view:childName="act:parameters">
<view:properties>
<act:parameterName>value</act:parameterName>
<act:parameterValue>
<view:value view:datatype="cmis:id">my-first-mimeType</view:value>
</act:parameterValue>
</view:properties>
</act:actionparameter>
</act:parameters>
</view:associations>
</act:actioncondition>
<act:actioncondition view:childName="act:compositeconditions">
<view:properties>
<act:definitionName>compare-mime-type</act:definitionName>
<act:invert>false</act:invert>
</view:properties>
<view:associations>
<act:parameters>
<act:actionparameter view:childName="act:parameters">
<view:properties>
<act:parameterName>value</act:parameterName>
<act:parameterValue>
<view:value view:datatype="cmis:id">my-second-mimeType</view:value>
</act:parameterValue>
</view:properties>
</act:actionparameter>
</act:parameters>
</view:associations>
</act:actioncondition>
</act:compositeconditions>
<act:parameters>
<act:actionparameter view:childName="act:parameters">
<view:properties>
<act:parameterName>orconditions</act:parameterName>
<act:parameterValue>
<view:value view:datatype="d:boolean">true</view:value>
</act:parameterValue>
</view:properties>
</act:actionparameter>
</act:parameters>
</view:associations>
</act:compositeactioncondition>
</act:conditions>
</view:associations>
</act:compositeaction>
</rule:action>
</view:associations>
</rule:rule>
...
</cm:contains>
</view:associations>
</view:reference>
答案 0 :(得分:0)
我可能理解你的困惑。 您需要做的是首先更改自定义Java操作。
添加这样一行:
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
String status= (String) action.getParameterValue("status");
然后你需要把一个JavaScript文件写到trigger the action,例如:
var custom = actions.create("myActionBean");
custom.parameters.status = "My New Status";
custom.execute(document);
最后,您需要配置一个触发此JavaScript的规则。
您也可以通过引导程序设置参数,但事情是您通过引导程序控制较少。使用JavaScript,您可以在运行时(新版本)修改它。
如果要在bootstrap上发送参数,请查看此引导程序文件:
/alfresco/bootstrap/transferTargetRule.xml