class WorkflowTestingEventHandler implements WorkflowCanceledEventHandler, WorkflowCompletedEventHandler,
WorkflowStartedEventHandler
{
}
1////////////////////////////////////////////
public void canceled(WorkflowEventArgs _workflowEventArgs)
{
// TODO: Write code to execute once the workflow is canceled.
}
///////////////
public void completed(WorkflowEventArgs _workflowEventArgs)
{
// TODO: Write code to execute once the workflow is completed.
}
///////////////////
public void started(WorkflowEventArgs _workflowEventArgs)
{
// TODO: Write code to execute once the workflow is started.
}
///////////////////////////////
class WorkflowTestingEventHandler1 implements WorkflowElementCanceledEventHandler, WorkflowElemChangeRequestedEventHandler,
WorkflowElementCompletedEventHandler, WorkflowElementReturnedEventHandler,
WorkflowElementStartedEventHandler, WorkflowElementDeniedEventHandler,
WorkflowWorkItemsCreatedEventHandler
{
}
////////////////////////////////////////2222
public void canceled(WorkflowElementEventArgs _workflowElementEventArgs)
{
// TODO: Write code to execute once the workflow is canceled.
Z_WorkflowTable::UpdateCustWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(), S3_ReqWorkflowState::NotSubmitted);
}
//////////////////////
public void changeRequested(WorkflowElementEventArgs _workflowElementEventArgs)
{
// TODO: Write code to execute once change is requested for the workflow.
}
////////////////////////////
public void completed(WorkflowElementEventArgs _workflowElementEventArgs)
{
Z_WorkflowTable z_WorkflowTable;
select forupdate z_WorkflowTable where z_WorkflowTable.RecId == _workflowElementEventArgs.parmWorkflowContext().parmRecId();
if(z_WorkflowTable.RecId)
{
z_WorkflowTable.ReqWorkflowState = S3_ReqWorkflowState::Approved;
z_WorkflowTable.write();
}
}
///////////////////////////
public void created(WorkflowWorkItemsEventArgs _workflowWorkItemsEventArgs)
{
// TODO: Write code to execute once work items are created.
}
//////////////////////////////
public void denied(WorkflowElementEventArgs _workflowElementEventArgs)
{
// TODO: Write code to execute once the workflow is denied.
Z_WorkflowTable::UpdateCustWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(), S3_ReqWorkflowState::NotSubmitted);
}
///////////////////////////
public void returned(WorkflowElementEventArgs _workflowElementEventArgs)
{
Z_WorkflowTable z_WorkflowTable;
select forupdate z_WorkflowTable where z_WorkflowTable.RecId == _workflowElementEventArgs.parmWorkflowContext().parmRecId();
if(z_WorkflowTable.RecId)
{
z_WorkflowTable.ReqWorkflowState = S3_ReqWorkflowState::Rejected;
z_WorkflowTable.write();
}
}
/////////////////////////
public void started(WorkflowElementEventArgs _workflowElementEventArgs)
{
// TODO: Write code to execute once the workflow is started.
Z_WorkflowTable::UpdateCustWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(), S3_ReqWorkflowState::Submitted);
}
void submit(Args args)
{
recId recId = args.record().RecId;
WorkflowCorrelationId workflowCorrelationId;
WorkflowTypeName workflowTypeName = workflowtypestr(WorkflowTesting);
WorkflowComment note ="";
WorkflowSubmitDialog workflowSubmitDialog;
//SPLManpowerRequisition SPLManpowerRequisition;
Z_WorkflowTable testtingtable;
workflowSubmitDialog = WorkflowSubmitDialog::construct(args.caller().getActiveWorkflowConfiguration());
workflowSubmitDialog.run();
if (workflowSubmitDialog.parmIsClosedOK())
{
recId = args.record().RecId;
testtingtable = args.record();
// Get comments from the submit to workflow dialog.
note = workflowSubmitDialog.parmWorkflowComment();
try
{
ttsbegin;
workflowCorrelationId = Workflow::activateFromWorkflowType(workflowTypeName,recId,note,NoYes::No);
testtingtable.ReqWorkflowState = S3_ReqWorkflowState::Submitted;
testtingtable.update();
// Send an Infolog message.
info("Workflow Testing is done");
ttscommit;
}
catch(exception::Error)
{
info("@SYS303438");
}
}
args.caller().updateWorkFlowControls();
}
//////////////////////////
public static void main(Args args)
{
// TODO: Write code to execute once a work item is submitted.
WorkflowTestingSubmitManager WorkflowTestingSubmitManager = new WorkflowTestingSubmitManager();
WorkflowTestingSubmitManager.submit(args);
}
No comments:
Post a Comment