Bonita BPM - 如何让用户只查看他的小组中的任务?

时间:2016-08-09 19:42:31

标签: bpm bonita

我正在使用Bonita BPM版本:7.2.3。

我有以下组织:

<?xml version="1.0" encoding="UTF-8"?>
<organization:Organization xmlns:organization="http://documentation.bonitasoft.com/organization-xml-schema/1.1">
  <customUserInfoDefinitions/>
  <users>
    <user userName="requisitante1.dmae">
      <firstName>Requisitante1</firstName>
      <lastName>DMAE</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="requisitante2.dmae">
      <firstName>Requisitante2</firstName>
      <lastName>DMAE</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadortecnico1.dmae">
      <firstName>Aprovador Técnico 1</firstName>
      <lastName>DMAE</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadortecnico2.dmae">
      <firstName>Aprovador Técnico 2</firstName>
      <lastName>DMAE</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadorfinanceiro1.dmae">
      <firstName>Aprovador Financeiro 1</firstName>
      <lastName>DMAE</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadorfinanceiro2.dmae">
      <firstName>Aprovador Financeiro 2</firstName>
      <lastName>DMAE</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadoradministrativo.dmae">
      <firstName>Aprovador Administrativo</firstName>
      <lastName>DMAE</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadoradministrativo.smf">
      <firstName>Aprovador Administrativo</firstName>
      <lastName>SMF</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadorfinanceiro1.smf">
      <firstName>Aprovador Financeiro 1</firstName>
      <lastName>SMF</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">213</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadorfinanceiro2.smf">
      <firstName>Aprovador Financeiro 2</firstName>
      <lastName>SMF</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadortecnico1.smf">
      <firstName>Aprovador Técnico 1</firstName>
      <lastName>SMF</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="aprovadortecnico2.smf">
      <firstName>Aprovador Técnico 2</firstName>
      <lastName>SMF</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="requisitante1.smf">
      <firstName>Requisitante 1</firstName>
      <lastName>SMF</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="requisitante2.smf">
      <firstName>Requisitante 2</firstName>
      <lastName>SMF</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
    <user userName="celic">
      <firstName>CELIC</firstName>
      <lastName>CELIC</lastName>
      <manager></manager>
      <personalData/>
      <professionalData/>
      <password encrypted="false">123</password>
      <customUserInfoValues/>
    </user>
  </users>
  <roles>
    <role name="AprovadorTecnico">
      <displayName>Aprovador Técnico</displayName>
    </role>
    <role name="AprovadorFinanceiro">
      <displayName>Aprovador Financeiro</displayName>
    </role>
    <role name="AprovadorAdministrativo">
      <displayName>Aprovador Administrativo</displayName>
    </role>
    <role name="requisitante">
      <displayName>Requisitante</displayName>
    </role>
    <role name="celic">
      <displayName>CELIC</displayName>
    </role>
  </roles>
  <groups>
    <group name="CELIC">
      <displayName>CELIC</displayName>
    </group>
    <group name="DMAE" parentPath="/CELIC">
      <displayName>DMAE</displayName>
    </group>
    <group name="SMF" parentPath="/CELIC">
      <displayName>SMF</displayName>
    </group>
  </groups>
  <memberships>
    <membership>
      <userName>requisitante1.dmae</userName>
      <roleName>requisitante</roleName>
      <groupName>DMAE</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>requisitante2.dmae</userName>
      <roleName>requisitante</roleName>
      <groupName>DMAE</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadortecnico1.dmae</userName>
      <roleName>AprovadorTecnico</roleName>
      <groupName>DMAE</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadortecnico2.dmae</userName>
      <roleName>AprovadorTecnico</roleName>
      <groupName>DMAE</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadorfinanceiro1.dmae</userName>
      <roleName>AprovadorFinanceiro</roleName>
      <groupName>DMAE</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadorfinanceiro2.dmae</userName>
      <roleName>AprovadorFinanceiro</roleName>
      <groupName>DMAE</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadoradministrativo.dmae</userName>
      <roleName>AprovadorAdministrativo</roleName>
      <groupName>DMAE</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadoradministrativo.smf</userName>
      <roleName>AprovadorAdministrativo</roleName>
      <groupName>SMF</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadorfinanceiro1.smf</userName>
      <roleName>AprovadorFinanceiro</roleName>
      <groupName>SMF</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadorfinanceiro2.smf</userName>
      <roleName>AprovadorFinanceiro</roleName>
      <groupName>SMF</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadortecnico1.smf</userName>
      <roleName>AprovadorTecnico</roleName>
      <groupName>SMF</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>aprovadortecnico2.smf</userName>
      <roleName>AprovadorTecnico</roleName>
      <groupName>SMF</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>requisitante1.smf</userName>
      <roleName>requisitante</roleName>
      <groupName>SMF</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>requisitante2.smf</userName>
      <roleName>requisitante</roleName>
      <groupName>SMF</groupName>
      <groupParentPath>/CELIC</groupParentPath>
    </membership>
    <membership>
      <userName>celic</userName>
      <roleName>celic</roleName>
      <groupName>CELIC</groupName>
    </membership>
  </memberships>
</organization:Organization>

以下过程:

enter image description here

最后我将演员映射对应于车道名称(演员Requisitante是Requisitante车道的演员,角色是Requisitante等等。)

我希望只有组内的用户才能查看该组用户启动的任务(如果“SMF”中的“requisitante”启动任务,则“DMAE”组中的用户不会即使他们有相同的角色也能看到它,因为他们不属于同一个群体。)

问题在于没有发生这种情况。 我知道我可以通过使用用户过滤器解决它,但我不知道这是否是最“正确”和直接的解决方案。我认为这可能更简单。

2 个答案:

答案 0 :(得分:1)

如果我理解正确,您的任务会根据用户的角色映射到用户。您还有一个约束,具体取决于谁启动该过程。给定流程实例的任务应仅对与启动器位于同一组的用户可用。

Actor映射只能基于组织信息(即组,角色,成员资格和用户),并且不能基于流程实例信息(例如启动实例的用户)动态。

如果您需要让用户根据诸如启动流程实例的人等信息与任务相关联,则过滤器实际上是一个不错的选择。过滤器可以使用任何类型的输入信息来构建用户ID列表。当达到任务时,实际上会执行过滤器,因此可以访问诸如流程实例启动器ID(以及实例变量,外部数据......)之类的信息。

对于演员来说,实际上当用户登录Bonita BPM Portal时,基于他的会员资格引擎将找到已部署过程中定义的匹配演员。

答案 1 :(得分:0)

用户过滤器是一种解决方案,但不是最简单的。您可以(在工作室中)将角色映射到一个角色,该角色将满足您的所有要求,并且也很容易实现。 为此,您可以在工作室中配置/ actor映射(流程配置图标)并将您的actor映射到相应的角色(例如,actor requisitante映射到角色requisitante)。这样,只有具有相关角色的用户才能将任务视为待处理。