03-17-2017 04:58 AM
Are aspect datetime custom properties supported for the 'set property' rule action?
We created an aspect with different properties and all show up when creating 'set property' rule actions except the d:datetime properties.
We are using Alfresco community edition.
If not supported we understand that we can create a custom action, but we want to make sure this cannot be achieved without custom coding.
03-17-2017 11:14 AM
Jeff Potts, I have the same issue for example with default effectivity aspect (in older Alfresco 201602GA), and the cm:from and cm:to properties.
Jim van Dam, try to define the rule and run a script (with Alfresco Javascript API - it is server API) saved in /Data Dictionary/Scripts/ that sets the corresponding property.
Regards.
--C.
03-17-2017 10:26 AM
Try to set property on a document, using ISO8601 format for datetimes in the Javascript Console for example.
Regards.
--C.
03-17-2017 10:47 AM
Hi Cesar, can you elaborate on that?
As we are talking about an action in a rule with the condition "a document entering a folder" I expect this to be run on the back-end and not client side. Some documents are put in folders through CMIS API.
The solution we are looking for is being able to set the datetime property as a rule action on a folder.
Regards,
Jim
03-17-2017 11:27 AM
Write a JavaScript file with something like:
document.properties['tst:datetime1'] = new Date(); // Or whatever
document.save();
That JavaScript file is then uploaded to Data Dictionary/Scripts.
Now in your folder rule, use the "execute script" action and point to the script you just uploaded.
Because it is in a rule it will be fired regardless of how the content is added to the repo, including via CMIS.
03-17-2017 10:54 AM
This looks like a bug. I have reproduced the problem on my machine with 201702-GA 5.2.0 (r135134-b14) schema 10005.
The steps to reproduce were to use the Model Manager to create a new namespace and aspect. The aspect has a single datetime property and the default layout has been applied.
Adding the aspect to documents and editing the property as normal works fine.
The problem is that when configuring a rule, the set property action shows the aspect under "Aspects" but when you click it, it offers no properties to set.
Can you please create a Jira and reference this forum thread?
03-17-2017 11:14 AM
Jeff Potts, I have the same issue for example with default effectivity aspect (in older Alfresco 201602GA), and the cm:from and cm:to properties.
Jim van Dam, try to define the rule and run a script (with Alfresco Javascript API - it is server API) saved in /Data Dictionary/Scripts/ that sets the corresponding property.
Regards.
--C.
03-17-2017 12:01 PM
Cesar Capillas thanks for the tips, I will see how quick the bug is fixed 🙂 and otherwise use your solution to proceed.
Jeff Potts thank you for reproducing. I will create a ticket for it. If bug fixes are as quickly taken up as answers to questions I would be very impressed...
Created ticket: [ALF-21884] datetime property cannot be set using 'set property' action in rule - Alfresco JIRA
Explore our Alfresco products with the links below. Use labels to filter content by product module.