New Employee Example

Use Case

The XYZ organisation requires a workflow process for engaging a new employee. The workflow's invocation signature should consist of a single XML document containing the employee details (see below for the schema). When a new employee is due to join the company, the following actions must be taken by staff in the appropriate departments:

Interfaces

Input Document Schema

The input document is a string containing an XML document that conforms to the following XML schema ( $OBE_HOME/examples/config/resources/NewEmployee.xsd):
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.xyz.com/2004/Personnel/NewHire"
xmlns:xyz="http://www.xyz.com/2004/Personnel/NewHire"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:element name="new-employee">
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="department" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="ENGINEERING"/>
<xsd:enumeration value="FINANCE"/>
<xsd:enumeration value="HR"/>
<xsd:enumeration value="IT"/>
<xsd:enumeration value="MARKETING"/>
<xsd:enumeration value="SALES"/>
<xsd:enumeration value="SUPPORT"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Applications        

obe.editDocument(IN STRING url)
obe.viewDocument(IN STRING url)

Procedures

createNetworkUser(IN STRING userName, IN STRING department, OUT STRING userID)
createEMailAccount(IN STRING userName, IN STRING userID, OUT STRING emailAddress
)
grantAccessRights(IN STRING userID, IN STRING department)

Hints

Solution

Process Model Description

New Employee workflow diagram

XPDL Process Model

<?xml version="1.0" encoding="UTF-8"?>
<Package Id="new-employee" Name="New Employee" xmlns="http://www.wfmc.org/2002/XPDL1.0" xmlns:ne="http://www.xyz.com/2004/Personnel/NewHire" xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wfmc.org/2002/XPDL1.0 http://wfmc.org/standards/docs/TC-1025_schema_10_xpdl.xsd">
<PackageHeader>
<XPDLVersion>1.0</XPDLVersion>
<Vendor>Open Business Engine</Vendor>
<Created>2004-07-25 18:14:19</Created>
</PackageHeader>
<RedefinableHeader PublicationStatus="UNDER_TEST"/>
<ConformanceClass GraphConformance="NON_BLOCKED"/>
<Script Type="text/x-xpath" Version="1.0"/>
<WorkflowProcesses>
<WorkflowProcess AccessLevel="PUBLIC" Id="new-employee" Name="New Employee">
<ProcessHeader DurationUnit="D">
<Created>2004-07-25 18:14:51</Created>
<Description>
The XYZ organisation requires a workflow to support the process of engaging a new employee.
</Description>
</ProcessHeader>
<RedefinableHeader PublicationStatus="UNDER_TEST">
<Author>Adrian Price</Author>
</RedefinableHeader>
<FormalParameters>
<FormalParameter Id="employee" Mode="IN">
<DataType>
<ExternalReference location="NewEmployee.xsd" xref="new-employee"/>
</DataType>
</FormalParameter>
</FormalParameters>
<DataFields>
<DataField Id="userId" IsArray="FALSE" Name="User ID">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</DataField>
<DataField Id="userName" IsArray="FALSE" Name="User Name">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</DataField>
<DataField Id="department" IsArray="FALSE" Name="Department">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</DataField>
<DataField Id="emailAddress" IsArray="FALSE" Name="EMail Address">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</DataField>
</DataFields>
<Participants>
<Participant Id="Finance" Name="Finance Dept.">
<ParticipantType Type="ORGANIZATIONAL_UNIT"/>
</Participant>
<Participant Id="HR" Name="Human Resources Dept.">
<ParticipantType Type="ORGANIZATIONAL_UNIT"/>
</Participant>
<Participant Id="IT" Name="Information Technology Dept.">
<ParticipantType Type="ORGANIZATIONAL_UNIT"/>
</Participant>
</Participants>
<Applications>
<Application Id="createNetworkUser" Name="Create Network User">
<Description>
Creates a network user. The userId is generated from the user name, and the temporary password
assigned is the userId.
</Description>
<FormalParameters>
<FormalParameter Id="userName" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<Description>The user's full name</Description>
</FormalParameter>
<FormalParameter Id="userId" Mode="OUT">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<Description>The generated user ID.</Description>
</FormalParameter>
</FormalParameters>
</Application>
<Application Id="createEMailAccount" Name="Create EMail Account">
<Description>Creates an EMail account</Description>
<FormalParameters>
<FormalParameter Id="userName" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<Description>The user's full name</Description>
</FormalParameter>
<FormalParameter Id="userId" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<Description>The user's ID (prepended to @xyz.com domain name)</Description>
</FormalParameter>
<FormalParameter Id="emailAddress" Mode="OUT">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
</FormalParameters>
</Application>
<Application Id="grantAccessRights" Name="Grant Access Rights">
<Description>Grants default access rights to employee, based on their department.</Description>
<FormalParameters>
<FormalParameter Id="userId" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
<FormalParameter Id="department" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
</FormalParameters>
</Application>
<Application Id="browser" Name="Web Browser">
<Description>This tool agent uses the shell file associations of the
underlying platform to invoke the appropriate editor for
the document type referred to in the supplied URI. The
URL can be that of a web application, external web site,
a file in a WebDAV document repository. Basically, any
resource that can be accessed through a URL and for
which the host browser has a protocol handler registered.</Description>
<FormalParameters>
<FormalParameter Id="url" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<Description>The URL of the document or web application to open.</Description>
</FormalParameter>
</FormalParameters>
</Application>
</Applications>
<Activities>
<Activity Id="a1" Name="Prepare office accommodation">
<Description>Prepare desk, chair, phone, etc. for the new employee.</Description>
<Implementation>
<No/>
</Implementation>
<Performer>HR</Performer>
<StartMode>
<Manual/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<Documentation>http://localhost:8080/obeexamples/new-employee/index.html#PrepareOfficeAccommodation</Documentation>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="HR"/>
<ExtendedAttribute Name="XOffset" Value="410"/>
<ExtendedAttribute Name="YOffset" Value="10"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a2" Name="Issue information pack">
<Description>Issue the information pack containing Company HR policy, benefits guide, etc.</Description>
<Implementation>
<No/>
</Implementation>
<Performer>HR</Performer>
<StartMode>
<Manual/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<Documentation>http://localhost:8080/obeexamples/new-employee/index.html#IssueInformationPack</Documentation>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="HR"/>
<ExtendedAttribute Name="XOffset" Value="410"/>
<ExtendedAttribute Name="YOffset" Value="60"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a3" Name="Book induction course">
<Description>Book the employee onto the earliest available staff induction programme.</Description>
<Implementation>
<No/>
</Implementation>
<Performer>HR</Performer>
<StartMode>
<Manual/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<Documentation>http://localhost:8080/obeexamples/new-employee/index.html#BookInductionCourse</Documentation>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="HR"/>
<ExtendedAttribute Name="XOffset" Value="410"/>
<ExtendedAttribute Name="YOffset" Value="110"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a4" Name="Configure computer">
<Description>Procure and configure the employee's computer.</Description>
<Implementation>
<No/>
</Implementation>
<Performer>IT</Performer>
<StartMode>
<Manual/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<Documentation>http://localhost:8080/obeexamples/new-employee/index.html#ConfigureComputer</Documentation>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="IT"/>
<ExtendedAttribute Name="XOffset" Value="410"/>
<ExtendedAttribute Name="YOffset" Value="160"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a5" Name="Allocate user ID">
<Description>Allocate a network user ID for the new employee.</Description>
<Implementation>
<Tool Id="createNetworkUser" Type="PROCEDURE">
<ActualParameters>
<ActualParameter>string($employee/ne:new-employee/@name)</ActualParameter>
<ActualParameter>userId</ActualParameter>
</ActualParameters>
</Tool>
</Implementation>
<StartMode>
<Automatic/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<Documentation>http://localhost:8080/obeexamples/new-employee/index.html#AllocateUserID</Documentation>
<TransitionRestrictions>
<TransitionRestriction>
<Split Type="AND">
<TransitionRefs>
<TransitionRef Id="t3"/>
<TransitionRef Id="t4"/>
<TransitionRef Id="t13"/>
<TransitionRef Id="t25"/>
<TransitionRef Id="t18"/>
</TransitionRefs>
</Split>
</TransitionRestriction>
</TransitionRestrictions>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="IT"/>
<ExtendedAttribute Name="XOffset" Value="260"/>
<ExtendedAttribute Name="YOffset" Value="80"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a6" Name="Create EMail Account">
<Description>Create an email account for the new employee.</Description>
<Implementation>
<Tool Id="createEMailAccount" Type="PROCEDURE">
<ActualParameters>
<ActualParameter>string($employee/ne:new-employee/@name)</ActualParameter>
<ActualParameter>$userId</ActualParameter>
<ActualParameter>emailAddress</ActualParameter>
</ActualParameters>
</Tool>
</Implementation>
<StartMode>
<Manual/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<Documentation>http://localhost:8080/obeexamples/new-employee/index.html#CreateEMailAccount</Documentation>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="IT"/>
<ExtendedAttribute Name="XOffset" Value="410"/>
<ExtendedAttribute Name="YOffset" Value="10"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a7" Name="Assign phone extension">
<Description>Assign a phone extension to the new employee and enter them into the Company Directory.</Description>
<Implementation>
<Tool Id="browser" Type="APPLICATION">
<ActualParameters>
<ActualParameter>concat('http://localhost:8080/obeexamples/new-employee/AssignExtension.jsp?userId=', $userId, '&amp;procInstId=', $processInstanceId)</ActualParameter>
</ActualParameters>
</Tool>
</Implementation>
<Performer>IT</Performer>
<StartMode>
<Manual/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<Documentation>http://localhost:8080/obeexamples/new-employee/index.html#AssignPhoneExtension</Documentation>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="IT"/>
<ExtendedAttribute Name="XOffset" Value="410"/>
<ExtendedAttribute Name="YOffset" Value="110"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a8" Name="Grant access rights">
<Description>Grant access rights to corporate computing resources, VPN dial-up, etc.</Description>
<Implementation>
<Tool Id="grantAccessRights" Type="PROCEDURE">
<ActualParameters>
<ActualParameter>$userId</ActualParameter>
<ActualParameter>string($employee/ne:new-employee/@department)</ActualParameter>
</ActualParameters>
</Tool>
</Implementation>
<StartMode>
<Manual/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<Documentation>http://localhost:8080/obeexamples/new-employee/index.html#GrantAccessRights</Documentation>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="IT"/>
<ExtendedAttribute Name="XOffset" Value="410"/>
<ExtendedAttribute Name="YOffset" Value="60"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a9" Name="Enter salary details">
<Description>Enter the new employee's salary into the wages system.</Description>
<Implementation>
<Tool Id="browser" Type="APPLICATION">
<ActualParameters>
<ActualParameter>concat('http://localhost:8080/obeexamples/new-employee/EnterSalary.jsp?userId=', $userId, '&amp;procInstId=', $processInstanceId)</ActualParameter>
</ActualParameters>
</Tool>
</Implementation>
<Performer>Finance</Performer>
<StartMode>
<Manual/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<Documentation>http://localhost:8080/obeexamples/new-employee/index.html#EnterSalaryDetails</Documentation>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="Finance"/>
<ExtendedAttribute Name="XOffset" Value="410"/>
<ExtendedAttribute Name="YOffset" Value="60"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a10" Name="Route">
<Route/>
<StartMode>
<Automatic/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<TransitionRestrictions>
<TransitionRestriction>
<Split Type="AND">
<TransitionRefs>
<TransitionRef Id="t12"/>
<TransitionRef Id="t6"/>
<TransitionRef Id="t7"/>
<TransitionRef Id="t8"/>
</TransitionRefs>
</Split>
</TransitionRestriction>
</TransitionRestrictions>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="HR"/>
<ExtendedAttribute Name="XOffset" Value="130"/>
<ExtendedAttribute Name="YOffset" Value="60"/>
</ExtendedAttributes>
</Activity>
<Activity Id="a12" Name="Route">
<Route/>
<StartMode>
<Automatic/>
</StartMode>
<FinishMode>
<Automatic/>
</FinishMode>
<TransitionRestrictions>
<TransitionRestriction>
<Join Type="AND"/>
</TransitionRestriction>
</TransitionRestrictions>
<ExtendedAttributes>
<ExtendedAttribute Name="ParticipantID" Value="HR"/>
<ExtendedAttribute Name="XOffset" Value="630"/>
<ExtendedAttribute Name="YOffset" Value="60"/>
</ExtendedAttributes>
</Activity>
</Activities>
<Transitions>
<Transition From="a5" Id="t3" Name="Transition" To="a6">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a5" Id="t4" Name="Transition" To="a8">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a10" Id="t6" Name="Transition" To="a1">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a10" Id="t7" Name="Transition" To="a2">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a10" Id="t8" Name="Transition" To="a3">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a10" Id="t12" Name="Transition" To="a5">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a5" Id="t13" Name="Transition" To="a7">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a4" Id="t14" Name="Transition" To="a12">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a8" Id="t16" Name="Transition" To="a12">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a7" Id="t17" Name="Transition" To="a12">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a5" Id="t18" Name="Transition" To="a9">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a9" Id="t19" Name="Transition" To="a12">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a1" Id="t20" Name="Transition" To="a12">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a2" Id="t21" Name="Transition" To="a12">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="SIMPLEROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a3" Id="t22" Name="Transition" To="a12">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a6" Id="t24" Name="Transition" To="a12">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
<Transition From="a5" Id="t25" Name="Transition" To="a4">
<ExtendedAttributes>
<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>
</ExtendedAttributes>
</Transition>
</Transitions>
<ExtendedAttributes>
<ExtendedAttribute Name="obe.Event">
<obe:Event Id="NewEmployeeHired">
<xpdl:ActualParameters>
<xpdl:ActualParameter>employee</xpdl:ActualParameter>
</xpdl:ActualParameters>
</obe:Event>
</ExtendedAttribute>
<ExtendedAttribute Name="StartOfWorkflow" Value="HR;a10;51;60;NOROUTING"/>
<ExtendedAttribute Name="EndOfWorkflow" Value="HR;a12;770;60;NOROUTING"/>
<ExtendedAttribute Name="ParticipantVisualOrder" Value="IT;Finance;HR;"/>
</ExtendedAttributes>
</WorkflowProcess>
</WorkflowProcesses>
<ExtendedAttributes>
<ExtendedAttribute Name="MadeBy" Value="JaWE"/>
<ExtendedAttribute Name="Version" Value="1.2"/>
</ExtendedAttributes>
</Package>

Solution Files

See the solution files under $OBE_HOME/examples:

Deployment and Execution

The new-employee workflow supports both manual and triggered start.
1 Mandatory, because the employee attribute appears as a <FormalParameter> of the <WorkflowProcess>, meaning that it must be assigned a value before a newly created process instance can be started.