DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Securing Your Software Supply Chain with JFrog and Azure
Register Today

Trending

  • Revolutionizing System Testing With AI and ML
  • Database Integration Tests With Spring Boot and Testcontainers
  • Introduction to API Gateway in Microservices Architecture
  • Introduction to Domain-Driven Design

Trending

  • Revolutionizing System Testing With AI and ML
  • Database Integration Tests With Spring Boot and Testcontainers
  • Introduction to API Gateway in Microservices Architecture
  • Introduction to Domain-Driven Design

Using Pluggable HumanTask Assignment Strategy in jBPM 7

How to use pluggable HumanTask assignment strategy in jBPM7. Breaking down multiple strategies like potential owner busyness, business rules, and RoundRobin.

Abhijit Humbe user avatar by
Abhijit Humbe
·
Jul. 16, 20 · Tutorial
Like (6)
Save
Tweet
Share
2.97K Views

Join the DZone community and get the full member experience.

Join For Free

jBPM 7 release provides logic to find the best suitable user to assign the task. Multiple assignment strategies are supported in this release,

  • Potential owner busyness strategy (default)
  • Business Rules Strategy
  • RoundRobin Strategy

1. Potential Owner Busyness Strategy:

This strategy makes sure that the least loaded user from the potential owner list will be selected as task owner. To make this strategy work effectively we need to provide groups of the users.It can be done by using UserInfo configured in the environment. To load user group details we can use org.jbpm.ht.userinfo option while server startup. We can load user and group mapping from DB or from LDAP. We can load user group details from the file as well.We have to create a file with a name jbpm.user.info.properties in the application classpath.

2. Business Rules Strategy

This strategy promotes the use of rules(Drools) to select the actual owner of the task. We have to provide coordinates(G.A.V) of the project which has rules. Based on the condition defined in rule Task owner will be selected. This strategy supports dynamic updates of the rules through of KieScanner APIs. It incrementally updates kieBase once a new version of the KJAR is available.

Supported Parameters with Business Rules Strategy:

  • org.jbpm.task.assignment.rules.releaseId
    ○ required - parameter that points the GAV(GroupID:ArtifactID: Version) of the KJAR which has rules specific to task assignment.
  • org.jbpm.task.assignment.rules.scan
    ○ optional - pool interval for the scanner the configured maven repository to check the new version of KJAR. This interval should be defined in milliseconds.
  • org.jbpm.task.assignment.rules.query
    ○ optional - drools query can be used to retrieve results - if not given all assignment objects are taken from working memory.

Along with custom conditions in rules, we can use Task data for task assignment in BusinessRule strategy.  Following Human Task data we can use in business rule strategies:

  •  Potential owners of tasks
  • Task data (input variables)
  • task properties (name, description, project, priority,.. etc)

Sample rule for BusinessRule strategy look like as

rule "High priority to Admin"
    when
           Task(priority > 6, priority < 50)
    then
           System.out.println("Admin gets high priority tasks");
           insert(new Assignment("admin"));
end


rule "Assign to John if task input name is for him and potentialOwners contains john"
    when
        $task : Task()
        PeopleAssignments(potentialOwners contains new UserImpl('john')) from $task.getPeopleAssignments()
        Task(taskData.taskInputVariables['name'] == "john tasks")
    then
        System.out.println("Selecting john as task name input is john and potentialOwners contains him");
        insert(new Assignment("john"));
end

3. RoundRobin Strategy

Human tasks can now be assigned to groups and/or lists of individuals, in a round-robin manner. Updating/changing a task's list of potential owners will cause the underlying queue to be updated the next time an instance of that task is auto-assigned.

How to Use a Pluggable Task Assignment Strategy:

  • Task assignment is disabled by default and it can be enabled using below system property:

            -Dorg.jbpm.task.assignment.enabled=true

  • Define the task assignment strategy:

-Dorg.jbpm.task.assignment.strategy =PotentialOwnerBusyness/BusinessRule/RoundRobin

If we didn't provide org.jbpm.task.assignment.strategy so PotentialOwnerBusyness strategy will be used by default.

  • To  resolve group assigned to users we need to select user info implementation by using  below system property:
    -Dorg.jbpm.ht.userinfo=db/ldap

 

Task (computing)

Opinions expressed by DZone contributors are their own.

Trending

  • Revolutionizing System Testing With AI and ML
  • Database Integration Tests With Spring Boot and Testcontainers
  • Introduction to API Gateway in Microservices Architecture
  • Introduction to Domain-Driven Design

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: