Java Code Examples for org.activiti.engine.ProcessEngine#getIdentityService()

The following examples show how to use org.activiti.engine.ProcessEngine#getIdentityService() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NativeQuery.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	List<Group> groups = identityService.createNativeGroupQuery()
			.sql("SELECT * FROM ACT_ID_GROUP WHERE NAME_ = #{name}")
			.parameter("name", "Group_3").list();

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 2
Source File: SortGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	List<Group> groups = identityService.createGroupQuery()
			.orderByGroupName().desc().list();

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 3
Source File: ListPageGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	List<Group> groups = identityService.createGroupQuery().listPage(1, 5);

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 4
Source File: FieldQuery.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	List<Group> groups = identityService.createGroupQuery()
			.groupName("Group_3").groupType("TYPE_0").list();

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 5
Source File: SortMultiGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	// 先按名称降序,再按类型降序
	List<Group> groups = identityService.createGroupQuery()
			.orderByGroupName().desc().orderByGroupType().desc().list();

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 6
Source File: SaveGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
	
	IdentityService identityService = engine.getIdentityService();
	
	Random ran = new Random(10);
	for (int i = 0; i < 10; i++) {
		Group group = identityService.newGroup(String.valueOf(i));
		group.setName("Group_" + ran.nextInt(10));
		group.setType("TYPE_" + ran.nextInt(10));
		identityService.saveGroup(group);
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 7
Source File: FieldQuery.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	List<Group> groups = identityService.createGroupQuery()
			.groupName("Group_3").groupType("TYPE_0").list();

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 8
Source File: NativeQuery.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	List<Group> groups = identityService.createNativeGroupQuery()
			.sql("SELECT * FROM ACT_ID_GROUP WHERE NAME_ = #{name}")
			.parameter("name", "Group_3").list();

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 9
Source File: SaveGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
	
	IdentityService identityService = engine.getIdentityService();
	
	Random ran = new Random(10);
	for (int i = 0; i < 10; i++) {
		Group group = identityService.newGroup(String.valueOf(i));
		group.setName("Group_" + ran.nextInt(10));
		group.setType("TYPE_" + ran.nextInt(10));
		identityService.saveGroup(group);
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 10
Source File: SortGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	List<Group> groups = identityService.createGroupQuery()
			.orderByGroupName().desc().list();

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 11
Source File: ListPageGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	List<Group> groups = identityService.createGroupQuery().listPage(1, 5);

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 12
Source File: SortMultiGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 6 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();

	// 先按名称降序,再按类型降序
	List<Group> groups = identityService.createGroupQuery()
			.orderByGroupName().desc().orderByGroupType().desc().list();

	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---"
				+ group.getType());
	}

	// 关闭流程引擎
	engine.close();
}
 
Example 13
Source File: ListGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 5 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
	
	IdentityService identityService = engine.getIdentityService();
	
	List<Group> groups = identityService.createGroupQuery().list();
	
	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---" + group.getType());
	}		

	// 关闭流程引擎
	engine.close();
}
 
Example 14
Source File: SingleResult.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 5 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();
	//
	Group group = identityService.createGroupQuery().groupName("Group_5")
			.singleResult();

	System.out.println(group.getId() + "---" + group.getName() + "---"
			+ group.getType());

	// 关闭流程引擎
	engine.close();
}
 
Example 15
Source File: CountGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 5 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
	
	IdentityService identityService = engine.getIdentityService();		
	// 
	Long count = identityService.createGroupQuery().count();
	
	System.out.println(count);		

	// 关闭流程引擎
	engine.close();
}
 
Example 16
Source File: ListGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 5 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
	
	IdentityService identityService = engine.getIdentityService();
	
	List<Group> groups = identityService.createGroupQuery().list();
	
	for (Group group : groups) {
		System.out.println(group.getId() + "---" + group.getName() + "---" + group.getType());
	}		

	// 关闭流程引擎
	engine.close();
}
 
Example 17
Source File: SingleResult.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 5 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

	IdentityService identityService = engine.getIdentityService();
	//
	Group group = identityService.createGroupQuery().groupName("Group_5")
			.singleResult();

	System.out.println(group.getId() + "---" + group.getName() + "---"
			+ group.getType());

	// 关闭流程引擎
	engine.close();
}
 
Example 18
Source File: CountGroup.java    From CrazyWorkflowHandoutsActiviti6 with MIT License 5 votes vote down vote up
public static void main(String[] args) {
	// 新建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
	
	IdentityService identityService = engine.getIdentityService();		
	// 
	Long count = identityService.createGroupQuery().count();
	
	System.out.println(count);		

	// 关闭流程引擎
	engine.close();
}
 
Example 19
Source File: AbstractProcessEngineConfiguration.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public IdentityService identityServiceBean(ProcessEngine processEngine) {
  return processEngine.getIdentityService();
}
 
Example 20
Source File: ServiceSpringModuleConfig.java    From herd with Apache License 2.0 4 votes vote down vote up
@Bean
public IdentityService activitiIdentityService(ProcessEngine activitiProcessEngine) throws Exception
{
    return activitiProcessEngine.getIdentityService();
}