Document toolboxDocument toolbox

Project util service tasks in Identity Manager

This article describes Project util service tasks in Smart ID Identity Manager. These tasks are of the type JavaDelegate and can be used in service tasks in BPMN processes by setting the bean name as delegate expression.

Since these tasks are not available in the default Identity Manager installation, you have to follow these steps:

  1. Activate the service tasks by adding their bean definitions to custom-beans.xml.
  2. Restart Tomcat so that the new bean definition will be loaded by Identity Manager.
  3. In the service task, set the delegate expression with Identity Manager Admin, after you have uploaded the processes, or edit the delegate expression directly in the BPMN definition with Nexus Activiti Designer. See Set up process.
 CheckRetryCountAction

Description

This task implements a retry mechanism within a process. This is useful, for example, when connecting to a Certificate Authority (CA) or calling a web service. After the connection fails, the task retries it several times before the process fails as a whole. The number of retries can be configured in the bean definition of the custom-beans.xml.


Bean configuration in custom-beans.properties

Example
<bean id="checkMyRetryCountTask" class="de.vps.act.processexecution.delegation.ActionBasedJavaDelegate">
   <property name="action">
       <bean parent="checkRetryCountAction">
           <property name="fieldName" value="acsRetryCount" />
           <property name="resultVariableName" value="retryCountReached" />
           <property name="retryCount" value="5" />
       </bean>
   </property>
</bean
ParameterDescription

resultVariableName

Defines the name of the variable that will be used to save the result of the retry check. The result type is boolean.
fieldName Defines the name of the variable that contains the current amount of retries.
retryCountDefines the number of retries. The value of the variable resultVariableName will evaluate to true, when the number of retires is reached.

Configuration of Service Task

To use this task set the delegate expression in your service task to the following value:

${checkMyRetryCountTask}
 
 AddValuesToProcessMapAction

Description

Use this task to add custom values to the process map. This works with primitive types like long values as well as more complex types like Strings or Dates. If one of the keys already exists in the process map, the value will be overwritten.

Bean configuration in custom-beans.properties

The example contains several possibilities to declare the key/value pairs. The simplest way is to use plain key/value pairs as strings. You also have the possibility to refer to constants within a Java class.

Task-Bean
<bean id="addMyValuesToProcessMapTask" class="de.vps.act.processexecution.delegation.ActionBasedJavaDelegate">
    <property name="action">
        <bean class="de.nexus.projectutils.action.AddValuesToProcessMapAction">
           <property name="values">
               <map>
                   <!-- Default key-value-entry -->
                   <entry key="BaseDpEmployee_FirstName" value="Martin" />
                   <!-- Key as Enum (used by config_util) -->
                   <entry key="#{T(de.nexus.config.enums.BaseDpEmployeeEnum).FIRSTNAME.fullName}" value="Martin" />
                   <!-- Value as expression -->
                   <entry key="BaseDpEmployee_Option" value="#{T(java.lang.Boolean).TRUE}"/>
                   <!-- Key and Value as constants -->
                   <entry>
                       <key><util:constant static-field="de.vps.act.processexecution.multiprocessing.MultiProcessingConstants.CANCEL_CALLED"/></key>
                       <util:constant static-field="java.lang.Boolean.TRUE"/>
                   </entry>
                   <!-- Key as expression and Value as typed value -->
                   <entry>
                       <key><util:constant static-field="de.vps.act.processexecution.multiprocessing.MultiProcessingConstants.CANCEL_CALLED"/></key>
                       <value type="java.lang.Boolean">true</value>
                   </entry>
               </map>
            </property>
        </bean>
    </property>
</bean>

Configuration of Service Task

To use this task set the delegate expression in your service task to the following value:

${addMyValuesToProcessMapTask}
 RemoveVariablesFromExecutionJavaDelegate

Description

Use this task to remove a list of values from the process map.

Bean configuration in custom-beans.properties

<bean id="removeMyVariablesFromProcessMap" class="de.vps.act.processexecution.delegation.RemoveVariablesFromExecutionJavaDelegate">
    <property name="variables">
        <util:list>
            <value>Example_FirstName</value>
            <value>Example_LastName</value>
        </util:list>
    </property>
    <property name="setToNull" value="true"/>
</bean>

If the parameter setToNull is true, the variables are set to "Null" instead of being remove from the map.

Configuration of Service Task

To use this task set the delegate expression in your service task to the following value:

${removeMyVariablesFromProcessMap}
 CheckDuplicateAction

Description

Use this task to find out if a data record already exists in a data pool. It is needed to ensure unique entries depending on specific parameters (Email, PersonelNumber, etc.).

Bean configuration in custom-beans.properties

<bean id="checkDuplicateCardNumberAction" class="de.vps.act.processexecution.delegation.ActionBasedJavaDelegate">
  <property name="action">
    <bean class="de.nexus.projectutils.action.DuplicateCheckAction">
      <property name="dataPoolSearchManager" ref="dataPoolSearchManager" />
      <property name="dataPoolName" value="DpCard" />
      <property name="resultVariableName" value="isDuplicate" />
      <property name="filterProvider">
        <bean class="de.vps.act.domain.searcharea.filterprovider.SearchFieldBasedFilterProvider">
          <property name="juelExpressionResolver" ref="juelExpressionResolver"/>
          <property name="searchFields">
            <util:list>
              <bean class="de.vps.act.domain.searcharea.SearchField" p:searchCondition="EQUALS" p:value="#{'$'}{DpCard_CardNumber}" p:dataType="STRING">
                <constructor-arg value="CardNumber"/>
              </bean>
            </util:list>
          </property>
        </bean>
      </property>
    </bean>
  </property>
</bean>
parameterdescription
dataPoolNameName of the data pool where the search shall be executed for finding a duplicates, for example "DpCard"
resultVariableNameKey of the variable where the search result , exists = true/false, shall be put into the process map, for example "isDuplicate"
filterProviderFilter provider for defining the parameters that ensure uniqueness of the entries

Configuration of Service Task

To use this task set the delegate expression in your service task to the following value:

${checkDuplicateCardNumberAction}
 GetCoreObjectIdParametrizedAction

Description

Use this task to search an object based on the entity id and write the corresponding core object id to the process map.

Bean configuration in custom-beans.properties

The bean definition is pre-configured and needs not to be added to the custom-beans.xml. Since it is a parametrized task, it's parameters can be set directly in Identity Manager Admin:

ParameterMandatoryDescription
dataPoolName-Name of the DataPool from the object that CoreObject Id should be found
resultVariableName-

Name of the variable that the CoreObject Id will be written to if at least one object was found. 

  • If no object is found then the variable won't be written.
  • If more than one object is found then the first one will be used. 

Configuration of Service Task

To use this task set the delegate expression in your service task to the following value:

${getCoreObjectIdTask}

Copyright 2024 Technology Nexus Secured Business Solutions AB. All rights reserved.
Contact Nexus | https://www.nexusgroup.com | Disclaimer | Terms & Conditions