cancel
Showing results for 
Search instead for 
Did you mean: 

Execute a task from a job?

Former Member
0 Kudos

Hi Experts,

As i need to execute a task from a job? I have one import job in Job folder. Once finished this job, need to execute a task. Is it possible? I am trying using Exec Plugin method but task is not triggering. please help me on this.

Thanks & Regards

Shan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Did you want to do it on every user?  The easiest is to create an attribute 'trigger job' which has a create/modify event task to trigger the job you want and update that from the job.  To ensure its updated every time, use a random string or the current date/time to cause the attribute to be changed/

Peter

Former Member
0 Kudos

Thanks for your reply Peter. Yes it should trigger for every user reading from database. Below is my scenario

We are using import job to read the data (user id, business role name, ect) from database (source system) and writing it to identity store, The business role is adding to MSKEYVALUE, while passing the role name to attribute (MXREF_MX_ROLE) but here there is no check whether account is exist in target system or not. So my thought will be like below.

1)     Read the data from database and write all data to id store but not adding\writing the role name in id store (it was stored in the temp table)

2)     Take the MSKEYVALUE and check whether user id is existing in target system or not.

3)     If it exist read the business role from that temp table for relevant MSKEYVALUE and add it to MSKEYVALUE.

4)     If not exist first need to add business role (contain system privilege)  to create user id in target and read the business role from that temp table for relevant MSKEYVALUE and add it to MSKEYVALUE.

Please let me know is it possible in the event trigger task or any other idea to trigger task? Thanks once again pete.

Former Member
0 Kudos

Hi

I think you're making it to hard for yourself.

Just add the role to the user.  The role will then try and assign the privileges.  If the user doesn't have an account, it will try and set the Master Privilege and create the account.

Make sure that each privilege has the Master Privilege set (PRIV:rep.NAME:ONLY).

Have a task to assign the master privilege:

MSKEYVALUE %MSKEYVALUE%

MXREF_MX_PRIVILEGE <PRIV:$rep.NAME:ONLY>

Assign this task in the repository definition.

It should all then happen automatically.

Peter

Former Member
0 Kudos

Hi Shanmugam,

You can build the logic this way also.

1. Read the data to Identitystore and assign the role to the user.

2. Create a task and have a job under it, which will assign the PRIV:<REP.NAME>:ONLY privilage to the user. This will trigger the provisioning task defined in the repository constants.

( If no account exists in the target system, it will create the account. Else it will throw an error message. But this will not affect the process)

3. Configure the task created in step in on the member events - Add task of the role

4. Have one more job under the task created in step 2 which will then assign the role in the target system. The role that has to be assigned can be obtatined in this job in few ways. Like from PVO or from Auditing views.

Thanks,

Krishna.

Former Member
0 Kudos

Hi Peter.

Thanks for your reply. I was awany for last three days. You have mentioned need to assign task in rep definition. please let me know which task need to assign in rep definition.

Shan

Former Member
0 Kudos

You'll need to make your own task (as I described above) and then link that.  For some reason, SAP doesn't provide an 'assign master privilege' task.

Peter

Former Member
0 Kudos

Hi Pete,

Thanks for your inputs.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shanmugaraj,

You are trying it the correct way. Is there any error in the job log ? If yes, can you share the screenshot. You can also do it another way as suggested by Peter.

But I presume that you just want to trigger a task, once the execution of the job is completed irrespective of users. My test job looks like as below. i am using the script sap_core_executeplugin which triggers the task with task id 101886. and its working fine.

Try this way. let us know for any issue.

Note:

I have used MSKEY a random value since the script expects MSKEY also. You can write a custom script as per your requirement.

Former Member
0 Kudos

Hi Krishna,

Thanks for your response. I have tried the same thing what you mentioned here but mskey is not mentioned directly. Please try and let me know mskey value will generate in run time. Thanks.

Shan

Former Member
0 Kudos

Hi Shan,

MSKEY is not generated in this case, so I have hard coded it.

From your reply to peter, I understood your requirement clearly. Based on that, I would recommend you to go with the way I have suggested in my previous comment for the same post on 6th Sep. That way it will be very simple and straight forward !!

All the best !! . Let us know for anymore clarifications.

Thanks,

Krishna

Former Member
0 Kudos

Thanks Krishna for your inputs.