Wednesday, 28 February 2018

Schedule this Batch to Download via FTP | Windows

We can use Linux-based utilities which are more secure and available for windows, like "wget" and "WinSCP" which is also a good option, but I preferred to stay in windows using the default old FTP command. Or we also can use Powershell instead of the old command-prompt-based batch file.


Anyhow, below is just one windows command using echo to redirect the text in a file and then the file will be called by FTP.

Just Run or you can write this command in a batch file to schedule.

cd /d "C:\Users\AQ\INTEGRATION\download"

echo open 10.152.30.229 >> ftp.txt & echo user myuser mypassword >> ftp.txt & echo binary >> ftp.txt & echo get "filename.dat" >> ftp.txt & echo bye >> ftp.txt & ftp -n -v -s:ftp.txt & del ftp.txt


1. 1st line is the path, where you want to download. 

2. Replace myuser and mypassword with the real FTP user credentials.

3. This script will create a file ftp.txt, and at the end of the line: this file is called by FTP before deletion. 


Note: Security concerns: username and password are written here. 

We also can use power sh


Tuesday, 13 February 2018

Stop Workflow in BULK by Escallation | IBM Maximo

Lets say we want to stop the workflow for multiple PRs at once. We can achieve this creating a new escalation and schedule it perform this action automatically.

for instance, we want to stop PR-123 from backend, for that we are going to create a escalation and once action which will be attached with this escalation.


STOPWF_PR    Stop PR Workflow
Applies to: WFINSTANCE
Condition:
active = 1 and ownertable = 'PR' and exists (select 1 from PR where PR.PRID = wfinstance.ownerid and prnum in ('PR-123')
)
Schedule: Your desired time and date. suppose every 1 minute

Escalation point: Add a row only, no need to enter anything
 
Action : STOPWF
Create a new action and attached to this escalation
 
Action: STOPWF Stopwork
Type: Custom Class
Custom Class: psdi.workflow.StopWorkflowAction (auto populated)
Accessible from:
ESCALATION