I use a Python scripted parameter to do this. I think this is really the best way to do this. In the Navigator, right click on User Parameters, choose Manage User Parameters, click on the + and choose Scripted. The following code just works, you can reformat the date in the last part if needed.
import datetime
return datetime.datetime.now().strftime("%Y%m%d%H%M%S")
As an alternative you can use a Creator to initiate the workspace, a DateTimeStamper to create a timestamp followed by FeatureReaders to do the rest of the process and keep the _timestamp attribute at all features. This is how I do all my workspaces (Creator + FeatureReader) but dragging the _timestamp attribute through the entire workspace can be a lot of work (lazy dude here) and probably will effect performance in a negative way when handling a lot of features.
You also can use a VariableSetter and VariableRetriever's to get the _timestamp before every writer, but these transformers and featurecaching do not always work well together.
I use a Python scripted parameter to do this. I think this is really the best way to do this. In the Navigator, right click on User Parameters, choose Manage User Parameters, click on the + and choose Scripted. The following code just works, you can reformat the date in the last part if needed.
import datetime
return datetime.datetime.now().strftime("%Y%m%d%H%M%S")
As an alternative you can use a Creator to initiate the workspace, a DateTimeStamper to create a timestamp followed by FeatureReaders to do the rest of the process and keep the _timestamp attribute at all features. This is how I do all my workspaces (Creator + FeatureReader) but dragging the _timestamp attribute through the entire workspace can be a lot of work (lazy dude here) and probably will effect performance in a negative way when handling a lot of features.
You also can use a VariableSetter and VariableRetriever's to get the _timestamp before every writer, but these transformers and featurecaching do not always work well together.
My preference in scenarios like this is to trigger the workspace with a creator and use a datetimestamper to get one datetime then allow that to flow through the process. To read in features you will need to use feature readers as @nielsgerrits has suggested
I use a Python scripted parameter to do this. I think this is really the best way to do this. In the Navigator, right click on User Parameters, choose Manage User Parameters, click on the + and choose Scripted. The following code just works, you can reformat the date in the last part if needed.
import datetime
return datetime.datetime.now().strftime("%Y%m%d%H%M%S")
As an alternative you can use a Creator to initiate the workspace, a DateTimeStamper to create a timestamp followed by FeatureReaders to do the rest of the process and keep the _timestamp attribute at all features. This is how I do all my workspaces (Creator + FeatureReader) but dragging the _timestamp attribute through the entire workspace can be a lot of work (lazy dude here) and probably will effect performance in a negative way when handling a lot of features.
You also can use a VariableSetter and VariableRetriever's to get the _timestamp before every writer, but these transformers and featurecaching do not always work well together.
Thanks, I tried the python scripted parameter and it works