Commit b4951171 authored by Emmanuel Duchastenier's avatar Emmanuel Duchastenier

[USER-FILTERS RELEASE] Created the tag 26840 for bonita-userfilters

parent 559fdb4b
.project
.settings
.classpath
target
TemporaryUserFilterTests.java
<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>
<parent>
<artifactId>bonita-userfilter</artifactId>
<groupId>org.bonitasoft.userfilter</groupId>
<version>6.0.0</version>
</parent>
<artifactId>bonita-userfilter-assembly</artifactId>
</project>
\ No newline at end of file
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>userfilter</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<outputDirectory>/</outputDirectory>
<directory>src/main/resources</directory>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet>
<outputDirectory>/classpath</outputDirectory>
<directory>${basedir}/target</directory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<excludes>
<exclude>org.bonitasoft*:bonita-common*</exclude>
<exclude>org.bonitasoft*:*-def</exclude>
</excludes>
<unpack>false</unpack>
<scope>runtime</scope>
<outputDirectory>/classpath</outputDirectory>
</dependencySet>
<dependencySet>
<includes>
<include>org.bonitasoft*:*-def</include>
</includes>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</unpackOptions>
<scope>runtime</scope>
<outputDirectory>/</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
\ No newline at end of file
<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>
<parent>
<artifactId>bonita-userfilter-initiator-manager</artifactId>
<groupId>org.bonitasoft.userfilter</groupId>
<version>6.0.0</version>
</parent>
<artifactId>bonita-userfilter-initiator-manager-def</artifactId>
<version>1.0.0-SNAPSHOT</version>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<definition:ConnectorDefinition xmlns:definition="http://www.bonitasoft.org/ns/connector/definition/6.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id>initiator-manager</id>
<version>1.0.0</version>
<icon>initiator-manager.png</icon>
<category id="process" icon="process.gif" />
<input name="autoAssign" type="java.lang.Boolean" mandatory="false" defaultValue="true" />
<page id="config">
<widget id="autoAssign" inputName="autoAssign" xsi:type="definition:Checkbox" />
</page>
</definition:ConnectorDefinition>
process.category=Process
connectorDefinitionLabel=Initiator manager
connectorDefinitionDescription=Manager of the initiator of the process
config.pageTitle=Configuration
config.pageDescription=Configuration of the process initiator-manager filter
connexionConfigPage.pageDescription=Choose here if you want to automatically assign the task to this actor
autoAssign.label=Assign task automatically
autoAssign.description=The task will be claimed automatically by the resolved user
#X-Generator: crowdin.net
process.category=Prozess
connectorDefinitionLabel=Initiator-Manager
connectorDefinitionDescription=Manager des Prozess-Initiators
config.pageTitle=Konfiguration
config.pageDescription=Filter f\u00fcr Manager des Prozess-Initiators konfigurieren
connexionConfigPage.pageDescription=W\u00e4hlen Sie diese Option, wenn die Aufgabe diesem Akteur automatisch zugeordnet werden soll
autoAssign.label=Aufgabe automatisch zuweisen
autoAssign.description=Die Aufgabe wird automatisch vom zugewiesenen Nutzer angefordert
#X-Generator: crowdin.net
process.category=Proceso
connectorDefinitionLabel=Gerente Iniciador
connectorDefinitionDescription=Director del iniciador del proceso
config.pageTitle=Configuraci\u00f3n
config.pageDescription=Configuraci\u00f3n del filtro de iniciador-Gerente de proceso
connexionConfigPage.pageDescription=Seleccione aqu\u00ed si desea asignar autom\u00e1ticamente la tarea para este actor
autoAssign.label=Asignar tarea autom\u00e1ticamente
autoAssign.description=La tarea ser\u00e1 reclamada autom\u00e1ticamente por el usuario adecuado
#X-Generator: crowdin.net
process.category=Processus
connectorDefinitionLabel=Manager de l'initiateur du processus
connectorDefinitionDescription=Manager de l'initiateur du processus
config.pageTitle=Configuration
config.pageDescription=Configuration du filtre pour le manager de l'initiateur du processus
connexionConfigPage.pageDescription=Choisissez ici si la t\u00e2che doit \u00eatre assign\u00e9e automatiquement \u00e0 cet acteur
autoAssign.label=Assignation automatique
autoAssign.description=La t\u00e2che sera automatiquement demand\u00e9e par l'utilisateur r\u00e9solu
#X-Generator: crowdin.net
process.category=Processo
connectorDefinitionLabel=Manager iniziatore
connectorDefinitionDescription=Responsabile dell'iniziatore del processo
config.pageTitle=Configurazione
config.pageDescription=Configurazione del filtro per l'iniziatore-manager del processo
connexionConfigPage.pageDescription=Scegli qui se vuoi assegnare automaticamente il task a questo attore
autoAssign.label=Assegna task automaticamente
autoAssign.description=Il task sar\u00e0 richiesto automaticamente dall'utente derivante
#X-Generator: crowdin.net
process.category=Processo
connectorDefinitionLabel=Respons\u00e1vel do Iniciador
connectorDefinitionDescription=Gerente do iniciador do processo
config.pageTitle=Configura\u00e7\u00e3o
config.pageDescription=Configura\u00e7\u00e3o do filtro de iniciador-gerente de processo
connexionConfigPage.pageDescription=Escolha aqui se voc\u00ea quiser atribuir automaticamente a tarefa para este ator
autoAssign.label=Atribuir tarefas automaticamente
autoAssign.description=A tarefa vai ser solicitada automaticamente pelo usu\u00e1rio designado
<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>
<parent>
<artifactId>bonita-userfilter-initiator-manager</artifactId>
<groupId>org.bonitasoft.userfilter</groupId>
<version>6.0.0</version>
</parent>
<artifactId>bonita-userfilter-initiator-manager-impl</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<artifactId>bonita-userfilter-initiator-manager-def</artifactId>
<groupId>org.bonitasoft.userfilter</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.bonitasoft.engine</groupId>
<artifactId>bonita-server</artifactId>
<version>${engine.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.bonitasoft.userfilter</groupId>
<artifactId>bonita-userfilter-assembly</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>assemble</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>userfilter-assembly</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.bonitasoft.engine</groupId>
<artifactId>bonita-home</artifactId>
<version>${engine.version}</version>
<type>zip</type>
</artifactItem>
</artifactItems>
<includes>**/*.*</includes>
<outputDirectory>${project.build.directory}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<bonita.home>${project.build.directory}/home</bonita.home>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
/**
* Copyright (C) 2012 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.userfilter.initiator.manager;
import java.util.Arrays;
import java.util.List;
import org.bonitasoft.engine.connector.ConnectorValidationException;
import org.bonitasoft.engine.exception.BonitaException;
import org.bonitasoft.engine.filter.AbstractUserFilter;
import org.bonitasoft.engine.filter.UserFilterException;
/**
* @author Baptiste Mesta
* @author Emmanuel Duchastenier
*/
public class ProcessinitiatorManagerUserFilter extends AbstractUserFilter {
@Override
public void validateInputParameters() throws ConnectorValidationException {
}
@Override
public List<Long> filter(final String actorName) throws UserFilterException {
try {
final long processInstanceId = getExecutionContext().getProcessInstanceId();
long processInitiator = getAPIAccessor().getProcessAPI().getProcessInstance(processInstanceId).getStartedBy();
return Arrays.asList(getAPIAccessor().getIdentityAPI().getUser(processInitiator).getManagerUserId());
} catch (final BonitaException e) {
throw new UserFilterException(e);
}
}
@Override
public boolean shouldAutoAssignTaskIfSingleResult() {
final Boolean autoAssignO = (Boolean) getInputParameter("autoAssign");
return autoAssignO == null ? true : autoAssignO;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<implementation:connectorImplementation xmlns:implementation="http://www.bonitasoft.org/ns/connector/implementation/6.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<definitionId>initiator-manager</definitionId>
<definitionVersion>1.0.0</definitionVersion>
<implementationClassname>org.bonitasoft.userfilter.initiator.manager.ProcessinitiatorManagerUserFilter</implementationClassname>
<implementationId>initiator-manager-impl</implementationId>
<implementationVersion>1.0.0</implementationVersion>
<jarDependencies>
<jarDependency>bonita-userfilter-initiator-manager-impl-1.0.0-SNAPSHOT.jar</jarDependency>
</jarDependencies>
</implementation:connectorImplementation>
<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>
<parent>
<artifactId>bonita-userfilter</artifactId>
<groupId>org.bonitasoft.userfilter</groupId>
<version>6.0.0</version>
</parent>
<artifactId>bonita-userfilter-initiator-manager</artifactId>
<packaging>pom</packaging>
<modules>
<module>bonita-userfilter-initiator-manager-def</module>
<module>bonita-userfilter-initiator-manager-impl</module>
</modules>
<dependencies>
<dependency>
<groupId>org.bonitasoft.engine.jndi</groupId>
<artifactId>bonita-jndi-memory</artifactId>
<version>${engine.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
<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>
<parent>
<artifactId>bonita-userfilter-initiator</artifactId>
<groupId>org.bonitasoft.userfilter</groupId>
<version>6.0.0</version>
</parent>
<artifactId>bonita-userfilter-initiator-def</artifactId>
<version>1.0.0-SNAPSHOT</version>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<definition:ConnectorDefinition xmlns:definition="http://www.bonitasoft.org/ns/connector/definition/6.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id>initiator</id>
<version>1.0.0</version>
<icon>initiator.png</icon>
<category id="process" icon="process.gif" />
<input name="autoAssign" type="java.lang.Boolean" mandatory="false" defaultValue="true" />
<page id="config">
<widget id="autoAssign" inputName="autoAssign" xsi:type="definition:Checkbox" />
</page>
</definition:ConnectorDefinition>
process.category=Process
connectorDefinitionLabel=Initiator
connectorDefinitionDescription=Initiator of the process
config.pageTitle=Configuration
config.pageDescription=Configuration of the process initiator filter
connexionConfigPage.pageDescription=Choose here if you want to automatically assign the task to this actor
autoAssign.label=automatically assign
#X-Generator: crowdin.net
process.category=Prozess
connectorDefinitionLabel=Initiator
connectorDefinitionDescription=Prozess-Initiator
config.pageTitle=Konfiguration
config.pageDescription=Filter f\u00fcr Prozess-Initiator konfigurieren
connexionConfigPage.pageDescription=W\u00e4hlen Sie diese Option, wenn die Aufgabe diesem Akteur automatisch zugeordnet werden soll
autoAssign.label=automatisch zuweisen
#X-Generator: crowdin.net
process.category=Proceso
connectorDefinitionLabel=Iniciador
connectorDefinitionDescription=Iniciador de proceso
config.pageTitle=Configuraci\u00f3n
config.pageDescription=Configuraci\u00f3n del filtro de iniciador de proceso
connexionConfigPage.pageDescription=Seleccione aqu\u00ed si desea asignar autom\u00e1ticamente la tarea para este actor
autoAssign.label=asignar autom\u00e1ticamente
#X-Generator: crowdin.net
process.category=Processus
connectorDefinitionLabel=Initiateur
connectorDefinitionDescription=Initiateur du processus
config.pageTitle=Configuration
config.pageDescription=Configuration du filtre pour l'initiateur de processus
connexionConfigPage.pageDescription=Choisissez ici si la t\u00e2che doit \u00eatre assign\u00e9e automatiquement \u00e0 cet acteur
autoAssign.label=Assigner automatiquement
#X-Generator: crowdin.net
process.category=Processo
connectorDefinitionLabel=Iniziatore
connectorDefinitionDescription=Iniziatore del processo
config.pageTitle=Configurazione
config.pageDescription=Configurazione del filtro per l'iniziatore del processo
connexionConfigPage.pageDescription=Scegli qui se vuoi assegnare automaticamente il task a questo attore
autoAssign.label=assegna automaticamente
#X-Generator: crowdin.net
process.category=Processo
connectorDefinitionLabel=Iniciador
connectorDefinitionDescription=Iniciador do processo
config.pageTitle=Configura\u00e7\u00e3o
config.pageDescription=Configura\u00e7\u00e3o do filtro de iniciador do processo
connexionConfigPage.pageDescription=Escolha aqui se voc\u00ea quiser atribuir automaticamente a tarefa para este ator
autoAssign.label=atribuir automaticamente
<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>
<parent>
<artifactId>bonita-userfilter-initiator</artifactId>
<groupId>org.bonitasoft.userfilter</groupId>
<version>6.0.0</version>
</parent>
<artifactId>bonita-userfilter-initiator-impl</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.bonitasoft.userfilter</groupId>
<artifactId>bonita-userfilter-initiator-def</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.bonitasoft.engine</groupId>
<artifactId>bonita-server</artifactId>
<version>${engine.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.bonitasoft.userfilter</groupId>
<artifactId>bonita-userfilter-assembly</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>assemble</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>userfilter-assembly</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
/**
* Copyright (C) 2012 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.userfilter.initiator;
import java.util.Arrays;
import java.util.List;
import org.bonitasoft.engine.connector.ConnectorValidationException;
import org.bonitasoft.engine.exception.BonitaException;
import org.bonitasoft.engine.filter.AbstractUserFilter;
import org.bonitasoft.engine.filter.UserFilterException;
/**
* @author Baptiste Mesta
* @author Emmanuel Duchastenier
*/
public class ProcessInitiatorUserFilter extends AbstractUserFilter {
@Override
public void validateInputParameters() throws ConnectorValidationException {
}
@Override
public List<Long> filter(final String actorName) throws UserFilterException {
try {
final long processInstanceId = getExecutionContext().getProcessInstanceId();
return Arrays.asList(getAPIAccessor().getProcessAPI().getProcessInstance(processInstanceId).getStartedBy());
} catch (final BonitaException e) {
throw new UserFilterException(e);
}
}
@Override
public boolean shouldAutoAssignTaskIfSingleResult() {
final Boolean autoAssignO = (Boolean) getInputParameter("autoAssign");
return autoAssignO == null ? true : autoAssignO;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<implementation:connectorImplementation xmlns:implementation="http://www.bonitasoft.org/ns/connector/implementation/6.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<definitionId>initiator</definitionId>
<definitionVersion>1.0.0</definitionVersion>
<implementationClassname>org.bonitasoft.userfilter.initiator.ProcessInitiatorUserFilter</implementationClassname>
<implementationId>initiator-impl</implementationId>
<implementationVersion>1.0.0</implementationVersion>
<jarDependencies>
<jarDependency>bonita-userfilter-initiator-impl-1.0.0-SNAPSHOT.jar</jarDependency>
</jarDependencies>
</implementation:connectorImplementation>
<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>
<parent>
<artifactId>bonita-userfilter</artifactId>
<groupId>org.bonitasoft.userfilter</groupId>
<version>6.0.0</version>
</parent>
<artifactId>bonita-userfilter-initiator</artifactId>
<packaging>pom</packaging>
<modules>
<module>bonita-userfilter-initiator-def</module>
<module>bonita-userfilter-initiator-impl</module>
</modules>
<dependencies>
<dependency>
<groupId>org.bonitasoft.engine.jndi</groupId>
<artifactId>bonita-jndi-memory</artifactId>
<version>${engine.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>package</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<includes>
<include>org.bonitasoft.userfilter:*</include>
</includes>
<excludes>
<exclude>org.bonitasoft.userfilter:*def</exclude>
<exclude>org.bonitasoft.userfilter:*common</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>