How send mail to group on task assignment - camunda

I am trying to send mail to all user in a group on task assignment(in below example to the group - service). I am using the task listener but when the task is assigned by flow execution no mail is triggered to any members of the group neither the notify method in tasklistner is executed. But when the assignment is manually done to any user then the send mail code in task listener is triggered. Moreover if any user claims the task then also the mail code is triggered. Its is not getting triggered when assigned as a part of flow execution
I am using embeded forms and i deploy a war file containing the bpmn
The xml in bpmn is :
<bpmn:userTask id="serviceusertask"
camunda:formKey="embedded:app:forms/task-service.html" name="Service"
camunda:candidateGroups="service">
<bpmn:extensionElements>
<camunda:taskListener
class="com.test.project.TaskAssignmentListener" event="assignment" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_0ug32e1</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0w763dv</bpmn:outgoing>
</bpmn:userTask>
Can anyone help me to overcome this
Thanks

The "assignee" of a task is the user who is actual working in the task. This is known as "claim". So yes, the assignment-TaskListener
When you set a candidateGroup to route a task to a group of users, this is not handled by a special lifecycle event.
You can use the "#create" event to get notify when the task is created and use that to send the email.

Related

How to complete a service task using camunda rest api

I am using Camunda workflows to automate various processes. I have come across a scenario where the process is not moving from a service task. Usually, we call the task/{taskid}/complete to complete the task, but since the process is stuck on a service task, I am not able to complete that task. Can anybody help me find a way to complete the service task?
You are using a service task. That basically means "a machine should do something". The "normal" implementation is to provide code (a java Delegate or a connector endpoint) that is called by the process engine to execute this task.
The alternativ is to use the "external task" pattern. Think of external tasks as "user tasks for computers". So the process waits, tells subscribed clients that a job is to be done and waits for their completion.
I suppose your process uses the second option? (you can check in the modeler under "Implementation"). So completion can be done through the external task API, see docs.
/external-task/{id}/complete
If it is a connector then you likely will see when checking the log that retries have occurred and that the transaction rolled back. After addressing the underlying issue the service task (email) should be sent without explicitly triggering the service task and the following user task (Approval) should be created.

how to send mail automatically everyday when workflow completed successfully and also send an email when it run long

I want to receive an email when
1)The workflow will be successfully completed in time and a completion Notification will be sent to the respective person(e-mail id) or support group(distribution list) via the email task or the post-session e-mail notification in the session task.
The workflow will be continuing to run in excess of the expected time due to some issues (like network, data, etc).In such cases the “STILL RUNNING” notification will be sent to the respective person (e-mail id) or support group(distribution list) via the email task or the post-session e-mail notification in the session task.
For the scenario 1 just follow the guide linked by #rownum-highart.
For the scenario 2 use a parallel flow with a timer. Combine the two flows with Decision Task. Remember to use Treat the input links as set to OR. followed by Email Task with a condition of your session status.

Break out of loop in AWS SWF activity

I'm running permanent loop in SWF Activity. Say like a web crawler crawling a website www.example1.com. However, I don't want to wait until it finishes crawling, but at certain time I want to terminate the activity and switch it to craw website www.example2.com instead.
I have tried to use 'try-cancel', 'terminate', workflow by workflow-id. It seems like it just sends signal to SWF to indicate that the task is finished in the AWS console, but the Activity process on worker is still running.
Any solution for this?
When activity is cancelled a heartbeat call returns flag that indicates that. So your activity loop should include heartbeating code to support cancellation. See "activity heartbeat" section from "error handling" page of AWS Flow Framework for Java
Developer Guide for an example.

aws swf - get workflow execution id from within the workflow

I am using Amazon SWF service to automate some recurring tasks.
I am trying to use signals to execute some commands on remote machines. After the commands are finished executing, I'd like to send a signal back to the workflow to indicate success or failure.
The question is how can I find the workflow execution id programmatically? This is required for the remote machines to send a signal.
Thanks
Per http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/SimpleWorkflow/WorkflowExecution.html, shouldn't
your_workflow_execution_variable.run_id
get you exactly what you're looking for?

WSO2 CEP output event adaptor error

I am new to WSO2 CEP
I have created the entire flow to read the JMS message and split it using Text formatter. The problem is that when I try to push messages into the queue, it is not able to reach the the output event adaptor. I have a mysql event adaptor and configured it into my event formatter but I keep getting the below message in my log
[2014-02-13 21:20:06,347] ERROR - {ReceiverGroup} No receiver is reachable at reconnection, can't publish the events
[2014-02-13 21:20:06,352] ERROR - {AsyncDataPublisher} Reconnection failed for for tcp://localhost:7661
Can someone help me understand what is this tcp://localhost:7661 is all about
Regards
Subbu
tcp://localhost:7661 is the default port to which Thrift(WSO2 events are published). It seems a default event formatter has been created and trying to publish events to that port.
Can you check your list of event formatters and ensure that no event formatters of type WSO2Event are created. This event formatter might be automatically created if you set an exported stream to be 'pass-through' when creating the execution plan.
You can enable event tracing[1] and monitor to determine exactly upto which point the event is coming in your configured flow.
[1] http://docs.wso2.org/display/CEP300/CEP+Event+Tracer
HTH,
Lasantha