Groups Task (group) Activiti the role of a workflow
1.
/** in the middle of the deployment process definition and initiation process instance, set up the group task of the person, to the Activiti table storage Group and user information * *
identityservice Identityservice = Processengine.getidentityservice ()///Authentication: Save group and user information
Identityservice.savegroup (New groupentity ("department manager")/set up group
Identityservice.savegroup (New Groupentity ("General manager"))//Set up Group
Identityservice.saveuser (New Userentity ("Xiao Zhang") //Create User
Identityservice.saveuser (new Userentity ("Xiao Li"));//create User
Identityservice.saveuser (new Userentity (" Xiao Wang ")); Establish user
identityservice.createmembership ("Xiao Zhang", "department manager")//Establish group and user relationship
identityservice.createmembership ("Xiao Li", "Department manager")//Establish group and user relationship
identityservice.createmembership ("Xiao Wang", "General manager"); Establish group and user relationships
2.
Table Structure Introduction
act_id_group: Role Group table
act_id_user: User table:
act_id_membership: User Role table
Specify group task handling person
String userId = " Xiao Zhang "//small Zhang, Xiao Li can query the results, Xiao Wang can not, because he is not a department manager role
list<task> List = Processengine.gettaskservice ()//
. Createtaskquery ()//
. Taskcandidateuser (userId)//Specify Group Task query
. List ();