on 04-10-2007 11:25 AM
I want to obtain the start time and end time of each step in a job (defined in Workflow). Is there any possible way of getting this information
Hi,
This is how you can see the details:
1. Go to the "Workflows" tab in the lower part of the data manager
2. Right-click on a particular workflow
3. Select "Show History". This will tell you when what step was kicked off etc.
Regards,
Sayontan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarah,
In the MDM4J APIs there is a class called a2i.workflow.SimpleTask that has methods to get the times (the methods are called GetStartTime(), GetEndTime(), GetArrivalTime() etc.). Here is how you can leverage the APIs (code extracted from <a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/771f1a61-0e01-0010-daa9-93a52905da09">Integrating Universal Worklist in SAP Master Data Management</a>):
// how to get the WF Jobs/Tasks of a user already connected to catalog
tasks = catalog.GetWorkflowTasks(Task.ALL);
for (int i = 0; i < tasks.length; i++) {
// process a task
Task task = tasks<i>;
TaskCommand tc = catalog.GetTaskCommands(task);
if (task.GetType() == Task.JOB_TASK_TYPE) {
// task is an MDM WF Job, and the allowed
// operations on this Job are in tc
}
else if (task.GetType() == Task.SIMPLE_TASK_TYPE) {
// task is an MDM WF Task, and the allowed
// operations on this Task are in tc
}
}
Hope this helps.
Sayontan.
Hi,
The Task.ALL parameter brings all jobs and tasks over - completed or otherwise. Also, if you look at the code snippet it says Task.JOB_TASK_TYPE and Task.SIMPLE_TASK_TYPE. The Job task type is the entire workflow job and the Simple Task Type is a single task within the workflow. You can modify the code segment that I gave you:
// how to get the WF Jobs/Tasks of a user already connected to catalog
tasks = catalog.GetWorkflowTasks(Task.ALL);
for (int i = 0; i < tasks.length; i++) {
// process a task
Task task = tasks<i>;
TaskCommand tc = catalog.GetTaskCommands(task);
if (task.GetType() == Task.JOB_TASK_TYPE) {
// task is an MDM WF Job, and the allowed
// operations on this Job are in tc
}
else if (task.GetType() == Task.SIMPLE_TASK_TYPE) {
// task is an MDM WF Task, and the allowed
// operations on this Task are in tc
SimpleTask simpleTask = (SimpleTask) task;
int taskStatus = simpleTask.GetStatus();
// taskStatus gives you the status of the task.
// If it is Task.COMPLETED then you have identified a completed task.
// You can get the completion time etc. from this.
// If you want to identify the workflow job, the job id etc. associated, use this:
simpleTask.GetJob().GetID();
}
}
You could also modify the "if" part of the loop and identify completed jobs based on that.
Similar code is built into the out-of-the-box MdmUwlConnector that is provided for UWL integration for MDM.
Sayontan.
This is quite interesting.
May I know why do want to know the time taken by each process in the work flow?
Thanks,
ArunPrabhu S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.