Skip to content

Instantly share code, notes, and snippets.

@SpringBootApplication
public class MyApp {
public static void main(String[] args) {
SpringApplication.run(MyApp.class, args);
}
@Bean
public MyConfigurer myConfigurer() {
return new MyConfigurer();
@Test
public void testDynamicDeploy() throws Exception {
// 1. Build up the model from scratch
BpmnModel model = new BpmnModel();
Process process = new Process();
model.addProcess(process);
process.setId("my-process");
process.addFlowElement(createStartEvent());
process.addFlowElement(createUserTask("task1", "First task", "fred"));
@jbarrez
jbarrez / gist:d01601ef666aaf80503b
Last active February 11, 2016 16:00
TaskListener that involves everyone of the assignee group
package com.activiti.service.runtime.integration.dto;
import java.io.Serializable;
import java.util.Set;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.task.IdentityLink;
import org.activiti.engine.task.IdentityLinkType;
import org.springframework.beans.factory.annotation.Autowired;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.impl.test.PluggableActivitiTestCase;
public class QuickTest extends PluggableActivitiTestCase {
public void testDeleteReason() {
String processDefinitionId = deployOneTaskTestProcess();
String processInstanceId = runtimeService.startProcessInstanceById(processDefinitionId).getId();
assertEquals(1, taskService.createTaskQuery().count());
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.activiti.engine.impl.persistence.entity.TaskEntity">
<select id="customTaskSelect" parameterType="org.activiti.engine.impl.db.ListQueryParameterObject" resultMap="taskAndVariablesResultMap">
SELECT distinct
RES.ID_ as ID_,
public File getPathForId(BigInteger id) {
BigInteger remainder = null;
if(id.compareTo(BigInteger.ZERO) < 0) {
throw new ContentStorageException("ID cannot be negative");
}
Long[] blocks = new Long[iterationDepth];
for(int i=0; i< iterationDepth; i++) {
remainder = id.remainder(blockSize);
protected File getFileForId(String id, boolean shouldExist) {
BigInteger idValue = null;
try {
idValue = new BigInteger(id);
} catch(NumberFormatException nfe) {
throw new ContentStorageException("Illegal ID value, only positive numbers are supported: " + id, nfe);
}
File path = converter.getPathForId(idValue);
@jbarrez
jbarrez / start-repo.sh
Created October 29, 2012 16:09
Boot alfresco war with JRebel
#!/bin/bash
if [[ "$1" == "" ]] ; then
echo
echo "Missing argument 'project-name'"
echo
else
echo
PROJECTNAME=$1
echo "Project : $PROJECTNAME"
echo