setting datetime aspect properties in rule action

cancel
Showing results for 
Search instead for 
Did you mean: 
jim_van_dam
Member II

setting datetime aspect properties in rule action

Jump to solution

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.

1 Solution

Accepted Solutions
cesarista
Customer

Re: setting datetime aspect properties in rule action

Jump to solution

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.

View solution in original post

6 Replies
cesarista
Customer

Re: setting datetime aspect properties in rule action

Jump to solution

Try to set property on a document, using ISO8601 format for datetimes in the Javascript Console for example.

Regards.

--C.

jim_van_dam
Member II

Re: setting datetime aspect properties in rule action

Jump to solution

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

jpotts
Professional

Re: setting datetime aspect properties in rule action

Jump to solution

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?

cesarista
Customer

Re: setting datetime aspect properties in rule action

Jump to solution

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.

jpotts
Professional

Re: setting datetime aspect properties in rule action

Jump to solution

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.

jim_van_dam
Member II

Re: setting datetime aspect properties in rule action

Jump to solution

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