Quantcast
Channel: SCN: Message List - SAP Business Process Automation by Redwood
Viewing all 2607 articles
Browse latest View live

Parent job

$
0
0

Hi,

 

I am trying to mark the parent chain to status completed using the post running action. But not able to find the correct method. Advise please.

 

JobDefinition aJobDef = jcsSession.getJobDefinitionByName(jcsJob.getParentJob().getParentJob().getJobDefinition().getName());

 

aJobDef.setFinalStatus(JobStatus.Completed);

 

Thanks,

Chandu


Re: Parent job

$
0
0

Hi Chandu,

 

A minor mistake, here:

 

Job != Job Definition, Job Definition does not have a final state. You need to get a job instead.

 

Try this:

 

Job aJob = jcsJob.getParentJob().getParentJob();

aJob.setFinalStatus(JobStatus.Completed);

 

Regards,

 

HP

Re: Parent job

$
0
0

Note that this cannot be done. The parent job should figure this out himself.

 

Regards Gerben

Alerting on Submit Frames or Time Window Changes

$
0
0

Hello,

 

Wondering if there is any options, that can be setup on a job or Job chain or run some type of report, to alert you if a submit frame or time window you have setup on a job, gets changed by someone or the system? We have found a few jobs that one was running on a submit frame every 5 minutes, but was changed to every 4 hours. We finally found the cause and corrected it, but was not sure if something can be setup, to be alerted sooner, if a submit frame happens to gets changed at that time. Thanks for any words on this topic.

 

Regards

Rick

Re: Alerting on Submit Frames or Time Window Changes

$
0
0

There is no alerting out of the box for changes done on objects other than job and process server statuses.

 

However, if you have the auditing module, you can setup a daily or weekly report to review the changes.

 

 

thanks

Nanda

Re: Credentials how to get clear pasword

$
0
0

Hi Miguel,

 

Regarding option 2, it is possible to store values in a table using the below code example.

 

This assumes you have created a table in Cronacle called CREDENTIALS on the Global partition. You can use table definition 'System_Variables_Definition' to create it.

 

{

  Partition part = jcsSession.getPartitionByName("GLOBAL");

  Table table = jcsSession.getTableByName(part, "CREDENTIALS");

 

TableValue value1 = table.createTableValue();

  value1.setKey("JOHNDOE");

  value1.setColumnName("SystemValue");

  value1.setColumnValue("your_encrypted_password_string");

 

  jcsSession.persist();

}

 

This creates a record in table CREDENTIALS like below.

 

KeySystemValue
JOHNDOE your_encrypted_password_string

 

Replace the password string in the code with the outcome of you custom crypto function.

 

You can retrieve the value from the table like this.


{

  Partition part = jcsSession.getPartitionByName("GLOBAL");

  Table table = jcsSession.getTableByName(part, "CREDENTIALS");

 

  TableValue value = table.getTableValueBySearchKeySearchColumnName("JOHNDOE", "SystemValue");

  String encryptedpassword = value.getColumnValue();

}

 

 

It is also possible to create a jobdefinition parameter called 'password', and set the parameter options to 'Password'.

Whenever you submit the jobdefinition, Cronacle will ** star out the plain text password during entry, and when viewing the jobs parameters via the monitor. However you can still retrieve the parameter's plain text value in redwood script.

Re: Parent job

$
0
0

Hi HP,

 

When I am trying to save the code, I get the below error.

 

Caused by: com.redwood.scheduler.persistence.impl.MultipleCauseException: JCS-MULTI: Modification vetoed: JCS-102183: Compile failed for Job definition FI_E538_ECC_LIHEAP_PAYMENT_ROLL action (type=Post Running): FI_E538_ECC_LIHEAP_PAYMENT_ROLL.java:user code 18:4:cannot find symbol symbol  : method setFinalStatus(com.redwood.scheduler.api.model.enumeration.JobStatus) location: interface com.redwood.scheduler.api.model.Job aJob.setFinalStatus(JobStatus.Completed);

 

 

Gerben, We are trying to mark the parent chain completed, if a string is found in the job log of the job stopping the chain to proceed further.

 

 

Regards,

Chandu

 

Message was edited by: Chandu Bomma

Re: Parent job

$
0
0

Hi Chanda,

 

The message is the system telling you the same I did: this is not possible. And there are some reasons for that. Each job can only set it's OWN status before it is in an end status, after that, the job becomes unmodifiable. For all kinds of audit reasons, that is the most straightforward method.

 

If you want to stop you chain when you find a certain string in an output file you set the current job to Error (jcsPostRunningContext.setFinalStatus(JobStatus.Error)) and let the chain handle the error. By Default the chain will error out. If you want to Complete it, set the final status handler to finish the chain correctly.

 

Regards Gerben


Re: Parent job

$
0
0

Hi Chandu,

 

Yes, I did not really "think about" the actual problem, just, JobStatus of JobDefinition, makes no sense ...

 

As Gerben pointed out, you cannot simply set a chain to Completed. The setFinalStatus is only relevant for the current process (the one of which the postrunning action is running).

 

Regards,

 

HP

Re: Alerting on Submit Frames or Time Window Changes

$
0
0

Hi Nanda Kumar,

   

Good Evening,

    

     I am working in chennai.

     I am new to this SAP redwood world, need to know lot of things about redwood.

     if we had chat I could explain my situation actually what i am facing in my office.

     Would you please help to clear my doubts, that I can learn few things for you.

     Thanks in advance. 

Re: Alerting on Submit Frames or Time Window Changes

$
0
0

Hi Rick,

 

There are several options. You can use auditing capabilities to track all changes in the system. You can build reports on this as well.
The other option is the OnDefinitionChange trigger type. This fires for all object changes. You can add additional checks here, you can prevent changes from happening or send out alerts.

The final option (which is probably even better in terms of governance) is setup a correct security access model, allowing NO changes in production to definition objects. This way your change board can request impact analysis on changes like that.

 

Regards Gerben

Re: Parent job

$
0
0

Thank you Gerben/HP for helping me to understand.

 

Regards,

Chandu

Re: SAP tables

$
0
0

Hi Chandu,

 

Redwood has JDBC definitions, these can access any table of your SAP AS.

 

Note that SAP does not recommend changing database data directly.

 

You will need a free slot in your license for the JDBC process server.

 

You can find quite extensive information on JDBC in the documentation. Please let me know if you need more information, and mention the version you are currently running.

 

Regards,

 

HP

Re: SAP tables

$
0
0

Hi Chandu,

 

If you only want to read a table, you can also achieve this by using Redwood Script and calling the XBP interface.

 

This would allow reading a table directly via RFC. If you require this, let me know, I have some scripts that do this.

Re: SAP tables

$
0
0

Thank you HP.

 

Hi Valentijn,

 

It would be very helpful for us, if you can provide a sample script on how to read a table using Redwood script.

 

 

Regards,

Chandu


Re: SAP tables

$
0
0

Hi Chandu, Valentijn,

 

You should be able to use XBPInterface.readTable.

 

In the API docs, you have on the bottom left-hand side XBPInterface, this class has a "readTable" method which, according the API documentation:

 

java.util.Iterator readTable(java.lang.String tableName, java.lang.String delimiter, java.lang.String[] columns, java.lang.String[] whereClauses, int rowSkip, int rowCount)

Read the contents of the given SAP ABAP table

Parameters:
tableName - name of the ABAP table
delimiter - column delimiter. Default is |.
columns - array with column names that should be retrieved. All columns are retrieved if the array is empty or null.
whereClauses - array with where clauses for the query statement. No where clauses are applied if the array is empty or null.
rowSkip - number of rows to skip from the beginning of the result set, or -1 to get the complete result set
rowCount - number of rows to retrieve, or -1 to retrieve all rows
Returns:
Iterator with the table rows of type TableRow
Regards,
HP

Re: SAP tables

$
0
0

Hi Chandu,

 

Below code reads tabel USR02 from the sap backend system sapsys (replace <partition.sapsystemname> with your sap system)

It returns the fields MANDT and BNAME and prints the output to stdout.log

 

----------------------------------------------------------------

import java.util.*;

import com.redwood.scheduler.api.model.*;

import com.redwood.scheduler.api.connector.sap.rfc.scripting.*;

import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.*;

 

{

/**

   * Read a table from SAP backend system using the XBP interface.

   *

   */

 

 

  // Define the SAP System to connect to

  SAPSystem sapsys = BusinessKeyLookup.getSAPSystemByBusinessKey(jcsSession, "<partition.sapsystemname>");

 

  // Define new rfc object

  RfcConnectionManager saprfc = new RfcConnectionManager(sapsys);

 

 

  // Call XBP Interface and perform readTable

  saprfc.callXBP(new XbpWork()

  {

    public void performWork(final XbpInterface xbp)

    {

      for (Iterator it = xbp.readTable("USR02","|",new String[] {"MANDT", "BNAME"} ,new String[] {},0,-1); it.hasNext(); )

      {

        TableRow t = (TableRow) it.next();

       jcsOut.println(t.toString());

      }

    }

  });

}

------------------------------------------------------------------------


Kind regards,

Bas Valentijn

Re: How to kill a job chain before when another job chain starts

$
0
0

Thanks for the quick reply Manisha1!

 

I'm still learning the Redwood script and can't get this to compile.  Does the query need to be a separate object?  If so what type?

Re: How to kill a job chain before when another job chain starts

Re: How to kill a job chain before when another job chain starts

$
0
0

//***********Constant declaration********

String query = "";

String sJobChainName = (put job chain name here)

Viewing all 2607 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>