How to use tokens in workflows(ocm)

i want to know how to use tokens in workflows .

What do you want to know?
Tokens are variables that eventually map to either individual user names or aliases (groups of users).
The token is defined and then included in the workflow step in addition to or in place of a user or alias.
A token is a piece of idoc script that ends like this <$wfAddUser("Name", "type")$>. Name, like i mentioned above, is a user name or an alias name. Type is a string identifier; either "user" or "alias".
Because it's Idoc Script, the token can evaluate anything available in the databinder as well as execute other functions.
A very easy way of using tokens is to map a metadata field that you know will contain a user name to the "Name" parameter. The dDocAuthor field will always contain a user name. So the token might look like this: <$wfAddUser(dDocAuthor, "user")$>. When set as a workflow user, this token will route the item to the person listed as the author.
Because tokens are evaluated in workflow after the entry event (read the docco if you don't know what step events are), you can do some complex caluclations in the entry event and then pull the results into the token. For example, you might want to auto-escalate workflow content to my manger. If we presume that my manager's user name is part of my user profile, (say in a user metadata field called uManager), we can figure out who my manager is in the entry event, set my managers name into the companion file (read the docco if you don't know what this is), then pull it out in the token when the token is evaluated.
this might look something like:
--- ENTRY EVENT CODE ---
<$me=dUser$> <!-- this sets the current user to the idoc variable "me"-->
<$myManager=getValueForSpecifiedUser(me,'uManager')$> <!--this grabs the value of the uManager field for me-->
<$wfSet("manager", myManager)$><!--this creates a variable in the companion file called "manager" and sets its value to the value of the myManager variable-->
----Token Code---
<$wfAddUser(wfGet("manager"),"user")$> <!--this pulls the value of the "manager" variable out of the companion file and sets it as the token user.-->
This is only the tip of the iceberg. One token can have multiple <$wfAddUser...$> declarations. They can be conditional: <$if ..some condition$><$wfAddUser...$><$else$><$wfAddUser...$><$endif$>
Check out the workflow reference guide that is in the documentation library for more ideas.

Similar Messages

  • How to use alert in workflow

    Hi friends
      I have configured ALERT in ALRCATDEF t-code. and i have wirtten the discription of the alert there. Now i am using deadline in my workflow in the mail step i want to use this alert so that this alert will come in alert tab in portal. In ALRCATDEF t-code there is fixed recipitants but i want to get the recipitants dynamically which i have written the logic in my workflow but how to use this in workflow. Can any one guide me.
    Regards
    vijay

    Hi,
    We had a similar requirement to send a notification from the alert.
    We created the alert and called the conccurent program which will trigger the workflow.
    Below are the stepsfor the same:
    Create the event/periodic alert and give the action type as "Concurrent Program".and give the concurrent program detials as below
    Application :Human Resources
    Program Name :XX(Eg:Alert Workflow Initiation CP) (this is a plsql stored procedure type with six parameters for this program )
    Arguments:YYY(eg:"N" &person_id "&name" "&job" "&org" "&username")
    Below is the sample code to call the workflow from plsql stored procedure
    begin
    l_item_key := to_char(SYSDATE,'YYMMDDHH24MISS');
    wf_engine.CreateProcess
    (itemtype => 'IRC_WF',
    itemkey => l_item_key,
    process => 'PER_APPLICATION_PRC'
    l_mail_content := chr(10)||chr(10)||'Dear '||p_name||':'||chr(10)||chr(10)||
    'We appreciate your interest in the '||l_job||' position. A member of the Human Resources team will review your information and contact you if your skills and experience is a match for our needs at this time.'||chr(10)||chr(10)||
    'Once again, thank you for your interest in employment at XXX.'||chr(10)||chr(10)||
    'Sincerely,'||chr(10)||
    'XXX';
    wf_engine.SetItemAttrText(itemtype => 'IRC_WF',
    itemkey => l_item_key,
    aname => 'WWPER_MESG_HTML',
    avalue => l_mail_content);
    wf_engine.StartProcess
    (itemtype => 'IRC_WF',
    itemkey => l_item_key);
    COMMIT;
    end;
    Get back to me if you need further details
    Thanks,
    Anuradha
    Edited by: user10411683 on Dec 2, 2008 11:12 PM

  • How to use rule in workflow

    Hi all.
         I am new to workflow. Can you pls let me know how to use the rule in worklow .I have created a rule using the transaction PFAC. Pls provide  me some screen shots which demonstrates   hoe to use  this rule in workflow.Thanks in advance.
    Cheers,
    sami.

    Hi SAMI
    go to this pdf in SCN.All about rules.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d053fe48-6513-2b10-a59f-871923ff99d8
    Second thing workflows related question should be posted at
    SAP-Netweaver -> workflow
    Regards
    s@chin

  • How to use SAP Business Workflow along with Interactive Adobe Form

    Hi Experts,
    I am working on SAP Business Workflow since last couple of years.
    Now i have got a new Project where client wants to use SAP Business Workflow along with Interactive Adobe Form.
    I am new to Interactive Adobe Form and Portal thing and i really dont know from where to start.
    We have one central system and 2 local systems. when we do create a Material document using adobe form workflow should trigger and notification should go to group of users who can approve or reject it, once they approve it document gets created in central system and replicated to 2 local system through ALE.
    In the Local system they do extend the document to different plants, again workflow triggers and notification will go to Managers inbox for the approval.
    Once the final approval done data should go and store in SAP.
    Now here i have couple of Questions.
    1. In SAP R3 Business workflow when i execute the workitem from the inbox i do get the application screen ( i.e. MM01 MRP View ) , what is going to happen if the same case i have with Adobe form?? is it possible or do we have to design a adobe form and we will have to map the fields with backend application??
    2. Do i have to maintained 3 separate Org Structure for 3 different system or using UWL  i can manage the show
    3. Untill final submit is not done, where the application data is going to be, is there any kind of buffer that we will have to keep it or its there with XML file??
    Please help me out.
    Thanks in Advance.
    Regards,
    Manoj

    Hi Manoj,
    Welcome to ADOBE Forms related Workflow Development. Well, here are my answers.
    1) You can go for either go for ISR based development or WD development with Adobe form. In both the cases you can achieve your requirement. Yes, you will have to design the Adobe form and bind the fields to backend.
    2) Am not clear or your System landscape to advice you in these regards.
    3) Until final Submit/Approval is done, the data can be stored in WORKFLOW CONTAINERS or XML FORM(If you go for ISR based Development).
    Hope this helps.
    Regards
    <i><b>Raja Sekhar</b></i>

  • When using tokens in workflows, notify is not working

    I have created a token to add the business manager. <$wfAddUser(xvg_busconname, "user")$>
    With this, I now am thinking that whatever username is in the custom metadata fields vg_busconname will be used for my notification.
    Next, I create a workflow that makes use of this token. In the first step I add this token as a user.
    When the workflow is activated, the notification does not take place.
    If, in the same step, I remove the token, and add in an alias, that contains a user, the user is notified.
    Since this needs to work dynamically, I can not see being able to use an alias, because I do not know which user will be placed in the metadata field vg_busconname.
    I am not sure why the workflow is not working when I try to use a token instead of an alias. Am I missing something simple?
    Thanks!

    I am not sure what I did exactly to resolve this, but it is all working great now so please disregard my previous posting on this

  • How to use tags in workflows to identify mediaType ?

    Hi,
    I have installed sl server on vmware and podcastproducer works great on it. I begun to explore workflows and podcastcomposer.
    This is my first feedback :
    With 10.5, for example I use on blog server : http://myserver/groups/blog/index.rss?mediaTypeTag=ipod&howMany=500&tag=itunes to return feed with only ipod (m4v) media. In this way mediaTypeTag parameter lets me filter feed enclosures.
    With 10.6 I didn't arrive to make the same thing. I tried to add tags in publish step in podcastcomposer, but tags apply on all exports. I try to edit template.plist of workflow to add different tag on each export but it doesn't work. It seems to work only if tags are the same on each export.
    So I tried to use wiki publishing to make it work, but it seems to be impossible to publish to wiki and in the same way apply a wiki tag to the post.
    So neither with export, neither with publish parameter in a workflow I can distinguish media exin the feed. That's a big lack for me.
    Another thing. The lack of Blog server in 10.5 is posts editing. But it seems to be the same thing in SL. It is impossible to edit post date or author name in the wiki or in podcast library. Second thing how could I delete entries in podcastlibrary.
    Thanks for your help.
    Chris

    Hi,
    I have installed sl server on vmware and podcastproducer works great on it. I begun to explore workflows and podcastcomposer.
    This is my first feedback :
    With 10.5, for example I use on blog server : http://myserver/groups/blog/index.rss?mediaTypeTag=ipod&howMany=500&tag=itunes to return feed with only ipod (m4v) media. In this way mediaTypeTag parameter lets me filter feed enclosures.
    With 10.6 I didn't arrive to make the same thing. I tried to add tags in publish step in podcastcomposer, but tags apply on all exports. I try to edit template.plist of workflow to add different tag on each export but it doesn't work. It seems to work only if tags are the same on each export.
    So I tried to use wiki publishing to make it work, but it seems to be impossible to publish to wiki and in the same way apply a wiki tag to the post.
    So neither with export, neither with publish parameter in a workflow I can distinguish media exin the feed. That's a big lack for me.
    Another thing. The lack of Blog server in 10.5 is posts editing. But it seems to be the same thing in SL. It is impossible to edit post date or author name in the wiki or in podcast library. Second thing how could I delete entries in podcastlibrary.
    Thanks for your help.
    Chris

  • How to use GROUPS in WorkFlow

    Hi All,
    I'm using OraBPEL 10.1.2 for JBOSS..
    I've configured my LDAP info in the is_config.xml file in this way:
    User -> my LDAP TREE for USER
    Role -> my LDAP TREE for GROUPS
    When I start a new task (by TaskActionHandler) with any user, I see it in the worklist app, the same if I assign it to multi-user.
    But, if I assign it to a group, I can't see it.
    The TaskActionHandler doesn't return any error, so I think the conf is ok!
    Do you have any idea?
    tnx

    What I do, when I assign it to a user or group. I use the global variable of the human task to set the "systemMessageAttributes/task:textAttribute1". Then in the human task (*.task file) I specify the group or user:
    <participant name="Assigned To">
    <resource isGroup="false" type="XPATH">/task:task/task:systemMessageAttributes/task:textAttribute1</resource>
    </participant>
    and for a group:
    <participants isAdhocRoutingSupported="false">
    <participant name="Assigned To">
    <resource isGroup="true" type="XPATH">/task:task/task:systemMessageAttributes/task:textAttribute1</resource>
    </participant>
    </participants>

  • How to use loop in workflow task description

    loop doesnt work in pftc task description command line. please help

    Hi,
       Could you plse check this link 'http://mailman.mit.edu/pipermail/sap-wug/2005-February/016575.html'  to solve ur problem
    Regards,
    Rajeswari

  • How I use standar Workflow "Approve Travel Request"?

    Hi,
    I implemented in ESS the "trips and Expenses" option run correctly, but I dont know how I use(or active) workflow (when section in IMG for example)
    I found the link
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/04/928bc146f311d189470000e829fbbd/content.htm
    but I dont know web, please excuse me if  the question is beginner
    thanks for your posts and helps
    Ivan

    hi Arghadip and Any
    I reviewed the inbox in sender of the  travel request
    http://img28.imageshack.us/img28/3489/inbox.jpg
    I entered log the message and workflow
    http://img175.imageshack.us/img175/5951/workflowlogtripnoagents.jpg
    It shows message "no agents"
    http://img198.imageshack.us/img198/6858/workflowtrip.jpg
    http://img208.imageshack.us/img208/853/workflowlogtrip.jpg (View of the workflow)
    Sometime ago in my SAP system implemented the workflow "Leave Request" (implementation is succesful)
    http://img411.imageshack.us/img411/7945/workflowleave.jpg (Inbox the sender of the leave request)
    http://img514.imageshack.us/img514/8268/workflowleaveagents.jpg (the leave requests included agents)
    sometimes ago, In my sap systeme implemented the "leave request", at the beginning of the implementation required this action:
    <i><b>
    To copy the standard workflow, go to transaction PFTC.
    Select the task type u201CWorkflow templateu201D and enter the workflow number in the task number. Click on u201CCopy tasku201D.
    WS12300111
    </b></i>
    I can apply the same in my travel request? how?
    in my Agent grid in the workflow of "Travel Request" shows agent WF-batch
    http://img638.imageshack.us/img638/8432/agentswf.jpg
    In case of the "leave request" shows wf-batch and Manager (Quiroz) definided en the PPOME
    http://img532.imageshack.us/img532/4/agentswfleaverequest.jpg
    How I use the workflow template? (in my case is WS200000050)
    thanks your post and help
    Ivan

  • How to use rule and send the same email to multiple recipents

    Hi,
    My requirement is to send the workitem to the multiple recipents. one of my reiend suggest me to use the rule but i don't know how to use that .
    can any one of you suggest me how to use rule in workflow.
    Also i want to send the same email to multiple recipent .how can i do it by using the multiline variable...please advice me with example if possible..
    Note :- Is it necessary to saparate the email id with comma or i will add all the email next one another..
    Please suggest.
    Thanks in advance ,
    Anand

    Hi Anand,
    I would suggest you first follow the guidelines of the forum and a little searching. One of your questions has been asked just a few threads below.
    Regards,
    Martin

  • Using loop in workflows

    Hi All,
             Can any one help me how to use loop in workflow.
    Initially i will send workitem to agents.
    if the loop condition fails i need to send the workitem again to the agents.
    Thank you,
    Harsha

    Hi,
    Just try it. Open the workflow builder, create a new workflow and enter a loop into it. It is really straightforward. You just need to enter the condition into the loop. Basically you need to check some value in the container. Let's say you have a container element APPROVED. If it has value X, the loop will end, etc.
    Regards,
    Karri

  • HOW TO CREATE  and  USE EVENTS IN WORKFLOWS .

    HOW TO CREATE  and  USE EVENTS IN WORKFLOWS with the help of classes.
    What i am doing is..
    open se24
    event tab->event name->parameters
    method tab->method name->event handler->copy parameters
    interface tab->if_workflow->enter
    tell me what else to do step by step
    Another important thing is that HOW to use these class events to trigger the workflows.
    REPLY ASAP
    THXS IN ADVANCE

    Hi,
    Pl. see this blog...
    Raising ABAP OO events for workflow
    Regards,
    JOy.

  • How to use an infopath form field in the designer workflow

    Hi,
    I need to send an email to a person field from Infopath form. Can i access it in the workflow. If not, is there a way i can send an email on form submission from within the infopath form.
    Please help. Thank you.

    Hi Prajk,
    There are three ways of achieving it, one i will say its pretty straightforward and covers the basic of Infopath Forms Development
    1)Populate Fields From Infopath Form at the time of Publishing.
    The moment you done with your form and to publish you click FIle>Publish>SharePoint Server >Enter the Url of Site> Then Click Next twice upto a point where wizard asks "The fields listed below will be available as SharePoint Columns" ,
    Click Add, select the placeholder in myfields for Person Field , expand the "person" group field and choose "AccountId", give the name to column(this will be SharePoint List Column Name) and for function select "first" and then
    click next and Finish.
    And use this field in Designer Workflow to send email.
    2)Second way is to write VSTA based C# code on click of your  Submit action on the form and upload and activate this form on form library via Central Admin.
    3)Now other way of doing this is via Event Recievers.
    Every infopath Form is an XmL File so on ItemAdded event you can extract its content and implement email sending c# code there:-
    http://www.bizsupportonline.net/infopath2007/how-to-use-sharepoint-event-handler-object-model-submit-data-infopath-form-sharepoint-list.htm
    Mark as Answer if helped!! To be or Not to Be..The question is this only......

  • How to use Start Task Group for Workflow Interface

    Hi all,
    anyone who can tell me how to use the Interface IFWFTSKGRP (Start Task Group for Workflow Interface)?
    As far as I understood the documentation it can be used to restrict the selection of workflows that can be started in the Generic Object Services. But the question is how to implement it.
    Best regards,
    Carsten
    Edited by: Carsten Drewes on Jun 10, 2009 10:30 AM

    Hi, Carsten,
    (probably it's a bit too late to post an answer after 3 years , but I'll post it in case someone else needs it)
    You should implement GetTaskGroup method.
    The code should return id of the task group (otype TG, mantained in PFTC) that holds the list of workflow definitions.
    Here is a sample implementation. It's taken from FORMABSENC business object. It belongs to SAP demo workflow "Notification of Absence". I suppose it should be present in most systems and you can see it in action.
    begin_method gettaskgroup changing container.
    DATA: taskgroup LIKE rhobjects-object.
    *- set task group
    taskgroup = 'TG70000023'.
      *- set result
    swc_set_element container result taskgroup.
    end_method.

  • How to use LOOP(Until) step in a Workflow

    Hi,
    How to use LOOP(Until) step in a Workflow?
    What are the steps involved in using the step LOOP(Until).

    Hmmm... using it is just like using a LOOP UNTIL statement in any programming language. You get at least one loop iteration, as opposed to a WHILE loop which may give you zero iterations.
    You simply insert a node of this type in the workflow, and magically there will be a loop inside which you can insert the steps you want to execute in the loop, and by double-clicking at the end node of the loop you can enter the condition for exiting.
    What exactly is it you are having trouble understanding about the use of it?

Maybe you are looking for