Task assignment email GitHub example

Hi,

I’ve recently tried to run the task assignment email example on GitHub (https://github.com/camunda/camunda-bpm-examples/tree/master/usertask/task-assignment-email), unfortunately I encountered some problems with maven install (I’m using maven 3). Below is the pom.xml file as provided in the example:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.camunda.bpm.quickstart</groupId>
  <artifactId>camunda-quickstart-task-assignment-email</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>Task Assignment Email</name>

  <properties>
    <maven.compiler.source>1.6</maven.compiler.source>
    <maven.compiler.target>1.6</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <failOnMissingWebXml>false</failOnMissingWebXml>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine</artifactId>
      <version>7.6.0</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-email</artifactId>
      <version>1.2</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>1.3.171</version>
      <scope>test</scope>
    </dependency>

    <!-- redirect slf4j logging to jdk logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>1.7.12</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>camunda-bpm-nexus</id>
      <name>camunda-bpm-nexus</name>
      <url>https://app.camunda.com/nexus/content/groups/public</url>
    </repository>
  </repositories>
</project>

The error I’m getting is this:

Failed to execute goal on project camunda-quickstart-task-assignment-email: Could not resolve dependencies for project org.camunda.bpm.quickstart:camunda-quickstart-task-assignment-email:war:0.0.1-SNAPSHOT: Failed to collect dependencies at junit:junit:jar:4.8.2: Failed to read artifact descriptor for junit:junit:jar:4.8.2: Could not transfer artifact junit:junit:pom:4.8.2 from/to camunda-bpm-nexus (https://app.camunda.com/nexus/content/groups/public): Unexpected response code for CONNECT: 403 -> [Help 1]

Is there a problem with using Maven 3 with this repository? Should I try using a repository manager instead? Or is there a different issue which I’m not aware of?

Thank you!

Hi @tiberiu,

I do not think that this a problem of maven 3. Could you please try it again?

Cheers,
Roman

Hi,

are you able to access https://app.camunda.com/nexus/content/groups/public via the browser?
If not then you have maybe problems with a firewall.

Best regards,
Chris

1 Like

Hi,

Thank you for answering. Yes, it’s working in the browser.

Hi,

Instead of opening a new topic, I post here.
I use the Github example to send emails when a task is assigned. That works fine.
But in the email body we send the link to the Task item:

email.setMsg(“Please complete: http://localhost:8080/camunda/app/tasklist/default/#/task/” + taskId);

taskId seems correct but the link doesn’t take me to the specific item but just opens the Tasklist and redirect to
http://localhost:8080/camunda/app/tasklist/default/#/?searchQuery=[]&filter=bf77b5b4-6ac3-11e7-af03-00059a3c7a00&sorting=[{“sortBy”:“created”,“sortOrder”:“desc”}]
in which I cannot get where the filter comes from.

Any idea?

Thanks!

Hi,

Just to clarify, you resolved the junit dependency?

Personally I didn’t have any junit dependency issue.

Hi again,

Any idea how to get the correct link to the specific task (see my post above)?

thx

I tries this one
email.setMsg(“Please complete: http://localhost:8080/camunda/app/tasklist/default/#/?task=” + taskId);

and seems to work.

2 Likes

Hi to all,

I’ve been trying to apply the Github example (camunda-bpm-examples/TaskAssignmentListener.java at master · camunda/camunda-bpm-examples · GitHub) so as to send emails for notifying the assignees for their tasks.
After many unsuccessful efforts, I’ve tried to declare the default port number of my email provider (which is Outlook) as a String variable inside the Java class, like this

private static final String PORT = "587";

and also the line like this

email.setSmtpPort(PORT);

but I’m getting the following error inside the Java class file:

So, does anyone know please how can I declare a port number (e.x. 587) as a default variable value inside the Java class ?

Thanks a lot,
Steve