Return requestType to another workflow

Hi,
How do you pass the jobtitle attribute from the joiner event requestType variable to notify different employees.

For example, if new employee job title is “engineer”, we will notify the Engineering department head of new employees details. In order to do that, we need to return the detected jobtitle as object type (as seen in Rule editor below).

So my question is:

  1. How do we return the jobtitle as an object type?
  2. How do we pass the returned jobtitle object to another worflow for manager notification?
  3. How do we access the parameters from above to workflow that triggers to send email?

Below is just a draft overflow:


Identity newEmployee = context.getObjectByName(Identity.Class, IdentityName);

if(identity!=null){

String jobTitle = identity.getAttribute("jobTitle")
if(jobtitle.equals("engineering")){

return "engineering"
}else if(jobtite.equals("Admin")){
return "admin"
}
}

Thank you!

For the return, you can return a String (which is an Object) of the job title and you should be fine.

For future steps you can include an arg that references your workflow variable:

<Arg name="jobTitle" value="ref:jobTitle"/>

Or,

you should be able to do something in your beanshell logic like:

workflow.get("jobTitle")

Edit to add:

If you want to provide this as an input to another workflow subprocess - in your step that calls the subprocess make sure you you use the arg reference:

  <Step icon="Task" name="JobTitle step">
    <Arg name="jobTitle" value="ref:jobTitle"/>
    <Description>
      Call the standard subprocess to process emails etc
    </Description>
    <Return name="aVariable" to="aVariable"/>
    <WorkflowRef>
      <Reference class="sailpoint.object.Workflow" name="Job Title Workflow"/>
    </WorkflowRef>
    <Transition to="Next Step"/>
  </Step>

Should work - as long as your subprocess workflow has a defined as input, named jobTitle etc.