İş akışlarını kod ile yönlendirebilirsiniz.
static void WorkFlowReAssign(Args _args)
{
WorkflowTrackingStatusTable trackingStatusTable;
WorkflowWorkItemTable workItemTable;
WorkflowTrackingTable trackingTable;
WorkflowTrackingCommentTable trackingCommentTable;
WorkflowTrackingArgumentTable trackingArgumentTable;
UserId newUserId = "akblt"; // Yönlendirilecek olan kişi
;
while select trackingStatusTable where trackingStatusTable.TrackingStatus == WorkflowTrackingStatus::Pending &&
trackingStatusTable.InstanceNumber == "MAA1453" // Örnek kodu
{
ttsbegin;
info(strfmt("%1 - %2", trackingStatusTable.ConfigurationName, trackingStatusTable.InstanceNumber));
select forupdate workItemTable where workItemTable.RefRecId == trackingStatusTable.ContextRecId &&
workItemTable.RefTableId == trackingStatusTable.ContextTableId &&
workItemTable.CompanyId == trackingStatusTable.ContextCompanyId &&
workItemTable.Status == WorkflowWorkItemStatus::Pending;
WorkflowWorkItem::delegateWorkItem(workItemTable.Id, newUserId, "");// birine yetki devretmek için
select forupdate trackingTable where trackingTable.WorkItemActivityInstanceId == workItemTable.ActivityId;
select forupdate trackingCommentTable where trackingCommentTable.TrackingId == trackingTable.TrackingId;
select forupdate trackingArgumentTable where trackingArgumentTable.TrackingId == trackingTable.TrackingId && trackingArgumentTable.DataType == "WorkflowUser";
info(strfmt("%1 - %2 - %3 - %4", workItemTable.UserId, workItemTable.Subject, workItemTable.Description, workItemTable.SubWorkflowId));
ttscommit;
}
}
Hiç yorum yok:
Yorum Gönder