Hi! I need to create a task that requires to complete a doc, with a due date.
But that due date should be added to the calendar automatically.
Is there any way to do that?
Thanks!!
Solved! Go to Solution.
Hi! I finally found the solution:
I added this xml:
<bean id="my.activitiBeanRegistry" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" depends-on="activitiBeanRegistry">
<property name="targetObject">
<ref bean="activitiBeanRegistry" />
</property>
<property name="targetMethod" value="put" />
<property name="arguments">
<list>
<value>workflowTaskListener</value>
<ref bean="workflowTaskListener" />
</list>
</property>
</bean>
<bean id="workflowTaskListener" class="com.someco.bpmn.WorkflowTaskListener" parent="activitiCreateTaskListener"/>
</beans>
Where WorkflowTaskListener is my new Listener.
Thanks all!
There is no default way to add this.
You need some customization to add calendar entry on workflow start.
Could you give me some example for add calendar event?
I've looking how to add an event listener in the workflow but I'm not sure if it has to be javascript or java code.
Thanks!
You need to use CalendarService to add entry.
You can use server side javascript code also.
Ref : https://stackoverflow.com/questions/64459998/alfresco-calendar-event-using-server-side-javascript
Hi! Now i'm trying to add a listener implemented with java, but I can't make it work.
If I put like this:
<userTask id="alfrescoUsertask1" name="Alfresco User Task" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:activitiReviewTask"> <extensionElements> <activiti:taskListener event="create" delegateExpression="${workflowTaskListener}"/> </extensionElements> </userTask>
And I added @Component annotation to the WorkflowTaskListener class.
Also tried to define the bean in service-context.xml like this:
<bean id="workflowTaskListener" class="com.someco.bpmn.WorkflowTaskListener" />
so I have this error:
Caused by: org.activiti.engine.ActivitiException: Unknown property used in expression: ${workflowTaskListener} at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:53) at org.activiti.engine.impl.bpmn.listener.DelegateExpressionTaskListener.notify(DelegateExpressionTaskListener.java:44) at org.activiti.engine.impl.delegate.TaskListenerInvocation.invoke(TaskListenerInvocation.java:34) at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37) at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25) at org.activiti.engine.impl.persistence.entity.TaskEntity.fireEvent(TaskEntity.java:740) ... 243 more Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'workflowTaskListener' at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83) at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50) at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26) at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114) at org.activiti.engine.impl.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:33) at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37) at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25) at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:50) ... 248 more
And if I define the taskListener like this:
<userTask id="alfrescoUsertask1" name="Alfresco User Task" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="create" class="com.seco.bpmn.WorkFlowTaskListener"/>
</extensionElements>
</userTask>
It gives me an NullPointer error in the listener class because I want to autowire a Service:
public class WorkflowTaskListener implements TaskListener {
private static final Log logger = LogFactory.getLog(WorkflowTaskListener.class);
@Autowired
private CalendarService calendarService;
Aclaration: I'm working with project created with maven sdk alfresco.
Please help, I don't know what else to try.
Thanks!!
Hi! I finally found the solution:
I added this xml:
<bean id="my.activitiBeanRegistry" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" depends-on="activitiBeanRegistry">
<property name="targetObject">
<ref bean="activitiBeanRegistry" />
</property>
<property name="targetMethod" value="put" />
<property name="arguments">
<list>
<value>workflowTaskListener</value>
<ref bean="workflowTaskListener" />
</list>
</property>
</bean>
<bean id="workflowTaskListener" class="com.someco.bpmn.WorkflowTaskListener" parent="activitiCreateTaskListener"/>
</beans>
Where WorkflowTaskListener is my new Listener.
Thanks all!
About showing due dates from Tasks in your calendar—I get why that's super handy. It's like having everything in one place, right?
Yes, that is possible to create a task that requires the doc with an automatically added due date on the calendar. Many professional or project management tools are free you can easily use them, To avoid and don't miss any deadlines when you create a task it will automatically appear in your calendar. Additionally, you can utilize online resources, for example, students using nursing assignment help to solve their educational encumbrances, same as you can create tasks easily and won't miss any due dates.
Absolutely agree with you!
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.