CreateUser
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<TaskDefinition authType='UserAdminTask' name='Custom Create User' wstype='ProvisioningTask' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='3600' resultOption='delete' visibility='invisible' progressInterval='0'>
  <Extension>
    <WFProcess name='Custom Create User' trace='/var/idm/log/create_user.log' maxSteps='0'>
      <Variable name='user' input='true'>
        <Comments>&#xA;      A user view.  This is required.&#xA;    </Comments>
      </Variable>
      <Variable name='backgroundProvisioning' input='true'>
        <Comments>&#xA;      Set to "true" if you want provisioning to take place&#xA;      in the background.  Normally provisioning will take&#xA;      place synchronously in the foreground.  This is recognized&#xA;      by the "Provision" subprocess.&#xA;    </Comments>
      </Variable>
      <Variable name='provisioningRetryButton' value='true' input='true'>
        <Comments>&#xA;      Set to "true" to enable the inclusion of a Retry link&#xA;      in the task result if the provisioning fails.&#xA;    </Comments>
      </Variable>
      <Variable name='approvals'>
        <Comments>&#xA;      Returned from the Lighthouse Approval process.  Contains the&#xA;      approval structure.  The approvals.approved variable set if&#xA;      all approvals were successful.  This is passed into the Notify&#xA;      process later for post-provisioning notifications.&#xA;    </Comments>
      </Variable>
      <Variable name='userCreated'>
        <Comments>&#xA;      Set to "true" from the Provision workflow when the&#xA;      Lighthouse account has been created.&#xA;    </Comments>
      </Variable>
      <Variable name='sunset'>
        <Comments>&#xA;      Object containing information for registering a sunset date/time.&#xA;    </Comments>
      </Variable>
      <Variable name='error'>
        <Comments>Set in the event of unusual processing errors.</Comments>
      </Variable>
      <Variable name='costcode' input='true'>
        <Comments> profit center</Comments>
      </Variable>
      <Variable name='employeenumber' input='true'>
        <Comments> employeenumber </Comments>
      </Variable>
      <Transition to='end'>
        <Comments>&#xA;      Terminate if we encounter unusual errors (not provisioning errors).&#xA;    </Comments>
        <ref>error</ref>
      </Transition>
      <Transition to='end'>
        <Comments>&#xA;      Terminate if we encounter users without institute or employeenumber. &#xA;    </Comments>
        <or>
          <isnull>
            <ref>user.global.employeeNumber</ref>
          </isnull>
          <eq>
            <ref>user.actions_type</ref>
            <s>HV</s>
          </eq>
        </or>
      </Transition>

      <Activity id='0' name='start'>
        <Transition to='Approve'/>
        <WorkflowEditor x='48' y='101'/>
      </Activity>

      <Activity id='1' name='Rename' hidden='true'>
        <Action id='0' process='Rename Task'>
          <Argument name='name'>
            <invoke name='expand' class='com.waveset.util.VariableExpander'>
              <ref>taskNameTemplate</ref>
              <invoke name='getVariables'>
                <invoke name='getTask'>
                  <ref>WF_CONTEXT</ref>
                </invoke>
              </invoke>
            </invoke>
          </Argument>
          <Argument name='makeUnique' value='true'/>
        </Action>
        <Transition to='Approve'/>
        <WorkflowEditor x='43' y='10'/>
      </Activity>

      <Activity id='2' name='Approve'>
        <Comments>&#xA;        &#x9;Perform the standard Lighthouse organization, role, and resource&#xA;        &#x9;approval process.&#xA;        </Comments>
        <Action id='0' process='Data Transformation'>
          <Comments>Apply any defined data transformations</Comments>
          <Argument name='ruleName'>
            <ref>transforms.preApprovalRule</ref>
          </Argument>
          <Argument name='formName'>
            <ref>transforms.preApprovalForm</ref>
          </Argument>
        </Action>
        <Action id='1' process='Lighthouse Approvals'>
          <Return from='approvals' to='approvals'/>
        </Action>
        <Transition to='end'>
          <and>
            <ref>approvals</ref>
            <isFalse>
              <ref>approvals.approved</ref>
            </isFalse>
          </and>
        </Transition>
        <Transition to='Sunrise'>
          <and>
            <not>
              <isnull>
                <ref>sunrise.select</ref>
              </isnull>
            </not>
            <neq>
              <ref>sunrise.select</ref>
              <s>None</s>
            </neq>
          </and>
        </Transition>
        <Transition to='Get User Type'/>
        <WorkflowEditor x='112' y='103'/>
      </Activity>

      <Activity id='3' name='Sunrise'>
        <Action id='0' process='Sunrise Via Work Item'>
          <Argument name='sunrise' value='$(sunrise)'/>
          <Argument name='accountId' value='$(accountId)'/>
          <Argument name='error' value='$(error)'/>
          <Return from='sunrise' to='sunrise'/>
        </Action>
        <Action id='1'>
          <Condition>
            <ref>error</ref>
          </Condition>
          <ActionResult type='error'>
            <ErrorMessage severity='error'>
              <Text>Sunrise error</Text>
            </ErrorMessage>
          </ActionResult>
        </Action>
        <Transition to='end'>
          <eq>
            <ref>sunrise.status</ref>
            <s>rejected</s>
          </eq>
        </Transition>
        <Transition to='Get User Type'/>
        <WorkflowEditor x='139' y='181'/>
      </Activity>

      <Activity id='4' name='Get User Type'>
        <Transition to='Provision'>
          <or>
            <eq>
              <ref>user.waveset.organization</ref>
              <s>Top:Company:Department1</s>
            </eq>
            <eq>
              <ref>user.waveset.organization</ref>
              <s>Top:Company:Department2</s>
            </eq>
          </or>
        </Transition>
        <Transition to='ProvisionCustomer'>
          <eq>
            <ref>user.waveset.organization</ref>
            <s>Top:Company:Customer</s>
          </eq>
        </Transition>
        <WorkflowEditor x='204' y='138'/>
      </Activity>

      <Activity id='5' name='Provision'>
        <Comments>&#xA;      Perform the standard Lighthouse provisioning process.&#xA;    </Comments>
        <Action id='0' process='Data Transformation'>
          <Comments>Apply any defined data transformations</Comments>
          <Argument name='ruleName'>
            <ref>transforms.preProvisionRule</ref>
          </Argument>
          <Argument name='formName'>
            <ref>transforms.preProvisionForm</ref>
          </Argument>
        </Action>
        <Action id='1' process='Provision'>
          <Argument name='op' value='provision'/>
          <Return from='userCreated' to='userCreated'/>
        </Action>
        <Transition to='Sunset'>
          <and>
            <isTrue>
              <ref>userCreated</ref>
            </isTrue>
            <notnull>
              <ref>user.accounts[Lighthouse].contractEndDate</ref>
            </notnull>
          </and>
        </Transition>
        <Transition to='Email User'/>
        <WorkflowEditor x='342' y='152'/>
      </Activity>

      <Activity id='6' name='ProvisionCustomer'>
        <Comments>&#xA;      Perform the standard Lighthouse provisioning process.&#xA;    </Comments>
        <Action id='0' process='Data Transformation'>
          <Comments>Apply any defined data transformations</Comments>
          <Argument name='ruleName'>
            <ref>transforms.preProvisionRule</ref>
          </Argument>
          <Argument name='formName'>
            <ref>transforms.preProvisionForm</ref>
          </Argument>
        </Action>
        <Action id='1' process='Provision'>
          <Argument name='op' value='provision'/>
          <Return from='userCreated' to='userCreated'/>
        </Action>
        <Transition to='Register Sunset'>
          <and>
            <not>
              <isnull>
                <ref>sunset.select</ref>
              </isnull>
            </not>
            <neq>
              <ref>sunset.select</ref>
              <s>None</s>
            </neq>
          </and>
        </Transition>
        <Transition to='end'/>
        <WorkflowEditor x='314' y='279'/>
      </Activity>

      <Activity id='7' name='Sunset'>
        <Comments>&#xA;        &#x9;Add a sunset task between provision and notify.&#xA;        </Comments>
        <Action id='0' application='com.waveset.session.WorkflowServices'>
          <Argument name='op' value='addDeferredTask'/>
          <Argument name='name' value='$(accountId)'/>
          <Argument name='task' value='Account Expiration Notify User'/>
          <Argument name='date'>
            <block trace='true'>
              <rule name='Custom Date Math'>
                <argument name='startdate' value='$(user.accounts[Resource1].EndDate)'/>
                <argument name='format' value='yyyyMMdd'/>
                <argument name='daysToAdd'>
                  <i>-30</i>
                </argument>
              </rule>
            </block>
          </Argument>
        </Action>
        <Action id='1' application='com.waveset.session.WorkflowServices'>
          <Argument name='op' value='addDeferredTask'/>
          <Argument name='name' value='$(accountId)'/>
          <Argument name='task' value='custom.taskDefinition.accountExpirationReminder'/>
          <Argument name='date'>
            <block trace='true'>
              <rule name='Custom Date Math'>
                <argument name='startdate' value='$(user.accounts[Resource1].EndDate)'/>
                <argument name='format' value='yyyyMMdd'/>
                <argument name='daysToAdd'>
                  <i>-10</i>
                </argument>
              </rule>
            </block>
          </Argument>
        </Action>
        <Action id='2' application='com.waveset.session.WorkflowServices'>
          <Argument name='op' value='addDeferredTask'/>
          <Argument name='name' value='$(accountId)'/>
          <Argument name='task' value='Custom Lock User'/>
          <Argument name='date'>
            <block trace='true'>
              <rule name='Custom Date Math'>
                <argument name='startdate' value='$(user.accounts[Lighthouse].contractEndDate)'/>
                <argument name='daysToAdd'>
                  <i>2</i>
                </argument>
                <argument name='format' value='yyyyMMdd'/>
              </rule>
            </block>
          </Argument>
        </Action>
        <Action id='3' application='com.waveset.session.WorkflowServices'>
          <Argument name='op' value='addDeferredTask'/>
          <Argument name='name' value='$(accountId)'/>
          <Argument name='task' value='Custom Delete User'/>
          <Argument name='date'>
            <block trace='true'>
              <rule name='Custom Date Math'>
                <argument name='startdate' value='$(user.accounts[Lighthouse].contractEndDate)'/>
                <argument name='format' value='yyyyMMdd'/>
                <argument name='daysToAdd'>
                  <i>30</i>
                </argument>
              </rule>
            </block>
          </Argument>
        </Action>
        <Action id='4'>
          <Condition>
            <ref>error</ref>
          </Condition>
          <ActionResult type='error'>
            <ErrorMessage severity='error'>
              <Text>Error registering user for sunset</Text>
            </ErrorMessage>
          </ActionResult>
        </Action>
        <Transition to='Email User'/>
        <WorkflowEditor x='431' y='152'/>
      </Activity>

      <Activity id='8' name='Email User'>
        <Action id='0' application='com.waveset.provision.WorkflowServices'>
          <Comments>Send appropriate values to e-mail notification</Comments>
          <Argument name='op' value='notify'/>
          <Argument name='template' value='Account Creation Notification'/>
          <Argument name='to'>
               <ref>user.addressNotify</ref>
           </Argument>
          <Argument name='type' value='email'/>
          <Argument name='fullname' value='$(user.global.commonname)'/>
          <Argument name='password' value='$(user.password.password)'/>
          <Argument name='email' value='$(user.global.email)'/>
          <Argument name='accounttype'>
            <cond>
              <eq>
                <ref>user.global.accounttype</ref>
                <s>MT</s>
              </eq>
              <s>Identity Manager</s>
              <s>SAP</s>
            </cond>
          </Argument>
          <Argument name='institute'>
            <cond>
              <isnull>
                <ref>user.global.institute</ref>
              </isnull>
              <s>dummy</s>
              <ref>user.global.institute</ref>
            </cond>
          </Argument>
          <Argument name='accountId' value='$(user.waveset.accountId)'/>
        </Action>
        <Transition to='Notify'/>
        <WorkflowEditor x='503' y='152'/>
      </Activity>

      <Activity id='9' name='Notify'>
        <Comments>&#xA;        &#x9;Perform post-provisioning notification.  The users we need to&#xA;        &#x9;notify were calcuated by the getApprovals method and are stored&#xA;        &#x9;inside the "approvals" variable.&#xA;        </Comments>
        <Action id='0' process='Data Transformation'>
          <Comments>Apply any defined data transformations</Comments>
          <Argument name='ruleName'>
            <ref>transforms.preNotificationRule</ref>
          </Argument>
          <Argument name='formName'>
            <ref>transforms.preNotificationForm</ref>
          </Argument>
        </Action>
        <Action id='1' process='Provisioning Notification'>
        </Action>
        <Transition to='Register Sunset'>
          <and>
            <not>
              <isnull>
                <ref>sunset.select</ref>
              </isnull>
            </not>
            <neq>
              <ref>sunset.select</ref>
              <s>None</s>
            </neq>
          </and>
        </Transition>
        <Transition to='end'/>
        <WorkflowEditor x='191' y='268'/>
      </Activity>

      <Activity id='10' name='Register Sunset'>
        <Action id='0' process='Sunset'>
          <Argument name='accountId' value='$(accountId)'/>
          <Argument name='sunset' value='$(sunset)'/>
          <Argument name='error' value='$(error)'/>
        </Action>
        <Action id='1'>
          <Condition>
            <ref>error</ref>
          </Condition>
          <ActionResult type='error'>
            <ErrorMessage severity='error'>
              <Text>Error registering user for sunset</Text>
            </ErrorMessage>
          </ActionResult>
        </Action>
        <Transition to='end'/>
        <WorkflowEditor x='78' y='369'/>
      </Activity>

      <Activity id='11' name='end'>
        <WorkflowEditor x='70' y='290'/>
      </Activity>
    </WFProcess>
  </Extension>
  <MemberObjectGroups>
    <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
  </MemberObjectGroups>
  <Properties>
    <Property name='editorOriginalName' value='Custom Create User'/>
  </Properties>
</TaskDefinition>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License