package org.wsper.demo.hr; import org.wsper.demo.util; service employee { public interface employee { operation employee hire( person ) { MEP = In-Out; } operation confirm fire( employee ) { MEP = In-Out; } operation confirm retire( employee ) { MEP = In-Out; } operation confirm resign( employee ) { MEP = In-Out; } query getEmployee() ; } private interface das { operation application create(employee) : invalidEmployee(employee) { MEP = Out-In; } operation application update(invalidEmployee(employee)) : invalidEmployee(employee) { MEP = Out-In; } operation application markDelete(invalidEmployee(employee)) : invalidEmployee(employee) { MEP = Out-In; } operation application archive(invalidEmployee(employee)) : invalidEmployee(employee) { MEP = Out-In; } query invalidEmployee(employee)[] get() { MEP = Out-In; } fault invalidEmployee(invalidEmployee(employee)) { } } } instantiated task recruiter extends interviewer { public interface recruiter { operation application reviewApplication( application ) { MEP = In-Out; instantiate = true; } } } instantiated task interviewer extends employee { public interface interviewer { operation application createInterviewReport( application ) { MEP = In-Out; instantiate = true; } operation application updateInterviewReport( application ) { MEP = In-Out; } operation application submitInterviewReport( application ) { MEP = In-Out; } event applicationCanceled( application ) { MEP = In; } } } entity person { open element person { string firstName; string lastName; string middleName; date birthDate; bool alive; element location { string address1; string address2; string city; string zip; string state; string country; } } } entity employee { element employee : person { date hiringDate; bool exempt date terminationDate; } machine lifecycle { protected start state hired; protected state working; protected state onLeave; protected end state retired; protected end state fired; protected end state resigned; transition(hire,working); transition(working,onLeave); transition(onLeave,working); transition(working,resigned); transition(working,fired); transition(working,retired); transition(onLeave,retired); transition(onLeave,resigned); } }