1. Starting workflow

    Article: AN0001929Updated:

    Simple workflow start.

    OG.WorkflowSeq.Run( 'w1');

    Starting workflow with setting of properties.

    var prop = OG.CreateHashtable();
    prop.Add( 'a1', 45);
    prop.Add( 'da', new System.DateTime( 2012, 11, 24));
    OG.WorkflowSeq.Run( 'w1', prop);

    Starting workflow with reference to a record and passing record data into workflow properties.

    Where to use this script: Class rule: Rule after record saving

    //Find columns
    var colRole = OG.Column.GetByCode( OGActualDataRow, 'appl-role');
    var colRequestor = OG.Column.GetByCode( OGActualDataRow, 'requestor');
    var colRequestedFor = OG.Column.GetByCode( OGActualDataRow, 'requested-for');
    var colAccount = OG.Column.GetByCode( OGActualDataRow, 'account');

    //Set properties
    var prop = OG.CreateHashtable();
    prop.Add( 'request-id', OGActualDataRow.Id);
    prop.Add( 'role-id', OGActualDataRow.GetClassLink( colRole.Id));
    prop.Add( 'requestor-id', OGActualDataRow.GetPerson( colRequestor.Id).Id);
    prop.Add( 'requested-for', OGActualDataRow.GetPerson( colRequestedFor.Id).Id);
    prop.Add( 'account-id', OGActualDataRow.GetClassLink( colAccount.Id));

    //Run WF
    OG.WorkflowSeq.Run( 'access-request_3', prop, OGActualDataRow);