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 Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How to Save Money Using Custom LLMs for Specific Tasks
  • Building a Skill-Based Agentic Reviewer with Claude Code: A Practical Guide Using Skills.MD, MCP Servers, Tools, and Tasks
  • Stop Using the ATM-Didn’t-Kill-Jobs Story to Reassure Developers About AI
  • AI Agents vs LLMs: Choosing the Right Tool for AI Tasks

Trending

  • FastAPI + Django in Production: Lessons From a Hybrid Stack
  • Why Enterprise AI Agents Fail: A Runtime Data Governance Pattern for Reliable Answers
  • Build Your Own Local AI QA Engineer With Docker, Ollama, LibreChat, and Playwright MCP
  • Stop Fine-Tuning Everything: A Decision Framework for Model Adaptation

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.

By 
Abhijit Humbe user avatar
Abhijit Humbe
·
Jul. 16, 20 · Tutorial
Likes (6)
Comment
Save
Tweet
Share
3.6K 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.

Related

  • How to Save Money Using Custom LLMs for Specific Tasks
  • Building a Skill-Based Agentic Reviewer with Claude Code: A Practical Guide Using Skills.MD, MCP Servers, Tools, and Tasks
  • Stop Using the ATM-Didn’t-Kill-Jobs Story to Reassure Developers About AI
  • AI Agents vs LLMs: Choosing the Right Tool for AI Tasks

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook