Commit f0a61f5f authored by Brian Long's avatar Brian Long
Browse files

initial checkin

parents
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+12 −0
Original line number Diff line number Diff line
# Maven
pom.xml.versionsBackup
target

# Eclipse
.project
.classpath
.settings

# Visual Studio Code
.factorypath
.vscode

COPYING.LESSER.md

0 → 100644
+157 −0
Original line number Diff line number Diff line
### GNU LESSER GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

This version of the GNU Lesser General Public License incorporates the
terms and conditions of version 3 of the GNU General Public License,
supplemented by the additional permissions listed below.

#### 0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the
GNU General Public License.

"The Library" refers to a covered work governed by this License, other
than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

#### 1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

#### 2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

-   a) under this License, provided that you make a good faith effort
    to ensure that, in the event an Application does not supply the
    function or data, the facility still operates, and performs
    whatever part of its purpose remains meaningful, or
-   b) under the GNU GPL, with none of the additional permissions of
    this License applicable to that copy.

#### 3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from a
header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

-   a) Give prominent notice with each copy of the object code that
    the Library is used in it and that the Library and its use are
    covered by this License.
-   b) Accompany the object code with a copy of the GNU GPL and this
    license document.

#### 4. Combined Works.

You may convey a Combined Work under terms of your choice that, taken
together, effectively do not restrict modification of the portions of
the Library contained in the Combined Work and reverse engineering for
debugging such modifications, if you also do each of the following:

-   a) Give prominent notice with each copy of the Combined Work that
    the Library is used in it and that the Library and its use are
    covered by this License.
-   b) Accompany the Combined Work with a copy of the GNU GPL and this
    license document.
-   c) For a Combined Work that displays copyright notices during
    execution, include the copyright notice for the Library among
    these notices, as well as a reference directing the user to the
    copies of the GNU GPL and this license document.
-   d) Do one of the following:
    -   0) Convey the Minimal Corresponding Source under the terms of
        this License, and the Corresponding Application Code in a form
        suitable for, and under terms that permit, the user to
        recombine or relink the Application with a modified version of
        the Linked Version to produce a modified Combined Work, in the
        manner specified by section 6 of the GNU GPL for conveying
        Corresponding Source.
    -   1) Use a suitable shared library mechanism for linking with
        the Library. A suitable mechanism is one that (a) uses at run
        time a copy of the Library already present on the user's
        computer system, and (b) will operate properly with a modified
        version of the Library that is interface-compatible with the
        Linked Version.
-   e) Provide Installation Information, but only if you would
    otherwise be required to provide such information under section 6
    of the GNU GPL, and only to the extent that such information is
    necessary to install and execute a modified version of the
    Combined Work produced by recombining or relinking the Application
    with a modified version of the Linked Version. (If you use option
    4d0, the Installation Information must accompany the Minimal
    Corresponding Source and Corresponding Application Code. If you
    use option 4d1, you must provide the Installation Information in
    the manner specified by section 6 of the GNU GPL for conveying
    Corresponding Source.)

#### 5. Combined Libraries.

You may place library facilities that are a work based on the Library
side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

-   a) Accompany the combined library with a copy of the same work
    based on the Library, uncombined with any other library
    facilities, conveyed under the terms of this License.
-   b) Give prominent notice with the combined library that part of it
    is a work based on the Library, and explaining where to find the
    accompanying uncombined form of the same work.

#### 6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Library
as you received it specifies that a certain numbered version of the
GNU Lesser General Public License "or any later version" applies to
it, you have the option of following the terms and conditions either
of that published version or of any later version published by the
Free Software Foundation. If the Library as you received it does not
specify a version number of the GNU Lesser General Public License, you
may choose any version of the GNU Lesser General Public License ever
published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

COPYING.md

0 → 100644
+675 −0

File added.

Preview size limit exceeded, changes collapsed.

README.md

0 → 100644
+53 −0
Original line number Diff line number Diff line

# Timer Activiti Extension

This is an Activiti extension that implements timer retries.  [Alfresco Process Services](https://www.alfresco.com) includes the Activiti engine, so this can be considered an extension to that as well.  The only requirement is that the package 'com.inteligr8.activiti.timer' is scanned by Spring.  This is configured automatically for APS.

## Install

You can install this like any JAR extension.  It just needs to be put in the web container classpath.

## Configuration

There is nothing to configure when used in APS.  Outside of APS, you will need Spring to scan the `com.inteligr8.activiti.timer` package.  Below is a pseudocode example:

```java
@Configuration
@ComponentScan(basePackages = {
	...,
	"com.inteligr8.activiti.timer"
})
public class MyApplicationConfiguration {
}
```

## Functionality

Activiti process models support timer start activities, intermediary timers, and timer boundary event listeners.  The sections below describe how they act OOTB and how that changes with this extension.

For all timers, there are 3 different configurations that could be used.

Date
: Timer fires at a fixed date/time.  A variable may be used.

Duration
: Timer fires after a fixed period of time.  A variable may be used.

Cycle
: Timer fires routinely, waiting for a fixed period of time between triggers.

### Start Timer

A timer start model element is used to start a process at a specific time or constant repeating period.  A finite retry could be useful here, but only in very rare circumstances.  This is considered out-of-scope of this extension and any functionality around it remains how it is OOTB.  To my knowledge, the start timer supports all timer definitions.  A cycle definition is most useful and should work as expected.  For instance, a cycle definition of `R/PT30S` will run the process every 30 seconds, repeating forever.

### Intermediary Timer

An intermediary timer model element is typically used to sleep/wait for a period of time in the middle of a process.  Because of the pause, it serves as a transaction boundary too.  That means the current execution commits and after the timer expires, a new transaction commences.

OOTB, this timer supports date/duration definitions; duration definitions being very popular.  A cycle definition may make sense, but it will not work as expected.  It will act as a duration definition, no matter how you define the repeating nature.  This is where this extension comes into play.  With this extension, the attempts are tracked in a process instance variable and when the repeat count is reached, the timer will deadletter.

### Boundary Timer

A boundary timer model element is typically used to expire a task that has taken too long.  In the cases where you may be monitoring the completion of an asynchronous behavior, you may repeatedly check a status.  In these cases, the timer may expire and loop back to the same task.  And it will do this until the condition is met.  Using a duration definition will make this loop indefinitely.  Using a cycle definition will act just like a duration definition, even if you set a repeat limit.

This is where this extension comes into play.  With this extension, the attempts are tracked in a process instance variable and when the repeat count is reached, the timer will stop firing; leaving the task in its current state.

pom.xml

0 → 100644
+165 −0
Original line number Diff line number Diff line
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	
	<groupId>com.inteligr8.activiti</groupId>
	<artifactId>timer-activiti-ext</artifactId>
	<version>1.0-SNAPSHOT</version>
	<packaging>jar</packaging>
	
	<name>Timer Activiti Extension</name>
	<description>An Activiti engine extension implementing timer retry capability.</description>
	<url>https://bitbucket.org/inteligr8/timer-activiti-ext</url>

	<licenses>
		<license>
			<name>GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007</name>
			<url>https://www.gnu.org/licenses/lgpl-3.0.txt</url>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:https://bitbucket.org/inteligr8/timer-activiti-ext.git</connection>
		<developerConnection>scm:git:git@bitbucket.org:inteligr8/timer-activiti-ext.git</developerConnection>
		<url>https://bitbucket.org/inteligr8/timer-activiti-ext</url>
	</scm>
	<organization>
		<name>Inteligr8</name>
		<url>https://www.inteligr8.com</url>
	</organization>
	<developers>
		<developer>
			<id>brian.long</id>
			<name>Brian Long</name>
			<email>brian@inteligr8.com</email>
			<url>https://twitter.com/brianmlong</url>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<maven.compiler.release>11</maven.compiler.release>
		
		<spring.version>5.3.24</spring.version>
		<activiti.version>7.10.0</activiti.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.activiti</groupId>
			<artifactId>activiti-engine</artifactId>
			<version>${activiti.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>jakarta.annotation</groupId>
			<artifactId>jakarta.annotation-api</artifactId>
			<version>1.3.5</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>io.repaint.maven</groupId>
				<artifactId>tiles-maven-plugin</artifactId>
				<version>2.21</version>
				<extensions>true</extensions>
				<configuration>
					<tiles>
						<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-aps-ext-rad-tile -->
						<tile>com.inteligr8.ootbee:beedk-aps-ext-rad-tile:[1.0.3,2.0.0)</tile>
					</tiles>
				</configuration>
			</plugin>
		</plugins>
	</build>
	
	<profiles>
		<profile>
			<id>wsl-is-slow</id>
			<activation>
				<os>
					<family>windows</family>
				</os>
			</activation>
			<properties>
				<acs-platform.timeout>1200000</acs-platform.timeout>
			</properties>
		</profile>
		<profile>
			<id>ossrh-release</id>
			<properties>
				<maven.deploy.skip>true</maven.deploy.skip>
			</properties>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>source</id>
								<phase>package</phase>
								<goals><goal>jar-no-fork</goal></goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>javadoc</id>
								<phase>package</phase>
								<goals><goal>jar</goal></goals>
								<configuration>
									<show>public</show>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign</id>
								<phase>verify</phase>
								<goals><goal>sign</goal></goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.13</version>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
						<executions>
							<execution>
								<id>ossrh-deploy</id>
								<phase>deploy</phase>
								<goals><goal>deploy</goal></goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	
	<repositories>
		<repository>
			<id>alfresco-public</id>
			<url>https://artifacts.alfresco.com/nexus/content/repositories/public</url>
		</repository>
	</repositories>
</project>
Loading