Activiti, Alfresco, TimerStartEvent and Initiator

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2013 03:57 PM
[posted on Alfresco forums but got no answer: http://forums.alfresco.com/forum/developer-discussions/workflow/timerstartevent-how-set-initiator-03... ]
Hi all,
I'm new to Alfresco and Activiti and after some digging was finally able to create, deploy and redeploy advanced custom workflows created with Activiti designer plug in for eclipse.
Unfortunately I had problems working with "TimerStartEvent". The TimerEventDefiniton worked as expected, and all my workflows were created "on time". My workflow, however, had incomplete properties, and "initiator" was missing. As a consequence, the tasks won't show in MyTasks (error in JavaScript) and tasks cannot be ended (error in log).
From what I could figure, If I could set the initiator of the workflow, everything would work as expected. Please notice that I tried setting activiti:initiator on StartEvent without success.
Any advice would be appreciated.
Alfresco version is 4.2.b (since 4.2.c is giving me errors when using custom workflows)
fcteste1.bpmn
Log of error when trying to finish the task:
Javascript error on MyTasks:
Description of workflow using workflow-console (initiator is null and shouldn't)
Hi all,
I'm new to Alfresco and Activiti and after some digging was finally able to create, deploy and redeploy advanced custom workflows created with Activiti designer plug in for eclipse.
Unfortunately I had problems working with "TimerStartEvent". The TimerEventDefiniton worked as expected, and all my workflows were created "on time". My workflow, however, had incomplete properties, and "initiator" was missing. As a consequence, the tasks won't show in MyTasks (error in JavaScript) and tasks cannot be ended (error in log).
From what I could figure, If I could set the initiator of the workflow, everything would work as expected. Please notice that I tried setting activiti:initiator on StartEvent without success.
Any advice would be appreciated.
Alfresco version is 4.2.b (since 4.2.c is giving me errors when using custom workflows)
fcteste1.bpmn
<?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> <process id="fcteste1" name="fcteste1" isExecutable="true"> <startEvent id="timerstartevent1" name="Timer start" activiti:initiator="bruno"> <timerEventDefinition> <timeCycle>R5/PT1M</timeCycle> </timerEventDefinition> </startEvent> <userTask id="usertask1" name="Timer Task" activiti:assignee="bruno" activiti:candidateUsers="bruno,teste" activiti:formKey="wf:adhocTask"> <extensionElements> <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string>logger.log("Timed task created as expected");</activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> </userTask> <sequenceFlow id="flow1" sourceRef="timerstartevent1" targetRef="usertask1"></sequenceFlow> <endEvent id="endevent1" name="End"></endEvent> <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow> </process> <bpmndi:BPMNDiagram id="BPMNDiagram_fcteste1"> <bpmndi:BPMNPlane bpmnElement="fcteste1" id="BPMNPlane_fcteste1"> <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> <omgdc:Bounds height="35.0" width="35.0" x="340.0" y="280.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="timerstartevent1" id="BPMNShape_timerstartevent1"> <omgdc:Bounds height="35.0" width="35.0" x="100.0" y="280.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> <omgdc:Bounds height="55.0" width="105.0" x="180.0" y="270.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> <omgdi:waypoint x="135.0" y="297.0"></omgdi:waypoint> <omgdi:waypoint x="180.0" y="297.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> <omgdi:waypoint x="285.0" y="297.0"></omgdi:waypoint> <omgdi:waypoint x="340.0" y="297.0"></omgdi:waypoint> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram></definitions>
Log of error when trying to finish the task:
Mar 05, 2013 2:52:56 PM org.activiti.engine.impl.interceptor.CommandContext closeSEVERE: Error while closing command contextorg.activiti.engine.ActivitiException: Exception while invoking TaskListener: 02053124 Mandatory task properties have not been provided! {http://www.alfresco.org/model/bpm/1.0}package
Javascript error on MyTasks:
…["bpm_status"]),y=z.getData("owner"),v=c(z.getData("description")),l=c(q.initiator.firstName);var …Uncaught TypeError: Cannot read property 'firstName' of null
Description of workflow using workflow-console (initiator is null and shouldn't)
desc workflow activiti$840 definition: activiti$fcteste1id: activiti$840description: nullactive: truestart date: Tue Mar 05 13:25:48 UTC 2013end date: nullinitiator: nullcontext: nullpackage: null
Labels:
- Labels:
-
Archive
11 REPLIES 11
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2013 07:11 AM
No, the execution-listeners run inside the process, so no matter how the process is started (worklfowService API, rest-call, timer-start, ..) this will be called.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2014 04:37 PM
I am having the same problem. I am starting workflow instances, or should be, to different users with javascript. Can not get the Initiator attribute to a chosen user. It's always the user who runs the script/JS.
How would I use a javadelegate and a service task?
Jyri
How would I use a javadelegate and a service task?
Jyri
