Calculating the duration of a task according to other tasks - ms-project

I am using C# COM-Interop to automate the creation of a MS-Project file.
After the creation of the MS-Project file, I create some indented tasks that receive by a web service.
Test1 duration=? startDate=?
|-Test2 duration="1 day" startDate="02/08/17"
|-Test3 duration=? startDate=?
|--Test4 duration="3 day" startDate="03/08/17"
|--Test5 duration="2 day" startDate="05/08/17"
|-Test6 duration=? startDate=?
|--Test5 duration="1 day" startDate="08/08/17"
For each main task of the file, I want to calculate the duration and the start date of a task according to the tasks that are under it. But I don't know what kind of properties I can use to do so.

Start and Finish dates of Summary tasks are calculated automatically; you do not need to calculate the duration or Start/Finish dates of a Summary task.

Related

How to specify/use idempotent "date of execution" within dagster assets/jobs?

Coming from airflow, I used jinja templates such as {{ds_nodash}} to translate the date of execution of a dag within my scripts.
For example, I am able to detect and ingest a file at the first of August 2022 if it is in the format : FILE_20220801.csv. I would have a dag with a sensor and an operator that uses FILE_{{ds_nodash}}.csv within its code. In other terms I was sure my dag was idempotent in regards to its execution date.
I am now looking into dagster because of the assets abstraction that is quite attractive. Also, dagster is easy to set-up and test locally. But I cannot find similar jinja templates that can ensure the idempotency of my executions.
In other words, how do I make sure data that was sent to me during a specific date is going to be processed the same way even if I run it 1, 2 or N days later?
If a file comes in every day (or hour, or week, etc.), and some of the assets that depend on the file have a partition for each file, then the recommended way to do this is with partitions. E.g.:
from dagster import DailyPartitionsDefinition, asset, sensor, repository, define_asset_job
daily_partitions_def = DailyPartitionsDefinition(start_date="2020-01-01", fmt=%Y%m%d)
#asset(partitions_def=daily_partitions_def)
def asset1(context):
path = f"FILE_{context.partition_key}.csv"
...
#asset(partitions_def=daily_partitions_def)
def asset2(context):
...
def detect_file() -> Optional[str]:
"""Returns a value like '20220801', or None if no file is detected """
all_assets_job = define_asset_job("all_assets", partitions_def=daily_partitions_def)
#sensor(job=all_assets_job)
def my_sensor():
date_str = detect_file()
if date_str:
return all_assets_job.run_request_for_partition(run_key=None, partition_key=date_str)
#repository
def repo():
return [my_sensor, asset1, asset2]

how to make a dummy job to run for 30 minutes in controlm

I have the requirement to run dummy jobs for 30 minutes and 60 minutes respectively.
I have tried with --delay 30 in command line jobs, but I did not get the expected delay.
Designating a job as type ‘dummy’ will bypass anything contained within the command line field.
You have two options to create a 30/60minute timer job.
Option a:
Make the job a command line type job and put sleep 1800 or sleep 3600 in the command line field.
Option b:
Make the job a dummy type job and put sleep 1800 or sleep 3600 in either the pre-execution or post-execution fields.
By default the sleep command operates on seconds. For windows you may want to look into using the power shell version which would be powershell.exe -command start-sleep 1800
Use _sleep over sleep instead
Another way to enable a waiting time, either before or after an OS-type Job is by using the pre-execution or post-execution command options, as appropriate.
The use of _sleep is more convenient because it is operating system independent and is provided by the Control-M/Agent, which means that you do not require an extra deployment for that functionality.

Finding time between two patterns

I am new to unix and can someone help me with following query?
I have a deployment log file and there I wanted to search for two pattern (eg: started , completed ) and after getting the out put I just want to calculate and print the time taken between the started step and completed step
I tried a lot I’m able to print the the out put but unable to print the time taken between those steps
Thanks in advance,
Mahi
Below is the sample deployment log and at the starting line i am searching for "DeploymentStart" and, at the end of the line "DeploymentCompleted".
After printing this out put i want to calculate the time taken between deploymentStart time and DeployemntCompleted time.
us>InterimDeploymentStart1523623301227ETA0submittedCount3suppressedCount0listRejectedCount0<
/Pair>batchSplitRejectedCount0emailRendererRejectedCount0
Apr13 12:41:49,492 INFO com.epsilon.deploymentStatusNotifier.util.DeploymentStatusNotificationConverter taskScheduler-2 - JobMessage createdcom.epsilon.common.jobs.model.JobMessage#530c458e
Apr13 12:41:49,488 INFO com.epsilon.deploymentStatusNotifier.util.DeploymentStatusNotificationConverter taskScheduler-2 - JobMessage createdcom.epsilon.comm
JobMessage>de841c92-6682-4696-883c-3087a9194531HarmonyPipelinecompletedDeploymentCompleted1523623301227ETA0

Making a self destructive code in R

I was making a package in R and would like it to make it as a trial version for a period of 30 days .
Well my question is how to make a code self destructive depends on number of days ??
I had played with time and date package for a while where i came to know ,
Sys.Date() could give todays date , so i get forard with something below
today=Sys.Date()
a=today
b=a+1
if(a==today)
{
print(paste("today is sunday"))
if(b==today){
print(paste("today is monday"))
}
I know it is stupid work whatever i had done , my sole idea was to fix the 1st use of package as starting day ,and every day it will increment till 30 days ,when it will reach the limit it will automatically destroy using
file.remove () <- through which I can remove some file ........
May be I am clear with my ideas .
Sorry for the novice question .
Add this condition to the license. ("30 days for free, after that you'll have to pay".) and expect users to comply with this.
There is really nothing else you can do.
Well, actually you can. For example, on the first occasion your code is run, save the current date to a file in a certain location (say, "~/.datetocheck"). Then every time your code is run, check for the existence of this file, and if it exists, compare the dates. If more than 30 days have passed, give an error message:
stop("Time is over! You have to pay!")
The problem is that nothing prevents the user from simply deleting this file.

Wrapper script to run a particular job in Control m

I have to write a wrapper script to run 3 jobs in control M if a variable is Y i.e
$EOM_1=’Y’ [incase of End of Month true]
$EOM_1=’N’ [incase of End of Month false]
i.e if $EOM_1=’Y’ run jobs like ${DirTOOLS}/WaitUnitFileExists.sh $APIS/files/tr/chqload/local/INWUSD.dat 60 05 30
Why is the wrapper script needed? You can do this with the Job Defintions within Control-M. In the DAYS field in the job scheduling defintion for the job to run the last day of the month you would put L1.
For the Job that will run all but the last day of the month you specify -L1 in the DAYS field. For the job that has to wait on a file, run the Control-M File watcher utility that will then add the condition for the job or force the job in to run.

Resources